Workflow - startFlow(String workflowId, GlideRecord current, String operation, Array vars)

Starts a specified workflow. See script include WorkflowScheduler and Business Rule "Start Workflow" on table sc_req_item for examples of use.

Table 1. Parameters
Name Type Description
workflowId String The sys_id of the workflow to start. This sys_id refers to table wf_workflow.
current GlideRecord The record to use as current in this workflow. This is normally from the Table field of the workflow properties for this workflow.
operation String The operation to perform on current. Possible values: insert, update, delete.
vars Array Collection of variables to add to the workflow
////where current is a task record with a workflow context
      var w = new Workflow();
      var context = w.startFlow(id, current, current.operation(), getVars());