---
title: "Using labels when applying a workflow in space mode"
canonical: "https://support.appfire.com/space/CDML/650154022/Using%20labels%20when%20applying%20a%20workflow%20in%20space%20mode"
format: markdown
---
> Macro (aura-html)


## Overview

In [Space mode](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531846), an enabled workflow applies to all the documents in the space unless the workflow includes filters to apply it to specific content labels or content types.

There are several ways labels are used when filtering the space workflow.

> 📝 The space workflow is also applied based on the workflow scope (global or space). For example, a global workflow active in a space without a content label filter is applied in preference to any other global scope workflow filtered by label and all active space scope workflows.

## Use content labels to filter the active space workflow

One or more content labels can be added to a space workflow. When active, the space workflow is applied to documents with one or more of these labels.

Labels to use as filters can be added by editing the workflow in the workflow builder.

![Worfklow builder Edit workflow showing two example content labels.](media://84f71c68-6b4e-4a29-b50f-ea81fb709cad)

The workflow above can only be applied to content with one or more of the specified labels—process or procedure. 

This feature uses the `label` parameter. In the template markup, this parameter is added to the workflow macro:

```plaintext
{workflow:name=Require labels|label=process,procedure}
   {state:Test}
   {state}
{workflow}
```

## Exclude labels - apply to documents without the specified labels 

If you want the opposite effect, where the workflow is only applied to documents without any of the specified labels, check the **Invert labels** option.

![Worfklow builder Edit workflow showing two example content labels and the Invert labels option selected.](media://4309f341-ce23-4a00-b4c2-4bb4c3f440ae)

The workflow above is applied to all documents that do not have either of the specified labels - **process** or **procedure**.

In the workflow template markup, this adds the `invertlabel=true` parameter:

```plaintext
{workflow:name=Exclude labels|label=process,procedure|invertlabel=true}
   {state:Test}
   {state}
{workflow}
```

## Sticky labels - prevent the removal of your content filter labels from documents 

You can edit the workflow to set labels as sticky labels to ensure that one or more labels aren't changed once the workflow is applied.

Open the **Advanced** option in the **Edit Workflow **box in the workflow builder and add labels to the **Sticky labels** box.

![workflowbuilder-editworkflow_requirelabels_advancedsection_stickylabels.png](media://df21c96c-f2fe-440d-8f8a-432e6d367f7f)

The workflow above does not allow either the **process** or **procedure** label to be removed if they are already present. 

In the template markup, this adds the `stickylabels` parameter:

```plaintext
{workflow:name=Required labels|label=process,procedure|stickylabels=process,procedure}
   {state:Test}
   {state}
{workflow}
```

> 📝 Administrators and [Admin users](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650217543) set by the workflow can remove **stickylabels**.

## Prevent the addition of labels used as content label filters using triggers

If you have a workflow that uses the `invertlabel=true` parameter, you can ensure those labels are not added by using triggers listening for `labeladded` [events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655) and then removing the labels using a  [trigger](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178) [action](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649858941):

```plaintext
{workflow:name=exclude labels|label=process,procedure|invertlabel=true}
   {state:Test}
   {state}
   {trigger:labeladded|label=process}
      {remove-label:@label@}
   {trigger}
   {trigger:labeladded|label=procedure}
      {remove-label:@label@}
   {trigger}
{workflow}
```

In the example above, adding the label **process** or **procedure** triggers an action that removes it again.

## Filter by content type - page or blog posts

By default, a workflow is applied to both **pages** and **news** (blog posts). When editing the workflow, you can filter it using the **Content Types **checkboxes.

Open the **Advanced** option in the **Edit Workflow **box in the workflow builder and check or clear the **Content Types**.

![workflowbuilder-editworkflow_requirelabels_advancedpage_blogposts_contentfilter_checkboxes.png](media://d8446a1c-1fa4-49cc-bb2c-d82d97ed373f)

> 📝 You must have at least one content type selected.

In the template markup, this uses the `content` parameter to limit workflow to either **pages** or **news** (blog posts):

When the content parameter is not added to the workflow template, by default, the workflow is applied to both pages and blog posts.

In the template markup examples, the first workflow can only be applied to pages, while the second can only be applied to news (blog posts).