Drag parallel workflow and write the below code to launch multiple workflows from the script. The workflow will run individually.
var wf_name='WorkflowName'; coordinator = new WorkflowCoordinator( {workflow:wf_name} ); var list = current.variables.requesting_for; var listUser = list.toString().split(','); for (var i = 0; i < listUser.length; i++) { var gr = new GlideRecord('sys_user'); gr.get(listUser[i]); var mgr = gr.manager.toString(); coordinator.add( {nextWFVariable:mgr} ); } coordinator;
![](https://snowexpertrohit.com/wp-content/uploads/2021/09/Screenshot-2021-09-23-at-7.35.43-AM-1024x593.png)
Create another subflow and use this variable, use run script and assign that variable value inside scratchpad
workflow.scratchpad.variableName = workflow.variables.variableName;
For more information : https://docs.servicenow.com/bundle/rome-servicenow-platform/page/administer/using-workflows/concept/c_UsingVariablesInAWorkflow.html
No responses yet