Workflows

As a content development team, creating content for any enterprise requires a clear understanding of the requirements as well as the flow of content from one stage to another, till the time it is published. As content can be worked on by various team members, it is important to streamline the process to maintain consistency and improve the overall quality of all digital properties.

This is where Workflows come into play.

Workflows enable you to streamline the process of content creation, review, approval, and publication. It lets you manage the flow of content throughout your project lifecycle. With workflows, you can define stages through which your content needs to go, assign entry stages to users, add publishing approval rules, and do a lot more .

In this document, we will learn everything related to workflows and discuss some best practices as we go along. However, before we move any further, it is essential to know that:

  • Workflows are available only if they are part of your plan. 
  • Only the stack owner, administrator, and developer can create workflows.

Getting started with Workflows

To get started with implementing workflows for your stack, you need to create:

  • Workflows (which includes defining stages), and 
  • Publish rules (if required) 

Let’s understand what these two are.  

Understanding Workflows 

A workflow lets you define the content creation and review process for your team. The core part of creating a workflow is defining the stages of content creation.  

As we know, content flows through different stages before it is published. A workflow stage is nothing but the actual state of your content (entries). For example, if you are defining a workflow, you might want your content to flow through the following stages:

Contetnstack Workflow Stages.jpg

In the above example:

  • First Draft: Your first stage could be the draft writing stage where the content manager creates the first draft. 
  • Review: Then, a reviewer or an editor will review the draft to make the required changes in the content. 
  • Copyedit: Once the content is reviewed, someone proofreads the content during the copy editing stage.
  • SEO Tags: The SEO team will then add the SEO terms to increase the visibility of your content on the website in search engines.
  • Complete: The content is then marked as complete, and is ready for publishing.
  • Approved: The content is finally approved for publishing.

Once you have added these stages and enabled the workflow, the stages will be visible on every entry page of the corresponding content types of the stack. The workflow helps the content manager know the current stage of the content and control pushing the entry from one stage to another

Whenever a new entry is created, let’s say in the Draft stage, the user can work on this stage and push it to the next stage and assign it to a different user. The user can also assign a deadline (due date) for completion of the next task along with any special instructions if needed.

When an entry is assigned to a user, it appears in the Tasks notification, as shown in the following screenshot:

7.jpg

While defining workflows, you can also set Stage transition rules (i.e., only certain users can move to certain stages) and assign superusers (to whom stage transition rules do not apply), and do a lot more. 

Workflow thumb.png

We will learn more about creating and using workflows in a later section. 

Understanding Publish Rules

Publish Rules are like conditions that you define for your content publishing. They govern if entries can be published with or without someone’s approval or only when the content is at a particular stage. 

For example, you can define a publishing rule that every entry first needs to be approved by John Smith. Unless John Smith approves it, the entry cannot be published. 

Alternatively, if you define that the stage should be Complete to be published, the entry will not be published unless the Complete stage is reached. We will learn more about Publish Rules later in the document. 

Publish Rules Thumb.png

Setting up Workflows

In this section, we will learn how to create workflows for your stack. However, before you get started with setting up workflows, it’s important to note that:

  • Only the stack owner, administrator, and developer of the stack can create and manage workflows. 
  • Content managers and users with custom roles cannot view workflow settings. They can use workflows in entries and view and manage their tasks
  • You can create multiple workflows within a stack. Workflows can be created for all or specific content types. However, a content type cannot be associated with more than one workflow.

Add workflows and stages

