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


## Overview

> Macro (excerpt)
> 
> Defines a workflow template

The `workflow` macro defines a workflow in your workflow template, and optionally defines page headers and footers, as well as content filters used when applying a workflow in [space mode](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531846).

## Where to use it?

Required – exactly one per workflow template.

The `workflow` macro must be the first macro in your template.

It must contain at least one [state macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531575) or [read-ack macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650347654).

## Parameters

| **Parameter** | **Required** | **Default** | **Notes** |  |
| --- | --- | --- | --- | --- |
| *macro body* | :info: |  | > ℹ️ There must be at least one `state` macro in the body.<br>The following macros can be put in the body of a `workflow` macro:<br>> Macro (contentbylabel) |  |
| `adminusers` |  |  | Defines additional users who should be treated as admin users from the perspective of the workflow:<br>- Comma-separated list of usernames
- Listed users can delete labels defined in `stickylabels` parameter†
- Can use [administrator state override](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649760835)
- Also affects any macro with an `admin=true` parameter<br>> ⚠️ † *Users added using this parameter must have space administration permission to remove ****sticky labels****.* |  |
| `name` | :check_mark: |  | Name of the workflow:<br>- In [space mode](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531846), the workflow must have a unique name amongst the enabled workflows
- The name can use any character set supported by your Confluence server – except some [reserved characters](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649859070).
- Can be accessed via `@pageworkflowname@` - a [predefined value reference](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649925434).<br>> Macro (contentbylabel) |  |
| ## Filters<br>In [space mode](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531846), these parameters can be used to determine which content the workflow should be applied to. |
| `content` |  | `pages,news` | Which types of content should the workflow be applied to?<br>- Comma-separated list of content types
- Supported types: `pages`, `news` (blog posts)
- Only takes effect in [space mode](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531846)<br>> Macro (contentbylabel) |  |
| `invertlabel` |  | `false` | Should the purpose of the label parameter be inverted?<br>- `true` – yes, only apply the workflow to content with none of the listed labels
- `false` – no, apply the workflow to content that has one or more of the listed labels<br>> Macro (contentbylabel) | 4.9 |
| `label` |  |  | Which labels should this workflow be applied to?<br>- Comma-separated list of labels
- Workflow will be applied to any content with one or more of the listed labels
- Only takes effect in [Space Mode](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531846)<br>> Macro (contentbylabel) |  |
| `stickylabels` |  |  | Should one or more labels be protected from removal?<br>- Comma-separated list of labels which ***must not be removed***
- Once added, the labels can only be removed by a [space administrator](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650314379), a [Confluence administrator](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650150846), or users listed in the `adminusers` parameter<br>> Macro (contentbylabel) |  |
| ## User interface<br>These parameters facilitate the customisation of various elements of the user interface. |
| `footer` or   
`footertemplate` |  |  | Display a space-level [page template](https://confluence.atlassian.com/doc/create-a-template-296093779.html) in the footer of all pages and blog posts that the workflow is applied to:<br>- Full path to template: `SPACEKEY:Page Template Title`
- If no `SPACEKEY` specified, it will default to the current space<br>See also: [pagefooter macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650251276) | 3.1+ |
| `header` or   
`headertemplate` |  |  | Display a space-level [page template](https://confluence.atlassian.com/doc/create-a-template-296093779.html) in the header of all pages / blog posts that the workflow is applied to:<br>- Full path to template: `SPACEKEY:Page Template Title`
- If no `SPACEKEY` is specified, it defaults to the current space<br>See also: [pageheader macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650348817), [include-segment macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649760938), [set-message macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650153597), [workflow-instructions macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650119824) |  |
| `progresstracker` |  | `true` | Should the Progress Tracker be available in the [workflow state dialog box](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649659846)?<br>- `true` – yes, include the Progress Tracker
- `false` – no, remove the Progress Tracker<br>See also: `hidefrompath` parameter on the [state macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531575). |  |
| `updatestatus` |  | `false` | If a page or blog post contains the Confluence [status macro](https://confluence.atlassian.com/display/DOC/Status+Macro)**,** should it be updated whenever the workflow state changes?<br>- `true` – yes, update the {status} macro to show the name of the current workflow state
- `false` – no, don't update<br>This is primarily for old templates that used the {status} macro as a mechanism to display workflow status in the page content.<br>It is recommended to use the [pagestatus macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694558) instead. | 4.3.2+ |

The workflow macro is automatically added when creating a workflow using the workflow builder.

You can add or [edit the workflow](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649924594) and its parameters using the editor options:

![workflowbuilder-editworkflow_advancedoptioncollapsed.png](media://ed6d4129-c5b9-49ac-9ee4-1ef3319710b0)

Expanding the **Advanced** section lets you to add values for the **content**, **sticky labels**, **adminusers**, **updatestatus**, and **progresstracker** parameters. You can also edit the **header** and **footer** parameter values in the [page layout editor](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649693867).

## Example

```plaintext
{workflow:name=Example|content=pages|label=example|updatestatus=true}
   {description}Example workflow{description}
   {state:Editing}
   {state}
   {state:Done}
   {state}
{workflow}
```

## All examples

See: [Examples](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649790922)

## Related pages

- [https://appfire.atlassian.net/wiki/spaces/CDML/pages/650248771](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650248771)
- [https://appfire.atlassian.net/wiki/spaces/CDML/pages/649628549](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649628549)
- [https://appfire.atlassian.net/wiki/spaces/CDML/pages/650217225](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650217225)