> ## Documentation Index
> Fetch the complete documentation index at: https://docs.persistence.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Start a workflow run

> Queue a published event-to-call workflow with context.



## OpenAPI

````yaml api-reference/workflows/openapi.json POST /v1/workflows/{workflowId}/run
openapi: 3.0.3
info:
  title: Persistence Workflows API
  version: '1.0'
  description: Start, inspect, cancel, and wake published event-to-call workflow runs.
servers:
  - url: https://api.persistence.dev
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Workflows
paths:
  /v1/workflows/{workflowId}/run:
    post:
      tags:
        - Workflows
      summary: Start a workflow run
      description: >-
        Queue a published workflow. Drafts reject the request. Reuse
        Idempotency-Key when retrying the same start. Concurrency-Key allows
        only one active run per key; others return 409.
      operationId: startWorkflowRun
      parameters:
        - name: workflowId
          in: path
          required: true
          description: Published workflow ID
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          description: Stable key reused when retrying the same request
          schema:
            type: string
        - name: Concurrency-Key
          in: header
          required: false
          description: Runs sharing this key never overlap. Omit to allow parallel runs.
          schema:
            type: string
        - name: Cooldown-Minutes
          in: header
          required: false
          description: >-
            With Concurrency-Key: refuse new runs for that key until this many
            minutes after its last run ended (0-10080).
          schema:
            type: integer
            minimum: 0
            maximum: 10080
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunRequest'
      responses:
        '202':
          description: Run accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunEnvelope'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
components:
  schemas:
    RunRequest:
      type: object
      properties:
        context:
          type: object
          additionalProperties: true
          description: >-
            Initial values for the run. phone_number becomes {{phone_number}} in
            later steps.
          example:
            phone_number: '+14155550123'
    RunEnvelope:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/Run'
    Run:
      type: object
      required:
        - id
        - automationId
        - version
        - status
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          description: Run ID
        automationId:
          type: string
          description: Workflow ID
        automationName:
          type: string
        version:
          type: integer
        parentRunId:
          type: string
        parentStepId:
          type: string
        currentStepId:
          type: string
        concurrencyKey:
          type: string
        status:
          type: string
          enum:
            - queued
            - running
            - waiting_call
            - waiting_schedule
            - waiting_automation
            - blocked
            - completed
            - failed
            - cancelled
        currentNodeId:
          type: string
        currentNodeTitle:
          type: string
        context:
          type: object
          additionalProperties: true
        output:
          type: object
          additionalProperties: true
        error:
          type: object
          additionalProperties: true
        revision:
          type: integer
        wakeAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        code:
          type: string
        error:
          type: string
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Workspace API key with workflow run, and workflow read to check status.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.