> For the complete documentation index, see [llms.txt](https://docs.cortex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cortex.io/streamline/workflows/publishing-a-workflow.md).

# Publishing a Workflow

This article covers how to restrict access to a Workflow and how to publish one.

You may want to restrict access to limit who can run Workflows that touch production systems, modify infrastructure, or should only be available to specific teams, for example, an SRE team's incident response Workflow or a platform team's provisioning Workflow.

Publishing controls visibility in the Cortex UI: draft Workflows are hidden and only accessible to their authors and collaborators, while published Workflows appear throughout Cortex where any user with access can discover and run them. A Workflow can be run in either state, so you can test and iterate in draft mode, then publish once it's ready for broader use.

## Restricting access to a Workflow

By default, published workflows are visible to anyone in your organization who has permission to view them. To restrict access, follow the steps below.

{% hint style="info" %}
When a Workflow is saved as a draft, it's only visible to users with the `Edit Workflow` permission.
{% endhint %}

1. From the main sidebar, select **Workflows**.
2. Locate the Workflow, then click the **Overflow menu** next to it.<br>

   <div align="left" data-with-frame="true"><figure><img src="/files/j7DJECnmRCQEoHuSGdW1" alt="The &#x27;Overflow menu&#x27; icon next to a Workflow." width="375"><figcaption></figcaption></figure></div>
3. Select **Edit Workflow**.
4. In the upper-right corner, click Access.
5. Toggle off **Organization run access**.
6. To set access for specific users, teams, or roles, do any the following:
   1. From the **Select users** drop-down menu, select the users who should have access to view the workflow. Note that users must have the `Execute Workflow Runs` permission *and* they must match at least one of the users, teams, or roles specified.
   2. From the **Select teams** drop-down menu, select the teams who should have access to view the workflow.
   3. From the **Roles** drop-down menu, select the roles who should have access to view the workflow.
7. Click **Apply**.

## Enabling API access

Users with a [personal access token](/configure/settings/api-keys/personal-tokens.md) or a [global API key](/configure/settings/api-keys.md), with the `Execute Workflow Runs` permission, can run a [Workflow via the API](/api/readme/workflows.md).

Follow the steps below to allow a Workflow to be triggered through the Workflow Runs API.

1. From the main sidebar, select **Workflows**.
2. Locate the Workflow, then click the **Overflow menu** next to it.<br>

   <div align="left" data-with-frame="true"><figure><img src="/files/j7DJECnmRCQEoHuSGdW1" alt="The &#x27;Overflow menu&#x27; icon next to a Workflow." width="375"><figcaption></figcaption></figure></div>
3. Select **Edit Workflow**.
4. In the upper‑right corner, click **Access**.
5. Toggle on **Runnable via API**.
6. Click **Apply**.\
   The Workflow can run be run via the API.
7. Repeat these steps for each Workflow you want to run via the API.<br>

## **Publishing a Workflow**

A workflow remains in draft mode until it's published. Drafts are only visible to users who have permission to edit workflows.

To set a workflow to public, toggle off the **Draft** option in the upper-right corner of the Workflow:

<div align="left" data-with-frame="true"><figure><img src="/files/CGUrBHxKPWg2wunvkgin" alt="The &#x27;Draft&#x27; option toggled off indicates that the Workflow is viewable and discoverable." width="563"><figcaption></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cortex.io/streamline/workflows/publishing-a-workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
