Skip to main content
After you’ve created a Workflow, configured its basic settings, and added blocks, you’re ready to run it. You can run a Workflow in the following ways:
To run a Workflow with Cortex-based blocks, you need the appropriate permissions for each block. For example, a block that adds Eng Intelligence custom metrics to an entity requires the Configure Eng Intelligence Custom Metrics permission to run successfully.

Prerequisites

  1. You must have the Execute Workflow Runs permission.
  2. An existing Workflow. If you haven’t yet created a Workflow, refer to Creating a Workflow, Configuring Workflow settings, and Adding blocks to a Workflow.
  3. The Workflow must have no validation errors or warnings. You can save a Workflow that has warnings, such as Invalid templating reference, but you can’t run it until you resolve them. This applies to runs started from the UI, the API, the Cortex MCP, and Run Workflow blocks.

Running a Workflow directly after configuration

  1. In the upper-right corner of the page, click Run.
    The 'Run' icon in the upper-right corner of the Workflow page.
  2. Click Run workflow.

Running a Workflow from the Workflows page (via the main sidebar)

  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 you want to run, then click Run. Note that if the Workflow is scoped to an entity, the Select an entity window opens. Select an entity from the drop-down menu, then click Run workflow.
Workflows that require user input or manual approval pause until the configured input or approval is completed.
Nested form inputs configured with Data type: String render as a simple list of text fields, one per row, with an Add button and a Remove button (trash icon). Data type: Object nested forms render the configured sub‑form per row. Nested form String input at runtime: one text field per row with Add and remove buttons.

Running a Workflow from an entity

Follow the steps below to run a Workflow from an entity.
Workflows are linked to entities only if specified during configuration. To link an existing Workflow to an entity, edit the Workflow first.
  1. From the main sidebar, expand Catalogs, then select All entities.
  2. Do one of the following:
    • Select the All tab to search and filter across all of your organization’s entities.
    • Select the Mine tab to search and filter only the entities you own.
    • Note that Cortex saves your selection and restores it the next time you open this page.
  3. Search for and select the entity from which you want to run the Workflow.
  4. From the entity details sidebar, select Workflows.
  5. Locate the Workflow you want to run, then click Run. The Confirm window opens.
  6. Click Run workflow.
  7. Click the tile to view the recent run.
    The run tile.

Running a Workflow via the API

You can trigger Workflows programmatically using the Workflow Runs API. This is useful for integrating Cortex Workflows into CI/CD pipelines, scripts, and other automation. Prerequisites
  1. The Workflow must be runnable via the API. Turn on Runnable via API in the Cortex UI, or set isRunnableViaApi: true in the Workflow’s definition. See Allowing a Workflow to run via the API.
  2. The caller must authenticate with a personal access token or a global API key that has the Execute Workflow Runs permission.
What you can do via the API
  • Trigger a Workflow run for a global or entity‑scoped Workflow.
  • Pass runtime values into Workflow variables using initialContext. See step 1-i in Configuring Workflow settings.
  • Specify the initiating user with runAs —required when the Workflow restricts inputs to the initiator, when authenticating with a workspace or global API key, or when the Workflow contains a Scaffolder block. If runAs is omitted and an initiator is required, the run pauses and prompts for user selection.
  • Notify additional users of run events with notificationRecipients.
  • Prevent duplicate runs from accidental retries by sending an Idempotency-Key header.
  • Retrieve a specific run or list runs with filters.
For full request and response details, see the Workflow Runs API reference.
When you check a run’s progress through the API, note that the two statuses spell “canceled” differently. A run’s status is CANCELLED, but an individual block’s state is CANCELED. Match on the right spelling for each.
API‑initiated runs appear on the Runs tab alongside UI runs. See Tracking API‑initiated runs.

Allowing a Workflow to run via the API

Workflows don’t accept API runs by default. The Runnable via API setting controls this, and in a Workflow definition it’s the isRunnableViaApi field. It defaults to false, including for Workflows you create with the Create or update workflow endpoint or manage with Workflows as code. If the setting is off, the Run a workflow endpoint returns a 400 error with this message:
To allow API runs, do one of the following:
  • In the Cortex UI, turn on Runnable via API. See Enabling API access.
  • In the Workflow’s definition, set isRunnableViaApi: true, then send the definition to the API or commit it to your repository.
This setting only affects runs started with the API. You can always run the Workflow from the Cortex UI.
The Create or update workflow endpoint replaces the whole Workflow that has the same tag. Any field you leave out is reset to its default, so a request without isRunnableViaApi turns API runs off again. Retrieve the current definition with the Retrieve workflow endpoint, change it, then send back the complete definition.
You can’t use the Create or update workflow endpoint to change a Workflow that’s managed with GitOps. The request returns a 400 error. Update the Workflow’s YAML file in your repository instead.

Creating, running, and checking a Workflow with the API

This example creates a Workflow, runs it, and checks the run until it finishes. It uses the Send a Slack notification example, which already sets isRunnableViaApi: true. Your API key needs the Edit Workflows, Execute Workflow Runs, and View workflow runs permissions. The commands use the US base URL, https://api.getcortexapp.com. For other regions, see Base URL.
1

Create the Workflow

Save the definition as workflow.yaml, and make sure it includes isRunnableViaApi: true. Then send it to the Create or update workflow endpoint:
The response is the saved definition. Check that it shows isRunnableViaApi: true.
2

Run the Workflow

Start a run with the Workflow’s tag. Set scope.type to match the Workflow’s filter: GLOBAL, or ENTITY with an entityId.
The response includes the run’s id and its current status. Save the id for the next step. If you authenticate with a global API key, add runAs with a user’s email so the run has an initiator.
3

Check the run's status

Get the run’s details with the Get workflow run details endpoint:
Repeat the request until status is COMPLETED, FAILED, CANCELLED, or TIMED_OUT. A PAUSED run is waiting on someone, such as a User input or Manual approval block. When the run completes, runResponse holds the Workflow’s run response, and actions lists the state of each block.

Running a Workflow with secret user input

When a Workflow includes a secret user input block, Cortex prompts the user to enter a value and redacts it in the Outputs tab. If the block has regex validation configured, the user’s input must match the Validation regex set for that block. The Outputs tab shows the secret fields after the Workflow runs, but Cortex redacts the values themselves.
It’s possible for users with the Edit Workflows permission to obtain secret values using complex data transformation on secrets or echoing services.

Running a Workflow with list inputs

When a user input collects a list (nested form with the single value data type), the runner can add or remove entries within the configured element count. Number items are validated against the Integer/Decimal format and any minimum or maximum you set, and toggle items are entered as true/false switches.

Viewing a Workflow run

See the documentation for viewing a Workflow run.

Canceling a run

Follow the steps below to cancel a run.
Canceling a partially complete run does not impact any blocks that have been successfully completed.
  1. On the Workflows page, select the Runs tab.
  2. Select the run you want to cancel.
  3. In the upper-right corner of the page, click Cancel run. The run is terminated.

Retrying a failed run

This feature is available for Cortex cloud.
Users with the View Workflow Runs and Execute Workflow Runs permissions can retry failed runs. When a run fails or times out, you can retry it in the Cortex app. Cortex starts a new run of the latest version of the Workflow from the block you choose: the block that failed, or any block that completed before it. Blocks before that point keep their results from the failed run, so they don’t run again. This means you can fix the Workflow in the editor and retry, and the fixed version runs, without creating a second ticket or sending a second message for blocks that already finished.

Which runs you can retry

You can retry a run when all of the following are true:
  • The run failed or timed out. This includes an HTTP action (async) block that reported a failure and a Manual approval block that timed out.
  • The run ended less than 29 days ago. Cortex keeps run history for 30 days. If the run is itself a retry, the age counts from the oldest result it carried over.
  • No other run has retried it. Each run can be retried once. To retry again, open the newer run and retry that one.
Runs that an approver rejected cannot be retried because a rejection is a decision, not an error. This also applies to a parent run that failed because an approver rejected its child run.

Retrying a run

  1. Find the failed run. You can start a retry from any of these places:
    • On the Workflows page, select the Runs tab, then click Retry run on the failed run.
    • Open the failed run, then click Retry run.
    • Open the failed run, select the failed block, then click Retry run under the error.
  2. Optionally, click Edit workflow to fix the Workflow, then save it. The retry uses the latest saved version.
  3. In the Retry run window, review the failed block and its error.
  4. In the Retry from block dropdown, select the block to start from. By default, the retry starts from the failed block. You can choose any block that completed before it.
  5. Review the list under The following blocks will be rerun. Blocks that can change another system or send a message are labeled Check, with the reason. See Blocks that can run twice.
  6. Select the I understand that previous blocks will be rerun checkbox, then click Retry.