Let’s look at the steps involved in creating a workflow. 

  1. Navigate to workflows
    1. Log in to your Contentstack account.
    2. Go to the relevant stack.
    3. Navigate to the settings icon as shown below, and select Workflows as shown below:

      1. Selecting WF.png 
    1. On the Workflow Settings page that appears, you will see two tabs named Workflows and Publish Rules. By default, you will be on the Workflows Stages tab.
    2. Click on + ADD WORKFLOW as shown in the following screenshot.

      2. WF Settings page.png

      A new window will open where you define your workflow and its stages as discussed in the next steps.
  1. Enter workflow details.
    On the workflow creation page, enter details in the fields as shown below. 
    1. Workflow name: Enter a relevant  workflow name of your choice. This is a mandatory field. 
    2. Description: Provide a description of your workflow. This field is optional. 
    3. Scope: Select the content type(s) for which this workflow should be applicable. These are shown in the following screenshot:

      3. WF detail page.jpg

      Once you add content types here (and if the workflow is enabled), the entries of these content types will have a Workflow section on the right sidebar. Read more about using Workflows below. 
    4. You can select  All Content Types or Specific Content Types

      4. Scope Specific Content Type.jpg
    5. If you want this workflow to apply to all content types, select All Content Types.
    6. If you select Specific Content Type, you  will be asked to choose the required content type(s). Clicking on Select Content Type will open up a new window where you can see the available content types. Select the required ones and click on Add. You can choose multiple content types to which you want to apply the workflow settings.

      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. 
  1. Add workflow stages: To add stages click on the + Add Stage option as shown below: 

      5. Add WF Stages.png


      The Workflow Stages section will open as shown below:

      6. WF Stages detail page.png

      • Add a relevant name and description for the stage. 
      • 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.  
  1. Add Stage transition rules: Every stage comes with a set of Stage transition rules. These rules define the conditions that are applicable when stages are moved* from one to another on the entry page. There are two rules that you can configure under the Stage transition rules option of every stage.
    1. Next available stage: This defines the stage of your workflow that would be available for selection when moving from the entry stage to another stage. This is useful when you want the entries to go through certain stages, without skipping essential stages. 

    2. By default, the value is set to All stages. This means that when the entry is at the current stage, users can move the stage to any as shown below:

      7. Stage Transition Rules.png

      To allow transition from this stage to only certain stages of your workflow, select Specific stage(s), and select stages of your choice. 

      8. Stage Transition Rules Specific Stages.png

      Note: 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. 

    3. 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 current stage to the stages that you add under the Next available stages option.  

    4. By default, the value is set to All users/roles. This means that all users can move from this stage to next available stages.   

      To allow only specific users, or users with only specific roles, to move the entry stage from this one to next available stages, select Specific user(s)/role(s) as shown in the following screenshot:

      9. STR Specific Users and roles.jpg

      You can then either add specific users or add roles, or do both. If you add roles here, all the users of that role will be able to move the entry stage. 

      Note: If you add specific users, other users will not be able to move the entry stage*. 

  2. Add Workflow superusers: Once you have added stages and defined transition rules, it’s time to add workflow super users. 
    1. Superusers of the workflow can move the entry from one stage to any stage, without any restrictions. The stage transition rules are not applicable to superusers. 

    2. 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 developer.

    3. To add superusers, click on the field and select the required users you want to add. You can add multiple users. However, While you can add superusers, be aware that you cannot add roles here:

      10. Add WF Superuser.png

      You can add multiple users. However, you cannot add roles here. 
  3. Enable workflow: To enable workflow, check the Enable workflow box as depicted below:

    11. Enable WF and Done.png

    As soon as you do this, the workflow option will be available in the right side bar of the entries of all the content types associated with this workflow.
  4. Save workflow: Click on the Save button to save the workflow. 

Update a workflow

The owner, administrators, and the developers of the stack can update and edit a workflow by following the steps given below:

  1. Log in to your Contentstack account, select the relevant stack, and navigate to the settings icon.
  2. Select Workflows. You will see a list of workflows as shown below:

    12. List of WF.jpg
     
  3. Click on the desired workflow. It will open up the Workflow page.
  4. You can make relevant changes in your workflow, for example, you can change the name, description, choose a different content type, remove a content type, etc. 
  5. You can also edit workflow stages. Click on the Edit icon of that stage and make changes as needed.

    13. Edit WF Stage.png
  6.   

  7. If you no longer need a workflow stage, click on the Delete icon.

    14. Delete WF Stage.png
  8. Once you have made the changes, click on Save.

Clicking on Save updates the workflow. Once updated, the new changes will be reflected in the entries of the corresponding content types.  

Delete a workflow

You can delete a workflow through the following steps:

  1. Log in to your Contentstack account, select the relevant stack, and navigate to the settings icon.
  2. Select Workflows. You will see a list of workflows. 
  3. Hover over the workflow name. You will see the More options icon on the right side.
  4. Click on that icon and select Delete. This will delete the workflow.

    17. Delete a WF.png

Enable or disable a workflow

