How do you assign a Comala workflow to a Template page?
Asked by Marcia Cote:

I'm attempting to standardize documentation by using a template. I also need to apply a simple Comala workflow of Draft, Ready, Approved. How, if it's possible, do I add a workflow to a template page but not applied space wide?


Answers:
author: Gorka Puente _Appfire_
body: Hi Marcia,

I think you can do two things here:

1. You can add a workflow to a blueprint. Check how to do it [here](https://wiki.comalatech.com/display/CW/Workflows+for+Blueprints "Comala Workflows for Blueprints"). So each time that a page is created out of a specific blueprint, your selected workflow is applied.
2. You can add a specific label to that custom template, and then, use workflows based on templates. I'm not gonna write how to do it, because you have a couple of discussions [here](https://comalatech.zendesk.com/hc/en-us/community/posts/203567066-Label-Workflow "Comala Workflows label") and [here](https://comalatech.zendesk.com/hc/en-us/community/posts/222267107-Attach-a-workflow-to-a-Confluence-template-).

Hope this helps!

comments: author: Gregorio Prestia
body: Hello,

the links above to the 2 discussions are dead (old version of the support site). Would you mind updating them?

Thank you


author: kevin conroy
body: Gorkas answer about applying workflows based on labels was a revelation!

The workflows need to be defined in the Workflows Dashboard (Space Tools-\>Comala Workflows) Click the big "Add Workflow" button and just follow the style guide comala outline in their docs site.

Here's the general idea..

```
{workflow:name=My Auto Workflow|label=software-approval|updatestatus=true}
 workflow stuff
{workflow}
```

So now any page with the label software-approval immediately starts the workflow, as if you had right-clicked the page and gone "Add workflow"

So just adding that to the template, means that when you create a page form that template, the workflow starts. It's perfect for creating templates with tailored workflows for whatever you coud imagine - software releases, engineering change notes, time off requests, you name it.


author: Erik Boelen
body: This may work for Confluence server, but can you also add a Comala workflow to a template or labelled page in Confluence Cloud?


author: Jamie Esker _Appfire_
body: Hi [@Erik Boelen](/t5/user/viewprofilepage/user-id/4545566)

Currently, a workflow cannot be enabled in Confluence Clous based on labels. It is on the roadmap to be added, which can be found [here.](https://docs.comalatech.com/space/MIG/13943210077)

Let us know if you have any other questions! Here to help :)

Jamie Esker, Product Marketing Manager


author: Sanjaya Lakmal
body: Hi [@Jamie Esker _Appfire_](/t5/user/viewprofilepage/user-id/4502987)

I m trying to find a way to apply a workflow to a parent page+child pages (when we apply a workflow to a parent page, it should be applied to all the child pages under it). We are using comala document management for [Atlassian Confluence](https://www.atlassian.com/software/confluence) 7.19.16.

There are lots of suggestions to use templates and blueprints with labels. But I cannot find a way to make this happen. Is this feature supported, or can we only apply workflows in space level and individual page level?

Thanks in advance.


author: Nino Stana
body: Hello [@Sanjaya Lakmal](/t5/user/viewprofilepage/user-id/5354258)

Yes, you can do that in Server/Data Center.

How it's done might not be straightforward, but the general idea is to apply a label to a specific parent page, which then propagates to its children. This can stop after the first set of child pages or go all the way to the bottom, depending on how you set it up.

```
{trigger:labeladded|label=cascade}
? ? {set-label:cascade|children=true}
{trigger}
```

You can make this work with one workflow or multiple workflows; you can even "approve" a parent page and make all the child pages reflect its status.

I recommend reaching out to our support team; they can help you out with setting this up after you provide more information about your use case:  
[**Support Portal Comala Document Management**](https://comalatech.jira.com/servicedesk/customer/portal/1)

I am on P.T.O. for the following two weeks, but if you are not in a rush, I can personally assist you with this over a call. Feel free to reach out:  
[**nino.stana@appfire.com**](mailto:nino.stana@appfire.com)

I hope this helps,  
Nino


author: Sean K
body: Hello,

I am trying to follow the suggestion to link a workflow to a Custom User template, but not able to get it to work. Other than adding this line to the workflow, which add a workflow label

```
{workflow:name=My Auto Workflow|label=software-approval|}
```

and the adding a label "software-approval" to the page template. Are there any other steps to link the workflow to the page template?


author: Nino Stana
body: Hello [@Sean K](/t5/user/viewprofilepage/user-id/5493197) !

No, those are all the steps needed. If the workflow has the *software-approval* label and then you simply add the same label to the page template, as soon as you create a page using that template, it will apply that specific workflow to it. Of course, the workflow needs to be active in that Confluence space.


author: Sandy Johnson
body: The Comala workflows are set up on a space by space basis. So if you open a new page (template or not) it will have the workflow applied in any space that you have set up the workflow. If the same template is open in a space without workflow, obviously it will not be applied.

comments: author: Marcia Cote
body: Thank you Sandy. I did know that it could be applied via space or individual page. I was wondering if I could apply a workflow to a Template page but not space wide?

Thank you again for responding so quickly.


author: Sandy Johnson
body: I don't believe you can restrict the workflow to a template or page. I believe it is only by space. I'm curious why you would want to do this. If there is content that does not require workflow, maybe it belongs in a different space from the content that you want to go through workflow.


author: Marcia Cote
body: I was hoping there was a way to apply it to a template so that if a user chose a specific template the workflow would be applied but if they chose another, it wouldn't.

The use case is this: The Site houses project management documentation, project status report pages, and best practice guidelines that do not require authorization for posting. We would like to include an Retrospective/Accomplishments page where staff can submit their project experiences as a descendant page. Management wishes to include a content approval process (Comala) before officially posting these submissions. The template is being used to standardize the format of the submission as they could come from various users throughout the company.


author: Salim Morgan
body: Use a label. This works for user-defined templates but unfortunately not for blueprints. For blueprints, you can only click on "Attach Workflow" to enable some pre-defined workflow for that blueprint supplied by Comala.

For your own templates, simply add a label to the template itself and configure your custom workflow to be applied wherever that label is found. Like this:

{workflow:name=Document Approval\|label=document_approval}

In the above, any page will have the workflow applied if it has that label or was created from a user template that has it.


author: Raul Rupsingh
body: Hey [@Salim Morgan](/t5/user/viewprofilepage/user-id/1163553) I tried this using a \`User Created Template\` with a label and then a comala "page workflow" template with the same label - did not seem to work for me. Is there anything else you need to setup?


Tags: confluence-administration