run subworkflows in a workflow

Snow Tomcal
Tera Expert

HI, 

I am trying to run multi workflows asynchronously from run script activity in a different workflow. we tried to use sn_fd.FlowAPI but nothing happened 

attaching the script-

for(var i=0; i<5; i++){

sn_fd.FlowAPI.getRunner().flow('global.flow_name').inBackground().withInputs(input_object).run();

}

I am looking at the workflow history and nothing happens.

Thank you!! 

 

6 REPLIES 6

Hi @Snow Tomcal 
What variable do you want to send to the workflow and what do you expect from it? 

You can try to call it like in the solution from this solution of the question:

 

https://www.servicenow.com/community/developer-forum/how-to-pass-input-parameters-to-a-workflow-that...

 

You would pass the variables as a JSON name:value pair like:

 

wf.startFlow(wfId, null, "Workflow Name", {input_var_name: input_var_value});

 

I haven't tried it.

Hope that this helps you!

If the provided information answers your question, please consider marking it as Helpful and Accepting the Solution so other community users can find it faster.

All the Best,
Stefan