The new run starts. The failed run keeps its Error status.

What the new run keeps from the failed run

The block you start from decides what carries over. A completed block carries over when it completed before your start block and no path in the Workflow leads from the start block to it. Later blocks can reference carried-over blocks as usual, for example actions.<slug>.outputs. For example, a run took the yes path of a branch and failed at notify:
The new run takes the following from the failed run:
  • Carried-over blocks - Inputs, outputs, and the variable values from just after each block ran. Carried-over blocks don’t run their action again and don’t send notifications.
  • The start block - Its saved inputs. A User input form opens again with the earlier answers filled in, except for secret fields, which you enter again.
  • Variables - The values from just before the start block ran. If the latest version removed a variable, it’s dropped. A new variable gets its default value.
  • Run options - The entity, the notification recipients, and any initialContext passed through the API.
The new run doesn’t take the following:
  • The run ID - The new run has a new context.workflowRunId. If a block sends the run ID to another system to prevent duplicates, use context.retry.rootRunId instead. See Using a stable key across retries.
  • The initiator and run context - You become the initiator of the new run. Blocks that run again use your identity, the current secrets, and the current workflow settings. If the failed run was started via the API with runAs, the retry acts as you instead.
  • Block timeouts - Each block’s timeout starts again from zero.
Because blocks that run again use a fresh context, their results can differ from the failed run. For example, a block can return different data if a secret was rotated or an integration’s settings changed.

Blocks that can run twice

A block can fail after it already changed something. For example, an HTTP request can reach the server before the response times out. Cortex can’t detect this, so the Retry run window labels each block that will run again and might change another system or send a message with Check, along with the reason. For example:
  • Slack - “Posts a message in Slack channel <channel>. The message can appear twice.”
  • JavaScript - “Runs a script, and the script can call other systems.”
The following blocks aren’t labeled, because running them again doesn’t change another system or message anyone:
  • Branch and Data transformation blocks.
  • HTTP request blocks that use GET. A GET request that has side effects, such as a URL that starts a build, isn’t labeled either.
  • User input blocks without a validation script.
  • Set variable(s) blocks without a script.
  • AWS blocks that run a read action (describe, list, or get).
All other blocks are labeled, including HTTP action (async), Manual approval, Run Workflow, Scaffolder, Microsoft Teams, Jira, PagerDuty, and GitHub blocks that create or update a file. A Manual approval block sends a new approval request, so the approvers must approve again. If you retry from a block before a Branch block, the list includes the blocks on every path, because the branch decides again.

Editing the Workflow before you retry

The retry runs the latest version of the Workflow and matches blocks to the failed run by their slug and block type.

Retrying parent and child runs

When a Run Workflow block waits for its child Workflow, the child run appears under its Run Workflow block on the parent’s run page. If the child fails, the parent fails too.
  • Retry from the parent run. The Retry run window shows the failed block with its Workflow path, so you can see where the failure happened even when it’s inside a child Workflow.
  • If the Run Workflow block didn’t wait for the child, retry each run on its own.
Next step: Publishing a Workflow

Troubleshooting and FAQ

This happens when you have multiple tenants and use an API key from the wrong tenant. Ensure that you are using the correct API key, or create a new API key and try again.
Workflow steps that call the Cortex API fail if the request originates from an IP that isn’t on your allowlist. Send a message to help@cortex.io if you need further assistance.
This happens when the Workflow requires Require entity ownership. Only the entity’s owner can run it. If Require team member role is also on, the owner must additionally hold one of the configured roles on the owning team—holding the role alone, without being the owner, isn’t enough. Runs triggered via the API always fail this check if Cortex can’t identify the calling user.
Retry run appears only on runs that failed or timed out. You can’t retry a run that an approver rejected, a run that ended 29 or more days ago, or a run that started in a parent Workflow’s Run Workflow block (retry the parent instead). You also need the Execute Workflow Runs permission. See Retrying a failed run.
Last modified on November 19, 2026