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

# Run Pipeline (Async)

> Asynchronously execute a pipeline. Returns a job_id for polling.



## OpenAPI

````yaml api-reference/openapi.json post /pipeline_async
openapi: 3.1.0
info:
  title: Aifano Platform API
  version: 1.0.0
  description: >-
    Transform unstructured documents into structured data. Parse, extract,
    split, and edit documents at scale.
servers:
  - url: https://platform.aifano.com
    description: Production
security:
  - BearerAuth: []
paths:
  /pipeline_async:
    post:
      tags:
        - Pipelines
      summary: Run Pipeline (Async)
      description: Asynchronously execute a pipeline. Returns a job_id for polling.
      operationId: pipeline_async
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AsyncPipelineRequest'
      responses:
        '200':
          description: Job created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncJobResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    AsyncPipelineRequest:
      type: object
      required:
        - input
        - pipeline_id
      properties:
        input:
          $ref: '#/components/schemas/DocumentInput'
        pipeline_id:
          type: string
        async:
          $ref: '#/components/schemas/AsyncConfig'
    AsyncJobResponse:
      type: object
      required:
        - job_id
      properties:
        job_id:
          type: string
          description: Job ID for polling via GET /job/{job_id}.
    DocumentInput:
      description: >-
        The document to process. Accepts: (1) a public URL, (2) a presigned S3
        URL, (3) an `aifano://file_id` from /upload, or (4) a `jobid://job_id`
        from a previous /parse call.
      oneOf:
        - type: string
          description: URL or aifano:// reference
        - $ref: '#/components/schemas/UploadResponse'
    AsyncConfig:
      type: object
      properties:
        priority:
          type: boolean
          default: false
          description: Process with priority if budget is available.
        webhook:
          type: object
          nullable: true
          description: Webhook configuration for job completion notifications.
          properties:
            mode:
              type: string
              enum:
                - svix
                - direct
            url:
              type: string
              description: Webhook URL (required for direct mode).
        metadata:
          description: Custom JSON metadata included in webhook payloads.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message.
    UploadResponse:
      type: object
      required:
        - file_id
      properties:
        file_id:
          type: string
          description: File reference in `aifano://file_id` format.
        presigned_url:
          type: string
          nullable: true
          description: Presigned URL for direct access.
  responses:
    Unauthorized:
      description: Unauthorized - invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Use your Aifano API key (starts with `ak_live_`)
        as the Bearer token.

````