As mentioned above, your workflow, when created is in ‘disabled’ state by default. You have to enable the workflow for it to take effect. You can enable or disable a workflow for your stack at any time by following the steps below:

  1. Navigate to settings icon and select Workflows. This will open up a list of workflows that you have created as shown below:
  2. When you hover over the workflow name, you will see the More options icon on the right side. Click on that icon, and it will give you two options named Delete workflow and Enable workflow as shown below:
  3. 16. Enable a WF.png    

  4. Select Enable workflow to enable it, or if you want to delete it, select Delete workflow. 
  5. When the workflow is enabled and you want to disable it, hover over the workflow name again, click the More options icon, and select Disable workflow as shown below:

    15. Delete a WF.png

Another way to enable or disable a workflow is by navigating to the workflow page, scrolling down to the bottom, and checking or unchecking the box named Enable Workflow. Now that we have discussed workflows stages and learned how to add, modify, and delete a workflow, let’s move on to Publish Rules.

Setting up Publish Rules

Only the stack owner, the administrator, or the developer can define the Publish Rules. We have discussed briefly what Publish Rules are, with examples, above. Publish Rules are made up of two parts: Parameters and Conditions.

For every publish rule, you need to define the following parameters: 

  • Environment: The environment for which the publish rule will be applicable
  • Content type: The content type to which the publish rule will be applied
  • Action: Whether the publishing rule is for publish or unpublish (or both) action
  • Language: The language for which the rule is applicable

Once you have defined the parameters, you need to define a condition, as explained below. Note that you can use any one or both the conditions for your publishing rule. 

  • Approver: Use this condition if you want to add an approver to all the entries that are being published or unpublished. Add the  user(s)/role(s) who should be authorized to approve the publishing or unpublishing of an entry. For example, if you assign John Smith as the approver, every entry that is sent for publishing or unpublishing that meets the above parameters will go to John Smith for approval. The entry cannot be published or unpublished unless John approves it.
  • Stage: Use this condition if you want to allow publishing or unpublishing of an entry only if it has reached a certain workflow stage. When this is defined, an entry cannot be published or unpublished unless this defined stage has been reached while creating content. For example, if you have selected Complete here, an entry (that matches the parameters defined above) cannot be published unless it reaches the Complete stage. 

A few things to remember:

  • Setting up publish rules is optional. 
  • You need to choose at least one condition (Approver(s) or Stage) for a publishing rule. You can choose both, if required, but at least one is mandatory. 
  • A publishing rule with Approver(s) as the condition can work independently of workflows. This means that you can add one or more publish rules (with Approver(s) under conditions) even if you have not added any workflows for your stack. However, in order to use the Stage condition for your publishing rule, you will need at least one workflow.  

Once a rule is in place, whenever a content manager attempts to publish or unpublish an entry on the specified environment, Contentstack will either send the entry for approval (if approvers are added as a condition), or check if the entry has reached the specified stage (if stage is added as a condition). It will then return the response accordingly.

Add a publish rule

When you add a publishing rule, you are adding a condition for publishing or unpublishing an entry. Adding a rule includes adding an approver for actions (publish/unpublish) to be performed on the entries of specific content types in specific environments, or the stage at which the entry can be published or unpublished, or adding both approver and stage.  

Please note that setting up Publish Rules in your Workflow is optional. The reason Publish Rules is part of the Workflows feature is that publishing and unpublishing is an important part of your overall content workflow.

To set up the Publish Rules, follow the steps below. Again, you need to be the stack owner, administrator, or a developer to do this.

  1. Navigate to the settings icon and select Workflows. This will open the Workflow Settings page, which has two sub-sections: Workflows and Publish Rules.
  2. Click on Publish Rules.

    1. Publish Rules.png
  3. Click on the + ADD RULE button to add a new rule.
  4. On the screen that appears, you will see two main sections named PARAMETERS and CONDITIONS as shown below:

    2. Add PR.png
  5. Add PARAMETERS:
    Enter the details as discussed:
    1. Content Type(s): You can select All Content Types if you want the publish rule to be applied to all content types. Else, select Specific Content Type. It will ask you to choose the content types to which the rule should be applied. Select Choose Content Types. 

      3. Specific Content Type for PR.jpg

      On the new window that opens, select the required content types:.

      Note: All the parameters are mandatory. 
    2. Language(s): Select the language if you want to apply this rule for a specific language. You can select multiple languages. 
    3. Environment: Select the environment for which you want to set the rule from the drop-down. You can select only one environment for each rule.
    4. Action: Choose Publish or Unpublish as per your requirement. The rule that you eventually create will apply to the ‘publish’ or ‘unpublish’ action, depending on what you select here. 
      These options are shown below:

      4. Parameters set for PR.png
  6. Add CONDITIONS: You need to add at least one condition. You can add both the conditions listed below, but at least one is required.
    1. Approver(s): Using this option, you can add Users or Roles as approvers. The entries of the specified content types and languages cannot be published or unpublished without the approval of the users or roles you add here. 

      5. Conditions for PR.png
    2. Stage: Select the workflow stage upon which an entry can be published or unpublished, as shown above. It is important to note that this field displays stages based on the content type (and, consequently, the applied workflow) you have selected in parameters. If you have selected content types that belong to more than one workflow, then this field would be disabled. 
  7. Once you have made your selections in the above fields, click on Save. This will save your settings for the rule. You can add multiple rules by repeating the above steps.

