Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Overview | Triggers | Example | Related pages
Overview
You can use workflow triggers to help automate your documentation process and flexibly respond to workflow events. For example, you can use a trigger to automatically send an email when a page is submitted for review.
...
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 /wiki/spaces/CDMCD/pages/614010813 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.
Code Block |
---|
"triggers": [ {"event":"on-change-state", "conditions": [ {"state":"Rejected"} ], "actions": [ {"action":"change-state", "state":"Triage"} ]} ] |
Info |
---|
If you want to add this trigger to a workflow using workflow builderWorkflow Builder, copy and paste the JSON code format (without the opening |
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 are is undertaken when the event takes place.
...