The function to start Workflow is not working.

cspra
Giga Expert

Hi Experts,

startFlow() function does not work as expected after executing the code below from Background Script or Work Flow - Run Script.

Is there anything wrong/missing from this code? 

 

var wf = new Workflow();
var wfId = wf.getWorkflowFromName("My Workflow");
gs.log(wfId); //---> This is getting displayed!!!
wf.startFlow(wfId, null, "My Workflow", current, 'update');

Thanks!