Note: You cannot add more than one rule for a content type.

Update a publish rule

At times during your content creation, you may want to make changes to the existing publishing rule. For example, the environment has changed, or the approver has to be changed. To update an existing Publish Rule from your Workflow, follow the steps given below:

  1. Navigate to the settings icon and select Workflows. This will open a new page, which has two subsections: Workflow Stages and Publish Rules.
  2. Click on Publish Rules.
  3. Click on the rule that you want to update

    6. Edit a PR.jpg

    This will expand the rule card.
  4. Make the relevant changes to the required fields, and click on Save.

Delete a publish rule

Deleting a Publish Rule from your workflow can be done by executing the following steps:

  1. Navigate to the settings icon and select Workflows. This will open a new page, which has two subsections: Workflows and Publish Rules.
  2. Click on Publish Rules.
  3. Click on the rule that you want to delete. This will expand the rule card.
  4. Click the Delete button on the right side, bottom corner of the rule card to permanently delete the rule from your workflow.

    7. Delete a PR.png
  5. Save the workflow.

Once you add Workflow Stages and Publish Rules, content managers can now start working with workflows. In the next section, we will learn how content managers can use workflows.

Using Workflows

Now that we have added workflow and created publish rules, let’s discuss how to use the workflow. If a particular Workflow is enabled, you can see the workflow details in the entries in the right side panel, under Status as shown below:

Under WORKFLOW DETAILS, you will find the current stage of the entry, and the user to whom the entry stage is assigned, along with the due date.

Publish Rules are displayed just below Workflow Details. However, these rules will be visible only if the rules have been applied to the content type associated with the entries you are viewing. 

In the following section, we will understand how content managers can use Workflows in entries.

Entry Default Workflow Stage

When you create a new entry and save it, the entry is, by default, assigned the first stage of your workflow, with no users in Assigned To and no due date.

Changing the Entry Workflow Stage

Once you are done working on a particular stage of an entry (e.g., Draft), you can change the stage of the entry (e.g., Ready for Review) and assign a user to work on the next stage. You can also add a due date for the next stage. Let’s look at how it’s done.

  1. On the entry page, go to the Workflow Details section on the right side panel. You will see the current stage of the entry, along with the stage’s color label as shown below:

    1. Change the entry page.png
  2. Click on the Change link located beside the stage name.
  3. This will open up a new window where you can make changes to the Workflow Stage of the entry as shown below:

    2. Entry WF Settings.png
  4. Under Set Workflow Stage, select the stage that you want to set for this entry.
  5. Set a Due Date for this new stage by using the date picker tool.
  6. Assign this stage to one or more users of your stack. To assign it to a user, click the User(s) field under Assign to, and select the user(s) from the list. If you can see a Role(s) field, you can assign the stage to a role. 
  7. You can also choose to send a notification email to the assignee by selecting the Notify via Email field.
  8. Lastly, add any comments in the Add Comments field. A comment could be a short description or guidelines to the assignee on what needs to be done in the next stage.
  9. Click on Update to update the Workflow Stage of the entry.

As soon as an entry stage is assigned to a user, it is added as a new task in the Tasks section of the assignee. Learn more about Tasks later in the document.

Send an entry for publish or unpublish approval

If a Publish Rule has been set for a particular content type and language, you will see it under the Publish Rules section in the right side panel of the entry.  There are two ways to send an entry for publishing or unpublishing approval.

Via the right side panel

Follow the steps given below:

  1. On the entry page, look for the Publish Rules section in the right side section as shown below:

    3. Locate PR.jpg

    You will see the applicable publishing rules (if any). Under the rule, you will see the Request Approval button.

    4. Request Approval Button.jpg
  2. Clicking this Request Approval button will send the entry for approval to the approvers.
  3. Once a request has been sent, you will see the current status of the request (awaiting approval, approved, rejected) in the same section.

Via the Publish modal

Use the following steps to send an entry for publishing or unpublishing:

  1. Click the on Publish button located at the bottom of the entry.

    5. Click on Publish button.png

    This will open the publishing modal, where you can select the environment and language for publishing the entry.
  2. If a rule has been applied to any of the selected environment or language, clicking on Send will send the entry for approval to the approvers.

    6. Send for approval.jpg

Tasks

The Tasks page lists all your pending tasks. Whenever someone assigns you to work on a workflow stage on an entry, or if someone sends you an entry for publishing or unpublishing approval, it is added to your Tasks page. Each stack has a separate Tasks section.

Important points to remember:

  • Stack owner and administrators have access to view all the tasks assigned to different users.
  • Content managers and other custom roles with limited privileges cannot view the entire task list. They can only view their tasks list.

Note: The owner of the stack or the administrator can view all the tasks assigned to all users of the stack. This gives them a central location to view and keep track of all the assigned tasks.

To navigate to your Tasks section, follow the steps given below:

  1. Sign in to your Contentstack account and select the relevant stack.
  2. Click on the Tasks icon beside the Help icon (question mark ?) located on the top right side corner.

Marking a task as complete

Tasks remain in your stack’s Tasks section until they are completed. To remove the task from your Tasks section, you need to complete the action that is required for the task. There is no other way to mark a task as complete.

  • If someone has assigned you to work on a stage of an entry, this task will remain in your Tasks section until you work on the stage, and assign it to some other user.
  • If you have received an approval request to publish an entry, the task will remain in your Tasks section until you ‘approve’ or ‘reject’ the request.
  • If you have sent an approval request to publish an entry, it will remain in your ‘Tasks’ section until the approver approves or rejects the request, and then you take the corresponding action — details given in the following points.  
  • If the approver approves your approval request to publish or unpublish an entry, the task will remain in your Tasks section until you publish or unpublish the entry.
  • If the approver rejects your approval request to publish or unpublish an entry, the task will remain in your Tasks section until you make relevant changes in the entry, and resend the entry for approval.

Using Task filter

You can refine tasks based on specific filters as shown below:

8. List of Tasks for me.png

Let’s look at the filters that you can use.

  • By Action: This filter lets you refine tasks based on the action that is required by you. Some of the values that you can select here are Approved, Pending, and Rejected.
  • By Workflow Stages: You will see the list of all the workflows that are available for your stack. You can then select a workflow to view all the stages. If you select any stage, Contentstack will filter all the entries of which the selected stage is assigned to you.
  • By Users (available for stack Admins and Owner): Stack admins and the owner can view all tasks of all the stack users. They can filter the tasks by users.

Limitations

There are certain limitations that we have applied for workflows. Let’s understand what they are:

  • You can create a maximum of 10 workflows per stack.
  • You can create a maximum of 100 publish rules per stack.
  • You can add a maximum of 100 content types in the scope of a workflow. 
  • You need to add at least two stages in a workflow. The maximum stage limit is 20.
  • You can add up to 100 super users in a workflow. 
  • Under stage transition rules of a workflow, you can add up to 100 users and 100 roles for each stage.
  • Under stage transition rules of a workflow, you can add up to 20 next available stages for a stage.

Use Cases

Now that you have read through the workflow document, let’s see workflows in action with the help of some real-world use cases. In this section, we will look at a couple of scenarios (requirements) and learn how to achieve them using workflows in Contentstack.

Use case 1

Given below is a content creation and publishing process of a typical media company. Let’s look at what the process is and then we will go about creating a corresponding workflow in Contentstack.

Requirements

  • The content writer creates the first draft of an article.
  • When she feels it is ready, she sends it to a reviewer for content review.
  • The reviewer reviews the content and either tells the content writer it needs more edits or it’s ‘good to go’.
  • Once the entry is good to go, it goes to the SEO team, where the SEO tags are added.
  • The SEO team says the content is ready for publishing and sends it back to the content writer.
  • The content writer can then publish the entry.

