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

# Start an async workflow run

> Start a workflow run in the background and get a run id at once. Supports Idempotency-Key and signed webhooks.

The outputs are not in this response. Poll [`GET /v1/workflow-runs/{run_id}`](/api-reference/workflows/get-run) until `status` is no longer `pending` or `running`, or set `webhook_url` to receive the finished run as a signed `POST`. See [Webhooks](/guides/web-to-api#webhooks) for how to verify the signature.


## OpenAPI

````yaml POST /v1/workflows/{slug}/runs
openapi: 3.0.3
info:
  title: Valendata REST API
  version: 1.0.0
  description: >-
    Trigger Skills, manage Workflows, retrieve Runs, and stream structured
    results from any language using JSON over HTTPS.
servers:
  - url: https://api.valendata.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Skills
    description: Execute and inspect published Skills.
  - name: Workflows
    description: Trigger multi-step Workflows and list them.
  - name: Runs
    description: Start async Skill runs and read Skill and Workflow run results.
  - name: Skill creation
    description: Create a Skill from a plain-language task.
  - name: Skill improvement
    description: >-
      Fix a Skill, add fields to it or re-learn its detail steps, poll the
      result, and read its change history.
  - name: Versions
    description: List, diff, restore, and pin a Skill's recipe versions.
  - name: Webhooks
    description: Signed delivery of finished async runs.
paths:
  /v1/workflows/{slug}/runs:
    post:
      tags:
        - Workflows
      summary: Start an async Workflow run
      description: >-
        Checks the inputs, starts the run and answers at once with a `run_id`.
        If your account is at its limit of runs in progress, the run waits as
        `pending`. Poll `GET /v1/workflow-runs/{run_id}` or pass `webhook_url`
        to receive the finished run as a signed POST.
      operationId: startWorkflowRun
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
          description: The workflow's slug (shown on its API tab).
          example: test-workflow-api
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
          description: >-
            Retry-safe key. The same key from the same account returns the run
            it already started.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunWorkflowRequest'
            example:
              inputs:
                limit: 3
              wait: 60
      responses:
        '202':
          description: Run started (or the existing one, for a repeated Idempotency-Key).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartWorkflowRunResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
        - SessionAuth: []
components:
  schemas:
    RunWorkflowRequest:
      type: object
      properties:
        inputs:
          type: object
          additionalProperties: true
          description: >-
            The workflow's inputs (see `input_schema`). Values are converted
            like skill inputs: `"5"` → 5 for an integer.
        wait:
          type: integer
          minimum: 0
          maximum: 120
          description: '`/run` only: seconds to wait (default 60).'
        webhook_url:
          type: string
          format: uri
          description: >-
            Receives the finished run as a signed POST
            (`X-Valendata-Signature`).
    StartWorkflowRunResponse:
      type: object
      required:
        - run_id
        - status
        - status_url
      properties:
        run_id:
          type: string
        status:
          type: string
        status_url:
          type: string
          example: /v1/workflow-runs/0f533c1b-9134-466f-b6ba-38592ca5d21c
        idempotent_replay:
          type: boolean
    Error:
      type: object
      properties:
        detail:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          description: >-
            Error message. Usually a plain string; may be a structured object
            for some errors.
      example:
        detail: Invalid or expired API key
  responses:
    Unauthorized:
      description: >-
        Unauthorized. The Authorization header is missing, malformed, or the
        credential is invalid or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        Forbidden. You may not run or change this Skill, or it is not published
        or active.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found in your Workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unprocessable:
      description: >-
        Invalid request. For bad inputs, `detail` is `{message, errors,
        allowed_inputs}`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Internal server error on Valendata's side.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: vd_sk_...
      description: >-
        API key with the `vd_sk_` prefix. Create keys from Settings, API Keys in
        the dashboard.
    SessionAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Session token (JWT) obtained by calling `POST /api/auth/login` with your
        email and password.

````

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