0
var gr = new GlideRecord('table');
 gr.addQuery('sys_id','sys id');
 gr.query();
 if(gr.next())
 {
 var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('give the workflow name'), gr, 'insert');
 }
How to run workflow from background script or how to start workflow from business rule ServiceNow?
Working Code Asked question September 6, 2023