---
title: "States"
canonical: "https://support.appfire.com/space/CDML/649595551/States"
format: markdown
---
> Macro (aura-html)


## Overview

> Macro (excerpt)
> 
> Define the milestones and key stages in your workflow

States act like milestones in your workflow – key stages of your process where something has to happen.

States are always implemented with the [state macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531575). 

> ℹ️ <span style="color: #172b4d">State names are case sensitive. There are also a number of </span>[reserved characters](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859070)<span style="color: #172b4d"> that cannot be used in a workflow state name such as</span> `=` `#` `@`  `{` `|` `[`<span style="color: #172b4d">.</span>

## Example

Let's assume we've got a really simple content production process where content is edited, then it goes through a review, and if the review is approved the content is published.

## Transitions

States can handle several common [Transitions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563425) directly, namely:

- `submit` – a direct transition to one state
- `updated` – an automatic transition which occurs when content is edited
- `approved` and `rejected` – transitions triggered by completion of [Reviews](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153766)
- `expired`  – triggered when a state expires – see [Expiry Dates](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649890606)
- `completed`  – triggered when the last remaining task is completed – see [Tasks](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694408)

For approved, rejected and submit transitions Workflow Parameter can also be required to be entered.

> ℹ️ Further information: [Transitions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563425).

## Reviews

You can add [Reviews](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153766) to states. When the workflow enters the state, the [workflow popup](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649659846) displays options for [content reviews](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650313809).

![image](media://f607479a-5a84-4c66-b9da-36729ff4c952)

Reviewers must decide whether to approve or reject the content, and once they are in agreement the state will transition to the destination state for the `approved` or `rejected` decision as applicable.

> ℹ️ Further information: [Reviews](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153766).

## Require parameter

A state can be configured to [require the setting of one or more workflow parameter values](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649529809). The value ***must be set before*** a transition into the state can occur. The workflow popup will display a warning for the transition in any state that has this state as a destination.

The **Reviewed** state in the markup below would require the setting of the value of the workflow parameter `pagefield1` before a transition can occur into the **Reviewed** state.

```
{workflowparamter:pagefield1|edit=true}
{workflowparameter}
{state:Draft|submit=Reviewed}
{state}
{state:Reviewed|requiredparams=pagefield1}
{state}
```

In our example, the transition option is to a single state from the **Draft** state to the **Reviewed** state the **Submit** button displays a warning icon.

![image](media://4508310b-e679-4a68-a55f-9cd0085a109b)

<span style="color: #172b4d">Choosing the </span>**Submit**<span style="color: #172b4d"> button opens a text box to enter the value of the required workflow parameter.</span>

![image](media://fb65e3ff-06d1-4979-8694-417e1036be3a)

The required parameters for entering a state will only be prompted if a user is performing a workflow action such as approving/rejecting content or making state selection. If a state is transition is actioned by a trigger, like a page update, the required parameter check for the destination state will not be carried out.

> ℹ️ Once a parameter value has been set in a workflow it will not be prompted for again unless the saved value is removed.

  
Required parameters can be added to a state using the state editor in workflow builder.

![image](media://da27250d-183d-44e9-b6df-a06c7849bdc5)

Workflow parameters added to the workflow will be available as options to the dropdown menu.

> ℹ️ Further information:[ Require Parameters](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649529809).

## Tasks

[Tasks](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694408) can be created automatically when a workflow enters a state, and states can automatically transition when tasks are completed.

In the example, a task to **Check links** is created when *entering* the **Review** state, and when that task is `completed` a transition will occur to the **Publish** state.

## Expiry dates

States can be given expiry dates. There are many uses for this, but one of the most interesting is to trigger periodical reviews of published content:

It's a really simple way to ensure that documentation doesn't go stale.

> ℹ️ Further information: [Expiry Dates](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649890606), [State expiry date](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649693610).

## Notifications

By default, page watchers will only be notified if a state expires.

Additional notifications can be added if desired.

> ℹ️ Further information: [Notifications](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649957056).

## Macros

> Macro (contentbylabel)

## Events

State transitions and expiry generate [events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655), for example

- `statechanged`
- `pagestatechanged`
- `newsstatechanged`
- `stateexpired`

Events can be used in workflow [triggers](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178) to set one or more [actions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649858941).

## App configuration

| Setting | Where | Notes |
| --- | --- | --- |
| **State's Task Behaviour** | - [Configuration - Global](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649889951) | Should incomplete tasks be carried over to the next state during transitions? |
| **State Expired Notification** | - [Notifications - Global](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649530054)
- [Notifications - Space Tools](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650119000) | Should page watchers receive a notification when a state expires? |

## Examples

> Macro (contentbylabel)

## See also

**[User Guide](https://appfire.atlassian.net/wiki/spaces/CDML/pages/648907144)**

- [Workflow Status Bar](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650117676)
- [State Status Indicator Circles](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650152863)
- [Workflow Popup](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649659846)
- [Progress tracker](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649825888)
- [Workflow Builder](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650151179)

**[Reporting Guide](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649070833)**

- [Report on states](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650216427)

**[Administration Guides](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649233819)**

- [Initialize States](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649827807)

**[Workflow Authoring Guide](https://appfire.atlassian.net/wiki/spaces/CDML/pages/648611901)**

- [state macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531575)
- [Administrator state override](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649760835)
- [Confused States - Grey Circle](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649532620)
- [Transitions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563425)