Conditions

  • Content writers can send an entry for review to the reviewer. But they cannot send it directly to the SEO team for SEO tagging, nor mark it as ready for publishing. 
  • The reviewer can send the entry back to content writers for changes, or send it to the SEO team. But the reviewer cannot mark the entry as ready for publishing.  
  • Content cannot be published until the SEO team signs off and marks it as ready for publishing.

Let’s put the above scenario in a flowchart:

Wofkflow_usecase_1.png

For this scenario, we will first define the workflow. And then we will add publish rules to apply the conditions.

Add a workflow

Carry out the following steps:

  1. Log in to your Contentstack account and select the relevant stack. 
  2. Then, navigate to the Settings icon and select Workflows.
  3. You will see a screen that has 2 options: Workflows and Publish Rule. By default, Workflows is selected. Click on ADD WORKFLOW.
  4. In the page that opens, enter the workflow name and description.
  5. In the Scope field, select content types for which you want to apply this workflow.

We will create all the required stages first, then we will apply stage transition rules.

‘Draft’ stage for first draft
  1. Click on + ADD stage to add Workflow Stages.
  2. In the Name text box, enter Draft and in Description, enter This is the first draft stage.
  3. The color label is blue by default. This can be changed. But leave it as is for now.
‘Ready for Review’ stage for editor’s review
  1. Click on + ADD stage to add Workflow Stages.
  2. In the Name text box, enter Ready for Review and in Description, enter This is the review stage.
  3. Change the default label color to any color of your choice, but it should be unique.
‘Needs Changes’ stage if changes are required
  1. Click on + ADD stage to add Workflow Stages.
  2. In the Name text box, enter Needs Changes and in Description, enter This is the second draft stage.
  3. Change the default label color to any color of your choice, but it should be unique.
‘SEO Tagging’ stage for the SEO team
  1. Click on + ADD stage to add Workflow Stages.
  2. In the Name text box, enter SEO Tagging and in Description, enter This is the SEO tagging stage.
  3. Change the default label color to any color of your choice, but it should be unique.
‘Complete’ stage to mark the entry as ready for publishing
  1. Click on + ADD stage to add Workflow Stages.
  2. In the Name text box, enter Complete and in Description, enter This is the complete stage.
  3. Change the default label color to any color of your choice, but it should be unique.

Add stage transition rules

We will now add the stage transition rules as follows:

Edit the Draft stage
  1. Click on the Edit icon of the Draft stage and click on Stage transition rules
  2. In the Next available stages option, select Specific stages and enter Ready for Review in the textbox.
  3. Then, select Specific users/roles and inside Roles, select Content Writer as shown below:
  4. Click on Done.
Edit the Review stage
  1. Click on the Edit icon of the Ready for Review stage and click on Stage transition rules.
  2. In the Next available stages option, select Specific stages and enter Draft, Needs Changes and SEO Tagging in the textbox.
  3. Select Specific users/roles and inside Roles, select Reviewer as shown below:
  4. Click on Done.
Edit the Needs Changes Stage
  1. Click on the Edit icon of the Needs Changes stage and click on Stage transition rules.
  2. In the Next available stages option, select Specific stages and enter Ready for Review in the textbox.
  3. Select Specific users/roles and inside Roles, select Content Writer as shown below:
  4. Click on Done.
Edit the SEO Tagging Stage
  1. Click on the Edit icon of the SEO Tagging stage and click on Stage transition rules.
  2. In the Next available stages option, select Specific stages and enter Complete in the textbox.
  3. Select Specific users/roles and inside Roles, select SEO Team as shown below:
  4. Click on Done.
Edit the Complete Stage
  1. Click on the Edit icon of the Complete stage and click on Stage transition rules.
  2. In the Next available stages option, select All stages.
  3. Select All users/roles as shown below:
  4. Click on Done.
  5. Select the Enable Workflow Stages checkbox and click on Save.

Add publish rules

We need to create a rule that allows publishing on the production environment only if the workflow stage is Complete.

  1. In your stack, go to Settings, and then Workflows
  2. Click on the Publish Rules tab.
  3. Click the + Add Rule button. 
  4. Under Parameters, first select the content types for which you want to apply this rule. Then, select Language (English - United States), Action (Publish) and Environment (Production).    
  5. Under Conditions, skip Approvers and go to Workflow stage should be:. Click the field and select Complete
  6. Save the rule.

