Using script to start subflow?

DrewW
Mega Sage
Mega Sage

Has anyone used a script to start a subflow?   We have a catalog item that is for new software and it has a bunch of check boxes that are for the software the user would like access to.   Each one has its own workflow.   So what I was thinking is rather than have 60+ "If" activities to check the var's I would just use a script.   Just wondering if anyone has done this before and what issues they have found.   We do want the item to stay open until all of the workflows complete.

1 ACCEPTED SOLUTION

russ_sarbora
ServiceNow Employee
ServiceNow Employee

The Parallel Flow Launcher activity introduced in Fuji is intended to solve this problem. It allows you to start any number of dynamic subflows.


View solution in original post

9 REPLIES 9

Ken83
Mega Guru

chandan padhy outlined how to start the workflow in this thread → Starting a workflow from Script �. I have utilized a UI Action to restart an existing workflow but not to generate one from the beginning. Nonetheless, I haven't had any issues with it.


But I want to start a workflow from a workflow as a subflow and I may need to attach 20 or more to the same sc_req_item record.


Duodecimal
Mega Guru

I think if I weren't going to use something like an order guide for this, I would generate a task for each piece of software created and associate a workflow with those tasks, and those tasks should list your original item as the parent. Then a typical business rule would handle checking for active child tasks before closing.


The issue with creating a catalog task for each is that some of the software requires special processes, so creating one cat task does not allow me to go thru all of the other work that Software X needs before being deployed.