Overview | Triggers | Example | Related pages
Triggers
A JSON trigger
contains three different properties
Multiple triggers can be added to a workflow. A trigger for an event must include at least one or more actions.
JSON trigger events | JSON trigger conditions | JSON trigger actions |
---|---|---|
|
|
|
You can add the trigger JSON code to your custom workflow using workflow builder.
Example
In a 4-state workflow, you might want the workflow to move immediately from a Rejected state to a more proactively named Triage state rather than waiting for a user to manually transition the content.
You can use a trigger to listen for the state change event to the Rejected state and set the trigger action to immediately transition to the Triage state.
The trigger is created using JSON code.
"triggers": [ {"event":"on-change-state", "conditions": [ {"state":"Rejected"} ], "actions": [ {"action":"change-state", "state":"Triage"} ]} ]
If you want to add this trigger to a workflow using Workflow Builder, copy and paste the JSON code format (without the opening "triggers":
JSON markup notation) to the Triggers dialog in the Edit Workflow panel in Workflow Builder.
There are a number of workflow events that can be added to a trigger. For each trigger, you can set one or more conditions, for example, to constrain a trigger to listen for an event that occurs in a particular state. One or more actions can be added to a workflow trigger that is undertaken when the event takes place.
Each trigger action can have a number of mandatory elements and optional elements depending on the action.
Related pages
Triggers
Using Workflow Builder