Contentstack allows you to create workflows for your stack. However, before you get started with setting up workflows, it’s important to note that:
To create a workflow in your stack, log in to your Contentstack account and perform the following steps:
Navigate to workflows
- Go to your stack, navigate to the “Settings” icon (press “S”) on the left navigation panel.
- Select Workflows (press “alt + F” for Windows OS, and “option + F” for Mac OS).
- On the Workflow Settings page, you will see two tabs: Workflows and Publish Rules. In the Workflows tab, click on the + New Workflow button.
This opens up a new window where you can define your workflow and its stages as discussed in the next steps.
Enter workflow details
On the workflow creation page, enter the following details.
- Workflow name (mandatory): Provide a suitable name for the workflow
- Description (optional): Provide a description of the workflow.
- Scope: Select the content type(s) for which this workflow should be applicable. These are shown in the following screenshot:
- Branch(es) (mandatory): Select either all or specific branch(es) for which this workflow should be applicable.
- All Content Types: Lets you apply the workflow for all the content types and its entries.
- Specific Content Type(s): Lets you select the content types for which this workflow will be applicable.
Selecting this option allows you to select content types from the Select Content Type window drop-down menu. Select the required content types by checkmarking them.
You can choose multiple content types to which you want to apply the workflow settings.
Once you select the content types (and if the workflow is enabled), the entries of these content types will have a Workflow section on the right sidebar.Note: A content type can be associated with only one workflow. This means you cannot add a content type to the scope of more than one workflow.
Add workflow stages
To add workflow stages, perform the following steps:
Click on the Add stage button.
- In the Workflow Stages section, provide a suitable Stage name (mandatory) and Description (optional).
You can also choose a color label for your stage. Please ensure that the color labels and names of the stages are unique.
Note: You can add a maximum of 20 stages in a workflow.
Add stage transition and access rules
Every stage comes with a set of stage transition and access rules. The transition rules define the conditions that are applicable when you move an entry from one workflow stage to another on the entry page. In addition, the stage access rules allow you to control who can edit an entry at a specific stage of the workflow.
There are three stage transition and access rules that you can configure for every stage:
- Next available stage: This defines the stage of your workflow that will be available when you move the entry from one stage to another. This is useful when you want the entries to go through certain stages, without skipping essential stages.
Select one of the following options:
- All stages: It is the default option. Select this option if you want the users to be able to move the entry from current stage to any other available stages.
- Specific stage(s): Select this option if you want users to move an entry from current stage to a specific stage(s) of your workflow.
Tip: While selecting specific stages, you will be able to see or select only the stages that you have already created in your workflow. This means that while creating your first stage, you will not see any stage when you choose the Specific stages option. In that case, you will need first to create other stages, and return here to select specific stages.
- Users/roles who can move from this stage to next available stages: This option gives you greater control over the usage of your content workflow. It lets you control who can move the entry from its current stage to the stages that you add under the Next available stages option.
Select one of the following options:
- All users/roles: It is the default option. Select this option if you want any of the existing user(s) to move an entry from its current stage to the next available stage.
- Specific user(s)/role(s): Select this option to allow only specific users, or users with only specific roles, to move the entry from its current stage to the next available stages.
Note: If you add specific users, other users will not be able to move the entry stage.
- Users/roles who can edit the entry in this stage: This option determines which users can edit an entry when it is at a specific stage of your workflow. By setting this rule, you can avoid unwanted modifications at specific stages and facilitate efficiency across the content lifecycle.
Note: The entry is available for editing, by default, in the first stage that you create in your workflow.
Select one of the following options:
- All users/roles: It is the default option. Select this option if you want to provide all users edit access over the entry in the current workflow stage.
- No users: Select this option if you want to restrict all users from accessing an entry when it has been moved to the current stage of your workflow.
Note: The workflow superusers, organization owners, and stack owners/admins are exceptions to this. They will be able to edit the entry.
- Current stage user(s): Select this option if you want to allow users who have stage transition rights to edit the entry in the current stage of your workflow.
Note: Although only specific users are able to edit the entry in the current stage, other users with stage transition rights will still be able to move the entry to the next available stage.
Add workflow superusers
Once you have added stages and defined transition and access rules, add the workflow super users by clicking on the drop-down menu.
- Superusers of the workflow can move the entry from one stage to any stage and edit or delete the entry, without any restrictions. The stage transition and access rules are not applicable to superusers.
However, this freedom and flexibility is available only for entry stage transitions of the content types associated with the workflow. Also, superusers cannot edit or manage workflow settings, unless they are an admin, owner or user with a developer role.Note: The Organization owner and the stack owner/admin are superusers by default.
- To add superusers, click on the field and select the required users you want to add. You can add multiple users.
Note: However, while you can add multiple users, note that you cannot add roles in this section
Enable workflow
To enable workflow, check the Enable workflow box as shown below:
Now, the workflow option will be available in the Status bar on the right for all the entries of the content types associated with this workflow.Save workflow
Click on Save to save the workflow.
API Reference
To create a workflow and add stages to it via API, refer to the Create a workflow API request.