Initiates a workflow on-demand. This method is the programmatic equivalent of the “Initiate a workflow action” action in SuiteFlow.
Returns the internal ID of the workflow instance used to track the workflow against the record.
var workflowInstanceId = workflow.initiate({
recordType: 'customer',
recordId: 24,
workflowId: 'customworkflow_myWorkFlow'
});