In many cases a Workflow Job is opened at the completion of a form representing its first task. For example a user may complete a Form that is the fit step of a business process.
To start a new instance of a Workflow Job and simultaneously complete its first Interactive Task by passing the name of the process and interactive task into workflow.openJobAndCompleteFirstTask(processName, firstTaskName). You can also optionally pass in a completion state, owner and reason.
workflow.openJobAndCompleteFirstTask(processName, firstTaskName)
Continuing from Introduction to Workflow Decision Nodes.
Add a Button Control to supplyEmailForm with an On click event that calls:
system.workflow.openJobAndCompleteFirstTask("sendEmailProcess", "supplyEmailNode");
Run the Form , provide an email address and click the button.
View the server log to see that a Workflow Job has been opened and your email address has been logged by the System Task.