---
title: "Use a Comala workflow trigger event to publish a page"
canonical: "https://support.appfire.com/space/CPCL/646644272/Use%20a%20Comala%20workflow%20trigger%20event%20to%20publish%20a%20page"
format: markdown
---
> Macro (aura-html)


## Overview

You can use Comala Publishing with [Comala Document Management for Cloud](https://appfire.atlassian.net/wiki/spaces/CDMC) app to publish a page using a Comala Document Management workflow trigger event.

The **Publish Page workflow trigger** **action **gives you granular control over when and how pages are published, providing flexibility in publishing and automating publication at different workflow stages.

![cpc_multiplepublishactions_inaworkflow_graphic.png](media://c634e1cb-a3be-4fd8-bae0-0114c2f18355)

The **Publish Page** action in a **workflow trigger** lets you publish a page based on a specified event. When one or more **Publish Page **workflow triggers are added, this

- supports **flexible publishing**, automating publication at different workflow stages
- **does not disable** publishing when transitioning to the **final state**

To **prevent duplicate publishing** of the same page version, you should avoid using the **Publish Page** trigger action on a **transition to the final state**.

> ✅ You can make the [single-page publishing](https://appfire.atlassian.net/wiki/spaces/CPCL/pages/1088816440) option inactive in the space to prevent a page editor from publishing the page using the **Publish** option on the page.

## Prerequisites

You need to install both of the following apps:

- **Comala Publishing app**
- [Comala Document Management Cloud](https://appfire.atlassian.net/wiki/spaces/CDMC)

You must have

- Added a target space for the published pages in the space settings of the source space
- An active Comala Document Management custom workflow on the source page content
- Added a workflow trigger with the **Publish Page** trigger action to the active custom workflow

## Adding a trigger event to publish a page

<span style="color: #172b4d">You can use a trigger to publish the page at a different point in the documentation process by editing the workflow to add a trigger using the workflow builder </span>[visual editor](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2193162438)<span style="color: #172b4d"> or </span>[code editor](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2192837873)<span style="color: #172b4d">. </span>

> 📝 Comala Publishing, by default, publishes a page when an applied workflow reaches the final state. If you don't want this publishing action to occur, you must edit the workflow and remove the **final** attribute from the state.

In the workflow shown in the workflow visual editor, the **Published** state is the **workflow's final state**.

![cpc_cdm_visualeditor_interimandfinalpublishing_nopublishpagetrigger.png](media://839be1c3-6d16-4fc1-897e-96f43433bddd)

We can apply this workflow to a page in a source space. and when the page transitions to the final state, the **Published** state, the page is automatically published and synced to the target space by Comala Publishing.

<span style="color: #172b4d">If you want to publish at another stage of the documentation process, you must edit a custom workflow to add one or more workflow triggers containing the </span>[publish-page](https://appfire.atlassian.net/wiki/pages/createpage.action?spaceKey=CDMC&title=publish-page%20trigger%20action) trigger action.

You can use the **Add Trigger **option in the [visual editor](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2193162438) to add a workflow trigger.

![cpc_cdm_visualeditor_addtriagger_first-publishstatechange_publishpage_action.png](media://b957b73e-3d50-42f5-9d62-891cb2b0ffb0)

The workflow trigger above:

- Listens for a workflow **Event**:
  - a change in the workflow state
- Checks that the **Condition** for the event are met:
  - A change of state is to the **First Publish** state
- **Actions** a publish and sync of the page using the added **Publish Page** action

You can also view the added trigger in the Comala Document Management app [code editor](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2192837873):

![cpc_cdm_codeeditor_publishpagetrigger.png](media://ff9e8c13-903d-43a8-803b-0188841df767)

## How it works

In our example, the workflow state dialog box on the page with the applied workflow lets you approve the page to initiate the workflow transition to the **First-Publish** state.

![cpc_onpage_newpublishingstate_review_workflowstate_approveindialogbox_tomoveto_first-publish_state.png](media://fc905363-b528-4d37-b086-86c0a2c19170)

The workflow **Page Publish** trigger action occurs when the workflow state changes.

![cpc_publishingbyline_synced_interimpublishingworkflowstate_publishingdialogbox.png](media://bb86feb6-b1f3-4200-b5f9-b1eb2120715f)

The page is published and synced in our target space.

In our workflow, the page is also published and synced when it transitions to the final state, **Published**.

![cpc_onpage_finalworkflowstate_synced_publishingstate.png](media://72b11f4c-f877-4f7f-8382-d5b07cef35e1)

> 📝 Adding a workflow trigger with a **Publish Page** action does not prevent the automatic publishing of a page when the workflow transitions to its final state.

It is recommended that you do not use a **Publish Page** trigger action on a **transition to the final state**; this can cause duplicate publishing of the same page version and can cause errors.

You can also choose to use a workflow without a defined final state and only publish using one or more added workflow triggers.

## Workflow triggers

You can find further information on the available workflow triggers in the [Comala Document Management documentation](https://appfire.atlassian.net/wiki/spaces/CDMC):

- Overview of [workflow triggers](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2192967825)
- List of [trigger events](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2193950329) and [trigger conditions](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2193852785)
- The [publish-page](https://appfire.atlassian.net/wiki/pages/createpage.action?spaceKey=CDMC&title=publish-page%20trigger%20action) trigger action

You can also find further details on how to add a workflow trigger using the workflow builder [visual editor](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2193162438) and [code editor](https://appfire.atlassian.net/wiki/spaces/CDMC/pages/2192837873).

> ℹ️ Although a Comala workflow can be applied to pages and blog posts, *Comala Publishing Cloud can only publish pages*. The Comala Publishing app ignores any blog post with an applied workflow.

## Related Links

**Comala Publishing**

- [Publish a page on a transition to a Comala workflow final state](https://appfire.atlassian.net/wiki/spaces/CPCL/pages/646807871)