---
title: "set-state macro"
canonical: "https://support.appfire.com/space/CDML/649727251/set-state%20macro"
format: markdown
---
> Macro (aura-html)


## Overview

> Macro (excerpt)
> 
> Immediately transition to a state

The `{set-state}` macro is used to immediately transition to a designated state – either on the current page, parent page or child pages – regardless of how transition to that state would normally occur.

## Where to use it?

Optional.

One `{set-state}` macro can be put in a **[{trigger}](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859133)**[ macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859133).

## Parameters

| Parameter | Required | Default | Notes | Ver |
| --- | --- | --- | --- | --- |
| *unnamed first parameter*   
or `state` | :check_mark: |  | The state to transition to.<br>Note: It must be defined in the workflow. |  |
| `comment` |  |  | Comment to associate with the state change:<br>- plain text
- can use any character set supported by your Confluence server – except some [reserved characters](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859070). |  |
| `page` |  | * current page* | If specified, the state will be changed on the parent page or child pages, not the current page:<br>- `@parent` – Change state of parent page
- `@children` – Change state of child pages<br>Obviously, this parameter only works on pages, not blog posts. |  |

  
:warning: The `set-state` macro will not work if the page is using also using the [K15t Scroll Versions app](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153358).

## Events

The following [Events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655) are associated with state transitions:

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

## Example

In this example, entering state B causes an immediate transition to state C.

```plaintext
{workflow:Instant transition}
   {state:A|submit=B}
   {state}
   {state:B}
   {state}
   {state:C}
   {state}
   {trigger:statechanged|state=B}
      {set-state:C}
   {trigger}
{workflow}
```

## All examples

> Macro (contentbylabel)

## See also

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

- [States](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649595551)
- [Transitions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563425)
- [Events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655)
- [Triggers](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178)
- [Actions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649858941)