With this, you are done with adding a workflow (and the required publish rule) for the given scenario.

Use case 2

Let’s look at another use case. In this case, we will look at we will learn how to add more publish rules in order to get granular control over the publishing process.

Requirements

  • A content writer creates the first draft of an article.
  • He then sends the entry to a proofreader.
  • The proofreader proofreads the entry and sends it to an Illustrator for adding relevant images.
  • The illustrator adds image(s) and marks the entry as complete, and sends it to John Smith for approval.

Conditions

  • An entry cannot be published unless it is approved by John Smith
  • An entry cannot be published unless the Complete stage is reached.

Let’s put this in a flowchart:

Wofkflow_usecase_2.png

Let’s first define the workflow. Then, we will add publish rules to apply the conditions.

Add the workflow

Follow the steps:

  1. Log in to your Contentstack account and select the relevant stack. 
  2. Then, navigate to the Settings icon and select Workflows.
  3. You will see a screen that has 2 options: Workflows and Publish Rule. By default, Workflows is selected. Click on ADD WORKFLOW.
  4. In the page that opens, enter a relevant name and description for the workflow. 
  5. In the Scope field, add content types to which you want to apply this workflow.

We will now add all the required stages first.

‘Draft’ stage for the first draft
  1. Click on + ADD stage to add Workflow Stages.
  2. In the Name text box, enter Draft and in Description, enter This is the first draft stage.
  3. The color label is blue by default. This can be changed. But leave it as is for now.
‘Proofread’ stage for proofreading the entry
  1. Click on + ADD stage to add Workflow Stages.
  2. In the Name text box, enter Proofread and in Description, enter This is the proofread stage.
  3. Change the default label color to any color of your choice, but it should be unique.
‘Add Media Files’ for adding images
  1. Click on + ADD stage to add Workflow Stages.
  2. In the Name text box, enter Add Media Files and in Description, enter This is where you will add the required media files for the entry.
  3. Change the default label color to any color of your choice, but it should be unique.
‘Complete’ stage
  1. Click on + ADD stage to add Workflow Stages.
  2. In the Name text box, enter Complete and in Description, enter This is the complete stage.
  3. Change the default label color to any color of your choice, but it should be unique.

Add the stage transition rules

We will now add the stage transition rules as follows:

Edit the Draft stage
  1. Click on the Edit icon of the Draft stage and click on Stage transition rules
  2. In the Next available stages option, select Specific stages and select Proofread.
  3. Then, select Specific users/roles and inside Roles, select Content Writer as shown below:
  4. Click on Done.
Edit the Proofread stage
  1. Click on the Edit icon of the Proofread stage and click on Stage transition rules.
  2. In the Next available stages option, select Specific stages and select Add Media Files.
  3. Select Specific users/roles and inside Roles, select Proofreader as shown below:
  4. Click on Done.
Edit the Add Media Files Stage
  1. Click on the Edit icon of the Add Media Files stage and click on Stage transition rules.
  2. In the Next available stages option, select Specific stages and select Complete in the textbox.
  3. Select Specific users/roles and inside Roles, select Illustrator as shown below:
  4. Click on Done.
Edit the Complete Stage
  1. Click on the Edit icon of the Complete stage and click on Stage transition rules.
  2. In the Next available stages option, select All stages.
  3. Select All users/roles as shown below:
  4. Click on Done.
  5. Select the Enable Workflow Stages checkbox and click on Save.

With this, we have added the workflow stages and defined the stage transition rues. Let’s now add publish rules.

Add publish rules

  1. Now, we need to define rules that allow publishing only if the stage is ‘Complete’, and if the entry is approved by John Smith.
  2. Go to the stack, and navigate to the Settings icon and select Workflows.
  3. You will see a screen that has 2 options: Workflows and Publish Rule. By default, Workflows is selected. Click on Publish Rules as shown below:
  4. Click on + ADD RULE. In the screen that opens, you will see broad sections: Parameters and Conditions
  5. Under Parameters, first select the content types for which you want to apply this rule. Then, select Language (English - United States), Action (Publish) and Environment (Production).  
  6. Under Conditions, in Approver(s), select John Smith in Users.
  7. In Workflow Stage, select Complete.
  8. Click on Save.

With this, you have created a workflow that satisfies the given scenario.

Was this article helpful?
top-arrow