Workflow Handlers
Workflow events are raised as a workflow "flows" through its lifecycle (for example, START, END, ENTER, LEAVE and TRANSITION). Workflow handlers let you hook custom business logic into these events.
Workflow event handlers are registered within your workflow model at either the instance-scope or the task-scope. As with other elements in your model, the task-scope inherits from the instance-scope which means that you are allowed to globally declare task events (like ENTER or LEAVE) at the instance level if you wish to. Doing so will apply the same task event handlers to all tasks.
Each handler registration provides a type and an optional config. Some handlers require config and others do not. For example:
{
"handlers": {
"START": [{
"type": "logger",
"config": {}
}]
}
}
For a complete example of a workflow model with handlers, see Workflow.
The following handlers are available out-of-the-box: