> 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. Do one of the following:
   * Select the **All** tab to search and filter across all of your organization's Workflows.
   * Select the **Mine** tab to search and filter only the Workflows you own.
   * Note that Cortex saves your selection and restores it the next time you open this page.
3. Locate the Workflow, then click the **overflow menu icon** 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>
4. Select **Edit Workflow**.
5. In the upper-right corner, click Access.
6. Toggle off **Organization run access**.
7. 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.
8. 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. Do one of the following:
   * Select the **All** tab to search and filter across all of your organization's Workflows.
   * Select the **Mine** tab to search and filter only the Workflows you own.
   * Note that Cortex saves your selection and restores it the next time you open this page.
3. Locate the Workflow, then click the **overflow menu icon** 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>
4. Select **Edit Workflow**.
5. In the upper‑right corner, click **Access**.
6. Toggle on **Runnable via API**.
7. Click **Apply**.\
   The Workflow can run be run via the API.
8. 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>
