---
title: "Create a state flow for blog content"
slug: "create-a-state-flow-for-blog-content"
abstract: "Example of how to create a state flow for blogs."
---
# Create a state flow for blog content

Sitecore Content Hub includes a [standard state flow](https://doc.sitecore.com/ch/en/users/content-hub/cmp-flow.html) 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](https://doc.sitecore.com/api/markdown-image/ch/en/developers/cloud-dev/images/blog-flow.png)

This walkthrough describes how to:

:::walkthrough
1. [Create a state flow for a blog](https://doc.sitecore.com/ch/en/developers/cloud-dev/create-a-state-flow-for-blog-content.html#create-a-state-flow-for-a-blog)
2. [Create an action to start the state flow](https://doc.sitecore.com/ch/en/developers/cloud-dev/create-a-state-flow-for-blog-content.html#create-an-action-to-start-the-state-flow)
3. [Create the blog approval trigger](https://doc.sitecore.com/ch/en/developers/cloud-dev/create-a-state-flow-for-blog-content.html#create-the-blog-approval-trigger)
4. [Change the approval trigger](https://doc.sitecore.com/ch/en/developers/cloud-dev/create-a-state-flow-for-blog-content.html#change-the-approval-trigger)
:::

## Create a state flow for a blog

Creating a [state flow](https://doc.sitecore.com/ch/en/users/content-hub/state-flows.html) 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** :mdiCogOutline:.
2. On the **Manage** page, click **State flows**.
3. On the **State flows** page, click :mdiPlus: **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** :mdiPlus: 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** :mdiCogOutline:.
2. On the **Manage** page, click **State flows**.
3. On the **State flows** page, click *Blog flow*.
4. On the **Blog flow** page, click :mdiPlus: **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](https://doc.sitecore.com/api/markdown-image/ch/en/developers/cloud-dev/images/blog-flow-transitions.png)

## Create an action to start the state flow

An [action](https://doc.sitecore.com/ch/en/developers/cloud-dev/create-an-action.html "Create 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** :mdiCogOutline:.
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](https://doc.sitecore.com/ch/en/developers/cloud-dev/create-a-trigger.html "Create 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** :mdiCogOutline:.
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](https://doc.sitecore.com/api/markdown-image/ch/en/developers/cloud-dev/images/new_trigger_for_blog_content_approval.png)

7. On the **Conditions** tab, click **Add definition** and select *Content (M.Content)*.
8. Click :mdiPlus: **Condition** and create the condition *Approved for creation (Content.ApprovedForCreation) | current value | equals*, and turn on the switch.
9. Click :mdiPlus: **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](https://doc.sitecore.com/api/markdown-image/ch/en/developers/cloud-dev/images/new_trigger_for_blog_content_approval_added_conditions.png)

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** :mdiInformationOutline:.
3. On the **Conditions** tab, click :mdiPlus:**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](https://doc.sitecore.com/api/markdown-image/ch/en/developers/cloud-dev/images/edited_cmp_content_approval_trigger_so_not_to_fire_for_blogs.png)

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