Calling a workflow inside a workflow

Geeky
Kilo Guru

How can I call a workflow inside a workflow?

E.g. I have a form and a field called Workflow which is a reference field to the wf_workflow table.

I have the main workflow and inside that one more workflow should be called by fetching the data from the field which I created.

I know how to fetch the workflow id from the reference field I created inside the main workflow but unable to find how can I trigger a workflow with workflow id?

1 ACCEPTED SOLUTION

sachin_namjoshi
Kilo Patron
Kilo Patron

use below code to trigger workflow from run script activity in your parent workflow.

var wflw = new Workflow();


wflw.startFlow(wflw.getWorkflowFromName('give the workflow sys_id_from your reference variable'), current, 'update');

 

Regards,

Sachin

 

View solution in original post

9 REPLIES 9

You need to use below:

 

var w = new Workflow();

var context = w.startFlow(sys_id, current, current.operation(), getVars());

 

Please mark my answer correct/helpful if it helped you

then, you can dot talk from your variable which is pointing to wf_workflow table which contains name of workflow.

 

Regards,

Sachin

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

In that case make sure your workflow is checked out then you can drag the workflow & drop it in designer. Once done you can connect it after the activity you want it to be triggered.

In that case workflow will be the same but I want to provide an option to choose workflow by the user.

you can drag an workflow from one to another and connect it to previous activities? i was just told thats not an option?