Workflow Transition Tasks
\u003e Note: To be added in version 16 \u003e \u003e
Introduction
Workflow Transition Tasks are actions that can be run during state transitions in workflows. Each Workflow Transition can link to a set of transition tasks.
Each Workflow Transition Task can have tasks of the following types:
- App-Defined Actions (specified by each Frappe app through hooks.py)
- Server Scripts
- Webhooks
On top of this, each transition task can be either:
- Synchronous: This is the default mode of transition tasks. All of the transition tasks run one-by-one when the state transition is initiated. Even if one of them fails, the transition is reversed.
- Asynchronous: This mode can be enabled using the 'Asynchronous' checkbox. Each asynchronous transition task runs after the state transition is completed, meaning it has zero influence over state completion, and is run in a separate background job of its own.
App-Defined Actions
Each Frappe app defines them using the 'workflow_methods' hook.
Any dotted path method defined through the workflow_methods hook has to accept doc: Document as the parameter, which is the document on which the transition is being applied.
An example of an app-defined task is:
# hooks.py
workflow_methods = [{\