StartFlow in Global Workflow is running synchronously

Swathi Prasad
ServiceNow Employee
ServiceNow Employee
var wf =new global.Workflow();
var wfSysId = wf.getWorkflowFromName("myWorkflow");
var wfContextGr = wf.startFlow(
    wfSysId,
    null,
    "myWorkflow", {
            u_instance_name: instanceName
     }
);

 In the above code I get "wfContextGr" only once the workflow ends. Are workflows synchronous? Is there a way to get wfContextGr just after starting the workflow and not wait till the end of the flow?

0 REPLIES 0