---
title: "Execute a workflow synchronously"
method: POST
path: "/workflow/run"
---

# Execute a workflow synchronously

`POST /workflow/run`

Executes a workflow and waits for it to complete before returning the result

## Request body

- object
  - `workflowName` string, required — The name of the workflow to execute
  - `input` unknown, required
  - `workflowId` string — (Optional) The workflowId to use. Must be unique
  - `catalog` string — The catalog (Temporal task queue) to route the execution to. Falls back to the default catalog.
  - `taskQueue` string — Deprecated alias for `catalog`. If both are sent, `catalog` wins.
  - `timeout` number — (Optional) The max time to wait for the execution, defaults to 30s

## Response `200`

The workflow result

- union
  - WorkflowResultV2Response — Current workflow result with direct output and memo-based trace information
    - `v` '2', required — Workflow result response version
    - `workflowId` string, required — The workflow execution id
    - `runId` string, nullable, required — The specific run id for this execution
    - `status` 'completed' | 'failed' | 'cancelled' | 'terminated' | 'timed_out' | 'continued_as_new', required — The workflow execution status
    - `input` unknown, required
    - `output` unknown, required
    - `trace` TraceInfoV2, nullable, required — Available destinations for trace data
      - `local` string — Absolute path to local trace file, omitted if not saved locally
      - `remote` string — Remote trace location (e.g., S3 URI), omitted if not saved remotely
    - `error` SerializedWorkflowError, nullable, required — Structured error details captured from the workflow or activity failure
      - `activityType` string — Failing activity type, omitted when the failure did not originate in an activity
      - `name` string — Original error class name
      - `message` string — Original error message
  - WorkflowResultV1Response — Legacy wrapped workflow result
    - `workflowId` string, required — The workflow execution id
    - `runId` string, nullable, required — The specific run id for this execution
    - `status` 'completed' | 'failed' | 'cancelled' | 'terminated' | 'timed_out' | 'continued_as_new', required — The workflow execution status
    - `input` unknown, required
    - `output` unknown, required
    - `trace` TraceInfoV1, nullable, required — Legacy trace information containing nested destinations
      - `destinations` object — Available destinations for trace data
        - `local` string — Absolute path to local trace file, omitted if not saved locally
        - `remote` string — Remote trace location (e.g., S3 URI), omitted if not saved remotely
    - `error` string, nullable, required — Error message if workflow failed, null otherwise
    - `errorDetails` object, nullable, required — Structured failure details if the workflow failed, null otherwise
      - `message` string, nullable — Friendly failure message (from the underlying application error)
      - `name` string, nullable — Error name/type (the original error's class)
      - `retryable` boolean, nullable — Whether Temporal flagged the failure retryable; null if unknown
      - `activityId` string, nullable — Failing activity key ("workflow#step"); null if no activity failed
      - `cause` object, nullable — Sanitized error cause chain (name/message per level, no stack)

## Other responses

- `400` — Invalid request body, query, or pagination token
- `404` — Workflow execution, workflow type, or catalog not found
- `408` — Synchronous execution timed out before workflow completed
- `424` — Workflow dependency failed (e.g. workflow not in a terminal state, or workflow type is unsupported by the selected catalog)
- `500` — Internal server error (e.g. Temporal connection failure)
- `503` — Catalog workflow unavailable (worker not running or still starting). Retry-After header may be set.

---

[API](https://skmtc.net/growthxai/apis/output-ai-api.md) · [All operations](https://skmtc.net/growthxai/apis/output-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/growthxai/output-ai-api/versions/09a49e598435/schema)
