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

# Run Workflow API

> Run a single contact through the latest published version and get back an execution id to poll.

<Note>
  `reference_id` is the contact's identity within the workflow version: repeating it returns `409 duplicate_run` with the existing `execution_id`, which makes the call safely retryable. When omitted, an identity is derived from the row's content.
</Note>

<Info>
  Fields declared by the start node can be passed flat at the top level — exactly like CSV columns — or nested under `custom_fields`. On a name collision the flat key wins. Undeclared keys are rejected with `422 unknown_field`.
</Info>


## OpenAPI

````yaml POST /workflows/{workflow_id}/run
openapi: 3.1.0
info:
  title: Bolna API
  description: >-
    Use and leverage Bolna Voice AI using APIs through HTTP requests from any
    language in your applications and workflows.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.bolna.ai
    description: Production server
security:
  - bearerAuth: []
paths:
  /workflows/{workflow_id}/run:
    post:
      description: >-
        Runs one contact through the workflow's latest published version.
        Returns an execution you can poll with the [Get Execution
        API](/api-reference/workflow-executions/get). Fields declared by the
        start node may be passed flat at the top level or nested under
        `custom_fields`; a flat key wins on collision.
      parameters:
        - in: path
          name: workflow_id
          required: true
          schema:
            type: string
            format: uuid
          description: The unique `id` of the workflow
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowRunRequest'
        required: true
      responses:
        '201':
          description: Execution created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRunResponse'
        '404':
          description: Workflow not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
        '409':
          description: >-
            `duplicate_run` — this `reference_id` already ran against this
            version; the response carries the existing `execution_id`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
        '422':
          description: >-
            `no_published_version`, or a row-validation failure such as
            `missing_required_value`, `invalid_field_type`, `invalid_phone` or
            `unknown_field`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowError'
components:
  schemas:
    WorkflowRunRequest:
      type: object
      additionalProperties: true
      description: >
        One contact. Fields declared by the published version's start node may
        be passed flat at the top level (like CSV columns) or nested under
        `custom_fields`; a flat key wins on collision.
      properties:
        reference_id:
          type: string
          description: >-
            Stable identity for this contact within the workflow version.
            Re-running the same `reference_id` returns `409 duplicate_run` with
            the existing `execution_id`. When omitted, an identity is derived
            from the row's content.
          example: cand_101
        mobile_number:
          type: string
          description: >-
            Contact's phone number in E.164 format. Required if the start node
            declares it required, or if the workflow dials it.
          example: '+919876543210'
        name:
          type: string
          description: Contact's name.
        email:
          type: string
          description: Contact's email.
        custom_fields:
          type: object
          description: Values for fields declared by the start node, keyed by field name.
    WorkflowRunResponse:
      type: object
      required:
        - execution_id
        - campaign_id
        - workflow_version
        - status
      properties:
        execution_id:
          type: string
          description: >-
            Id of the created execution. Poll it with the [Get Execution
            API](/api-reference/workflow-executions/get).
        campaign_id:
          type: string
          format: uuid
          description: >-
            The implicit `api`-kind campaign that groups single runs of this
            workflow version.
        workflow_version:
          type: integer
          description: The published version the contact runs through.
        status:
          type: string
          description: Initial execution status.
          enum:
            - pending
    WorkflowError:
      type: object
      description: >-
        Error envelope returned by every workflow endpoint. `detail.code` is a
        stable machine-readable code; extra keys (such as `current_revision` on
        `revision_conflict`, `execution_id` on `duplicate_run`, or `issues` on
        `invalid_definition`) ride alongside it.
      required:
        - detail
      properties:
        detail:
          type: object
          additionalProperties: true
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: revision_conflict
            message:
              type: string
              description: Human-readable explanation.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````