change-state trigger action
Contents:
You can use the Change State action in a trigger to automatically update the workflow state in response to a workflow event.
For example, it can be used to fast-track a single reviewer’s rejection decision when multiple reviewers are assigned to an approval.
Change State action parameters
Action Parameter | Value | Notes |
|---|---|---|
State MANDATORY | Use the dropdown to select one of the states in the workflow. | The state options are populated by the states in the workflow. Changing the state name in the workflow might cause a validation error |
You can add a Change State action to a workflow trigger. When the workflow Event occurs, the trigger checks that any required Conditions are met, and if they are met, the Change State action forces a change of the state to a specified state.
This lets you respond flexibly to workflow events, such as when a single reviewer approves a page.
“change-state” JSON code
A Change State workflow trigger action added using the visual editor is automatically displayed as the “change-state” trigger action in the workflow code editor.
You can also use the code editor to add the workflow trigger and the “change-state” action.
"change-state" parameters and workflow example code:
"change-state"
The trigger action "change-state" causes the state to change to the specified state if the provided parameters are valid.
action (change-state)
state❗️ destination workflow state for the action
state must be a state in the workflow
state names are case-sensitive
❗️ Mandatory parameter
state parameter
state parameter must be included with a valid value for the destination state
Example trigger code
"triggers":
[
{"event": "on-change-state",
"conditions":
[
{"final":true}
],
"actions":
[
{"action": "change-state",
"state": "Archive"}
]}
]The example trigger listens for the workflow's change of state to the final state and immediately moves the workflow to the Archive state.
The destination state must be included in the "change-state" action.
Here is the JSON code for the example trigger that fast-tracks a single rejected decision. You can use this to prompt remedial actions quickly, for example, when multiple reviewers are assigned to an approval.
"triggers":
[
{"event": "on-reject",
"conditions":
[
{"state":"Review"}
],
"actions":
[
{"action": "change-state",
"state": "Draft"}
]}
]The trigger action moves the workflow from the Review state, which contains an approval, to the Draft state when a reviewer rejects the page.
Need support? Create a request with our support team.
