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

# Run Workflow in Batch

> Start one run per item of inputs.

```bash cURL theme={null}
curl --request POST \
  --url "https://api.roe-ai.com/v1/workflows/YOUR_WORKFLOW_ID/runs/batch/" \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "inputs": [
      {"customer_id": "c_123"},
      {"customer_id": "c_456"}
    ]
  }'
```


## OpenAPI

````yaml POST /v1/workflows/{workflow_id}/runs/batch/
openapi: 3.1.0
info:
  title: Roe API
  version: 1.0.0
  description: Complete API documentation for Roe platform
servers:
  - url: https://api.roe-ai.com
    description: Production API
security: []
paths:
  /v1/workflows/{workflow_id}/runs/batch/:
    post:
      tags:
        - v1
      summary: Run a workflow in batch
      description: Start one run per item of inputs.
      operationId: v1_workflows_runs_batch_create
      parameters:
        - in: path
          name: workflow_id
          schema:
            type: string
            format: uuid
          required: true
        - name: organization_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: >-
            Organization ID. This is required for access control. It can be
            provided via query or request body depending on the endpoint.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowRunBatchCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRunBatch'
          description: ''
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - type: array
                    items:
                      type: string
                    description: >-
                      DRF ValidationError raised with a message string: the body
                      is a bare JSON array of error messages.
                  - type: object
                    additionalProperties:
                      oneOf:
                        - type: array
                          items:
                            type: string
                        - type: string
                    description: >-
                      Validation failure: a map of field name to a list of error
                      messages (DRF serializers) or a single message (e.g.
                      organization_id validation).
                  - type: object
                    properties:
                      error:
                        type: string
                    required:
                      - error
                    description: Hand-built application error body.
                description: >-
                  Bad request. The body is a bare array of messages, a
                  field-error map, or an {error} object depending on which
                  validation failed.
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetailResponse'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDetailResponse'
          description: ''
      security:
        - apiKeyAuth: []
components:
  schemas:
    WorkflowRunBatchCreateRequest:
      type: object
      properties:
        inputs:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: One object of input values per run.
          maxItems: 100000
          minItems: 1
        version_id:
          type: string
          format: uuid
          description: The version to run. Defaults to the current one.
      required:
        - inputs
    WorkflowRunBatch:
      type: object
      properties:
        runs:
          type: array
          items:
            $ref: '#/components/schemas/WorkflowRun'
      required:
        - runs
    ErrorDetailResponse:
      type: object
      description: 'DRF default error body: NotFound, PermissionDenied, Http404, etc.'
      properties:
        detail:
          type: string
          description: Human-readable error detail
      required:
        - detail
    WorkflowRun:
      type: object
      properties:
        id:
          type: string
          format: uuid
        workflow_id:
          type: string
          format: uuid
        version_id:
          type:
            - string
            - 'null'
          format: uuid
        status:
          $ref: '#/components/schemas/WorkflowRunStatusEnum'
        error_message:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
      required:
        - created_at
        - error_message
        - id
        - status
        - version_id
        - workflow_id
    WorkflowRunStatusEnum:
      enum:
        - pending
        - running
        - succeeded
        - failed
        - cancelled
      type: string
      description: |-
        * `pending` - pending
        * `running` - running
        * `succeeded` - succeeded
        * `failed` - failed
        * `cancelled` - cancelled
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key passed as a Bearer token. This is the scheme used
        by the public SDK surface.

````

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