---
title: "Execute Workflow"
method: POST
path: "/api/workflows/{id}/execute"
tags: ["Workflows"]
---

# Execute Workflow

`POST /api/workflows/{id}/execute`

Execute a deployed workflow. Supports synchronous, asynchronous, and streaming modes. For async execution, the response includes a statusUrl you can poll for results.

## Path parameters

- `id` string, required

## Headers

- `X-Execution-Mode` 'async'
- `X-Execution-Timeout-Seconds` integer

## Request body

- object
  - `input` object — Key-value pairs matching the workflow's defined input fields. Use the Get Workflow endpoint to discover available input fields.
  - `triggerType` string — How this execution was triggered. Defaults to api when called via the REST API. Recorded in execution logs for filtering.
  - `stream` boolean — When true, returns results as Server-Sent Events (SSE) for real-time block-by-block output streaming.
  - `selectedOutputs` string[] — List of specific block IDs whose outputs to include in the response. When omitted, all block outputs are returned.

## Response `200`

Synchronous execution completed successfully.

- ExecutionResult — Result of a synchronous workflow execution.
  - `success` boolean — Whether the workflow executed successfully without errors.
  - `executionId` string — Unique identifier for this execution. Use this to query logs or cancel the execution.
  - `output` object — Workflow output keyed by block name and output field. Structure depends on the workflow's block configuration.
  - `error` string, nullable — Error message if the execution failed. null on success.
  - `metadata` object — Execution timing metadata.
    - `duration` integer — Total execution duration in milliseconds.
    - `startTime` string, date-time — ISO 8601 timestamp when execution started.
    - `endTime` string, date-time — ISO 8601 timestamp when execution completed.

## Other responses

- `202` — Asynchronous execution has been queued. Poll the statusUrl for results.
- `401` — Invalid or missing API key. Ensure the X-API-Key header is set with a valid key.
- `404` — The requested resource was not found. Verify the ID is correct and belongs to your workspace.
- `429` — Rate limit exceeded. Wait for the duration specified in the Retry-After header before retrying. The X-RateLimit-* headers accompany every response from an authenticated v1 request — success and error alike — and are omitted only when the request fails authentication, since no rate-limit bucket is consulted in that case.

## Changes

- **2026-08-06** `66a471c5b1df` — 2 info
  - added the new optional `header` request parameter `X-Execution-Mode`
  - added the new optional `header` request parameter `X-Execution-Timeout-Seconds`

[Change history](https://skmtc.dev/simstudioai/apis/sim-api/changes/api/workflows/:id/execute/post.md)

---

[API](https://skmtc.dev/simstudioai/apis/sim-api.md) · [All operations](https://skmtc.dev/simstudioai/apis/sim-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/simstudioai/sim-api/revisions/66a471c5b1df/schema)
