Create a state flow for blog content

Sitecore Content Hub includes a standard state flow for content creation. A state flow contains a series of steps, each triggered by a specific action, that takes you through the content creation process. If you need a state flow for different content types, such as blogs, you need to create them.

By dividing the content creation process into distinct states, it is easier for content creators, reviewers, and approvers to collaborate effectively. For example, a simple state flow for a blog might include the following steps:

  • Create - this is where ideas take shape, research is conducted, and the initial content is written.

  • Review - reviewers assess quality and consistency. Reviewers provide feedback, suggest improvements, and ensure adherence to guidelines.

  • Approved - when content passes review, it moves to this state for final approval.

State flow for blog content

This walkthrough describes how to:

Create a state flow for a blog

Creating a state flow for blog content lets you control the steps it goes through in its life cycle.

To create a state flow for a blog:

  1. On the menu bar, click Manage manage icon.

  2. On the Manage page, click State flows.

  3. On the State flows page, click State flow.

  4. In the State flow dialog, in the Target definition drop-down list, click M.Content.

  5. In the Name field, enter a name for the state flow, such as Blog flow.

  6. Leave the Detail page field empty.

  7. In the Email template field, click Add and, in the Email template dialog, select the CMP check box, and click OK.

  8. Click Save.

Add the states to the state flow

Now that we have all the elements required for our blog content state flow, we need to add the individual states to it, such as Create, Review, Approve.

To add the states to the state flow:

  1. On the menu bar, click Manage manage icon.

  2. On the Manage page, click State flows.

  3. On the State flows page, click Blog flow.

  4. On the Blog flow page, click State.

  5. In the State dialog, fill in the following fields, and click Save:

    Name

    Value

    Name

    Create

    Description

    First step in the blog content approval process.

    Update assignees

    Overwrite

    Assigned user groups

    M.Builtin.Creator

    Update status

    Overwrite

    Content status

    In progress

    Update state flow

    Keep

    Update draft status

    Keep

    Update approved for creation

    Keep

    Update is in ideation state

    Keep

    Leave the rest of the fields blank.

  6. In the State dialog, fill in the following fields, and click Save:

    Name

    Value

    Name

    Review

    Description

    Blog content is being reviewed by the Editors.

    Update assignees

    Overwrite

    Assigned user groups

    M.Builtin.Editors

    Update status

    Keep

    Update state flow

    Keep

    Update draft status

    Keep

    Update approved for creation

    Keep

    Update is in ideation state

    Keep

    Leave the rest of the fields blank.

  7. In the State dialog, fill in the following fields, and click Save:

    Name

    Value

    Name

    Approved

    Description

    Blog content has been approved and is ready to publish.

    Update assignees

    Overwrite

    Assigned user groups

    Superuser

    Update status

    Overwrite

    Content status

    Final

    Update state flow

    Keep

    Update draft status

    Keep

    Update approved for creation

    Keep

    Update is in ideation state

    Keep

    Leave the rest of the fields blank.

  8. On the Blog flow page, next to the Create state, click Edit transitions and add a transition called Creation with Review as the next state.

  9. Repeat step 8 to add a transition from the Review state to the Approved state.

    The transitions look like this:

    Final transitions for the blog flow

Create an action to start the state flow

An action performs a specific task and can be triggered manually or using the API. Each step in a state flow is an action, such as To do, In progress, In review, Ready to publish, Archive.

To create an action to start the state flow:

  1. On the menu bar, click Manage manage icon.

  2. On the Manage page, click Actions.

  3. On the Actions page, click New action.

  4. In the New action dialog, fill in the following fields:

    Name

    Description

    Name

    Enter a name for the new action, such as Approval action.

    Label

    Enter a descriptive label for the new action, such as Blog content approval action.

    Type

    Select the type of action, such as Start state machine.

    State flow

    Select the state flow that you want this action to be associated with, such as Blog flow.

  5. Click Save.

Create the blog approval trigger

A trigger automatically executes an action. In this case, it will start the blog content approval process, which manages the states that blogs take from being an idea approved for creation to finally archived the blog content at the end of its life cycle.

To create the blog approval trigger:

  1. On the menu bar, click Manage manage icon.

  2. On the Manage page, click Triggers. Then, on the Triggers page, click New trigger.

  3. On the General tab, in the Name field, enter a name for the trigger, such as Blog content approval trigger.

  4. In the Description field, enter text to describe the trigger, such as Automatically starts the blog flow.

  5. In the Objective drop-down list, select the Entity creation and Entity modification check boxes.

  6. In the Execution type drop-down menu, click In process.

    New trigger for blog content approval
  7. On the Conditions tab, click Add definition and select Content (M.Content).

  8. Click Condition and create the condition Approved for creation (Content.ApprovedForCreation) | current value | equals, and turn on the switch.

  9. Click Condition again and create a second condition Type (ContentTypeToContent) | current value | contains | all | Blog.

  10. Make sure that the two conditions are related using the and operator, click Save and then click Activate to activate the trigger.

    New trigger for blog content approval added conditions
  11. On the Actions tab, in the Post actions section, click Add action and select Blog content approval action.

  12. Click Save and close.

Change the approval trigger

We now have a trigger that handles the approval of blogs. Next, we need to change the default CMP - Content approval trigger so that it is not used for blog content, but continues to execute for all the other content types.

To change the default CMP - Content approval trigger:

  1. On the Triggers page, scroll down to CMP - Content approval trigger.

  2. Click View details .

  3. On the Conditions tab, click Condition.

  4. Add the following condition Type (ContentTypeToContent) | current value | does not contain | all | Blog.

  5. Click Save and close.

    Updated trigger for blog content approval

Now when a content creator creates a blog, the content automatically goes through the Create, Review, Approved flow.

Do you have some feedback for us?

If you have suggestions for improving this article,