Standard Workflow for Automation

Money
Tera Contributor

Hello everyone!

I was curious...Has anyone come up with a way to have a "default" workflow (or flow) that can be used across catalog items that could have different variables that determine the path a workflow needs to go? For example:

 

Catalog Item 1:

variable 1 value

variable 2 value

Result: Add user to AD group 1

 

Also Catalog Item 1:

variable 1 value

variable 2 value

Result: Add user to AD group 2

 

Catalog Item 2:

variable 1 value

Result: Add user to AD group 

 

And the thought is both items in this scenario will have the same workflow attached. We would just have a config table of some sort that houses the matrix to determine the AD route.

8 REPLIES 8

luffy3478
Tera Guru

add a hidden variable with a name (action_name) on to the catalog form and populate this variable based on your scenerios.

in the config table pick up the path based on the value populated in the hidden action name variable

James Chun
Kilo Patron

Hi @Money,

 

Yes, you can create a custom 'framework' for this and it may take some time to build it in the first place, but it will be much time-saving in the long run.

 

I won't go too much into detail, but at a high level, you would have the following:

  • A table to store when/how the approvals/tasks are generated.
    • 'Condition' type field to check the variables
    • 'Flow' or 'script' to trigger when the condition is true
    • Approver/task assignee
  • A 'general' workflow/flow that iterates through the above and generates approvals/tasks when the conditions are met.

You can refer to the OOB HR Service Activities workflow as it's quite similar to what I stated above.

 

Cheers

Ryan Duce
Tera Guru

I would recommend NOT building your own framework from scratch for this - lots of custom code and really hard to upgrade / maintain!

 

I would recommend using Catalog Builder and Sequential Request Fulfilment for this.

ServiceNow have already built this workflow for you, and there are out-of-box "Approval" and "Task" definitions that you can modularly pull in to build up your workflow - see docs.

 

You can also define your own steps if the three out-of-box ones don't complete your use case.

luffy3478_0-1712239239464.png

I have built this framework long back. And we have extended it to multiple integrations (azure, AD, Jira). The time I have spent is worth