Event trigger transitions
Events and transitions
A workflow editor can add one or more workflow triggers to listen for an event, and when the event occurs, transition the state. The following events are related to state changes and content changes and can be used in a trigger with a set-state macro to transition a state.
This use of workflow events to transition a workflow state can help in creating a more responsive workflow, including workflow events related to transitions
Any workflow event can be used in a trigger with a set-state macro to transition to a destination state.
Event transitions
A workflow editor can add one or more workflow triggers to a workflow that can be used to listen for a workflow event and transition the workflow when the event occurs. For example, the following trigger transitions the state to the Policy Review state in the applied workflow when the policy label is added
{trigger:labeladded=policy}
{set-state:Policy Review}
{trigger}The set-state macro actions the transition to the destination state added as a parameter value.
The event can be limited to a specific occurrence using a workflow condition. For example, our above trigger can be set to listen for the label addition only when the workflow is in a named state.
{trigger:labeladded=policy|state=Draft}
{set-state:Policy Review}
{trigger}You can use the set-state macro in a trigger that listens for any workflow events related to state changes and content changes:
Content review events
The following events are related to content reviews (approvals) and can be used in a trigger with a set-state macro to transition to a new workflow state.
pageapproved,newsapproved,pagerejected,newsrejected,pageapprovalassigned,newsapprovalassigned,approvalunassigned
You can add a condition to constrain an event transition. For example, a state content review transition, by default, requires all assigned reviewers to agree on the review decision before the transition occurs.
Instead of waiting for the reviewers to agree on the rejection, you can add a workflow trigger to fast-track the transition on a single rejected decision by a reviewer.
{trigger:pagerejected|approval=Review|partial=true}
{set-state:In Progress}
{trigger}The trigger is listening for the pagerejected event for the approval named Review. In our example workflow, this approval is in the Review state. The added partial=true means that the trigger is only listening for a single rejection decision. Without this partial=true parameter, the trigger waits until all reviewers have rejected the content review.
See: How can I fast-track a single rejection or a single approval decision
State changed events
On a transition into a state, you can use a workflow trigger to immediately transition to another state
The following events are related to state change and can be used in a trigger with a set-state macro to transition to a new workflow state.
statechanged,newsstatechanged,pagestatechanged
For example, after a rejected decision and a transition to the Rejected state, you can use the statechanged event in a trigger to immediately transition to a working Updating state. The transition to the Rejected state is recorded in the page document activity, and the document is immediately moved to a state used for actively updating the document to get things done.
{trigger:pagestatechanged|state=Rejected}
{set-state:Updating}
{trigger}Expired event
The following event is related to state expiry and can be used in a trigger with a set-state macro to transition to a new workflow state.
stateexpired
{trigger:stateexpired|state=Approved}
{set-state:Annual Review}
{trigger}Updated content events
The following events are related to content updates or changes and can be used in a trigger with a set-state macro to transition to a new workflow state.
pageupdated,newsupdated,pagemoved,attachmentschanged,attachmentadded,attachmentupdated,attachmentremoved,attachmentversionremoved,labeladded,labelremoved
Check out the events page for events related to page comments.
See: Use attachment events in workflow triggers
Page parameter update event
If using a workflow parameter in your workflow, a transition can be triggered when a user edits its value on the page. The following event is related to a change in the page parameter value and can be used in a trigger with a set-state macro to transition to a new workflow state
pageparameterupdate
{trigger:pageparameterupdate|parameter=Reviewers}
{set-state:In Progress}
{trigger}For this to work, the workflow parameter must be set as editable in the workflow.
Task events
The following events are related to workflow tasks and can be used with a set-state macro in a trigger to transition to a new workflow state.
taskcreated,taskassigned,taskcompleted,taskexpired
Related pages
Need support? Create a request with our support team.
