Call Workflow from Background Script

You can call workflow from the background script

var gr = new GlideRecord('table');
gr.addQuery('sys_id', 'sys id of a record');
gr.query();
if (gr.next()) {
	var wflw = new Workflow();
	wflw.startFlow(wflw.getWorkflowFromName('give the workflow name'), gr, 'insert');
}

One response

Leave a Reply

Your email address will not be published. Required fields are marked *