Workflow Definitions
Workflows definitions allow you to configure a pre-defined process for entries. Each workflow definition describes the schema for its workflows by a sequence of workflow steps which the executed workflows undergo.
Limitations
A workflow definition can define up to 20 steps. Defining more than 20 steps will result in a validation error.
The current maximum limit for workflow definitions is 20. If you lose access to the workflow API due to a price and package downgrade we will ensure that you can delete and complete existing workflows. An overview for our pricing and packaging can be found here.
Workflow definition schema
Besides the sequence of workflow steps, there are multiple properties to specify how workflows behave.
* The items in the list appliesTo must match the following shape:
{ linkType: "Entry", type: "Link", validations: [{ linkContentType: ["contentTypeA", "contentTypeB"] }] }
It is recommended to have only one item in appliesTo as well as only one item in validations. If you want to address multiple content types, you can do so by mentioning multiple within the list at linkContentType.
** In addition to the common sys properties, a workflow definition has the following extra sys properties
The flow type of a workflow definition
The property flowType controls to which step a user can move a workflow. It supports the follow two modes:
no_restriction: Apply no restrictions when moving a workflow to another step.strict_neighbor: Enforce non-admin users to only move to the previous or the following step. The workflow can only be marked as ‘complete’ upon reaching the last step.
Automatically start workflows
The property startOnEntityCreation will automatically start a workflow for newly created targeted entries. Each time you create an entry of a content type configured for this workflow definition, the workflow will start automatically. However, this does not mean that workflows are started for entries that were already created before setting this property to true.
Assign multiple workflows to the same content type(s)
You can choose to configure multiple workflows for the same content type. This allows different teams working on the same content type to use dedicated workflows for their own review processes and governance.
Workflow step schema
A step within a workflow definition is described by the following properties.
* When leaving out the id in a POST/ PUT request for a workflow definition, you create a new step at that position in the list. When you define it (in a PUT request), you thereby update the existing step with that id.
Workflow step permission schema
In addition to the permission defined by a users role, a workflow step can restrict or grant permissions for selected users or teams. The permissions can only apply to a single active step in a workflow. The user restrictions in step permissions do not apply to organization or space admins. One permission must provide the following properties:
* There are two supported types for targeted resources:
workflow_permission: Use this together with the action beingeditto explicitly allow or deny who can move the workflow to another step.entity_permission: Grant or restrict permission to edit or publish the entry on which the workflow is being executed.
Workflow step action schema
When a workflow reaches a step, it will automatically trigger the actions defined for this step. Those actions can be one of the following three:
- Send an email to a set of users and teams. Additionally, you can also use any valid email address. The email notifies about the workflow being moved to this step. So far, the template is fixed and cannot be changed. There may be only one email action per step.
- Create an entry task with a customisable message and assign it one user or team. Optionally, you can define a due date. Please note that you need to have the tasks app installed. You can define up to three task actions per step.
- Send a custom message via Slack to a selected (public) channel about the workflow being moved to another step. Please note that you need to have the Slack app installed to use its app action. There may be only one Slack action per step.
Depending on the type, an action is defined by the following properties:
Workflow definitions collection
This endpoint returns a paginated list of workflow definitions for a given environment.
Permissions
Any user can read workflow definitions.
Use this endpoint to create a workflow definition.
Permissions
Only organization or space admins can create a workflow definition.
Workflow definition
Permissions
Any user can read a workflow definition.
Permissions
Only organization or space admins can update a workflow definition.
Permissions
Only organization or space admins can delete a workflow definition.