> ## 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.

# Run a Workflow

> Trigger a multi-step Workflow by ID, pass input parameters into the first step, and receive the full run result with per-step output.



## OpenAPI

````yaml /openapispec.json post /api/workflows/{workflow_id}/run
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: Read past Workflow run history.
paths:
  /api/workflows/{workflow_id}/run:
    post:
      tags:
        - Workflows
      summary: Run a Workflow
      description: >-
        Trigger a multi-step Workflow by ID, pass input parameters into the
        first step, and receive the full run result with per-step output.
      operationId: runWorkflow
      parameters:
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The UUID of the Workflow to run.
          example: 3f2a1bc4-e89b-12d3-a456-426614174000
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                inputs:
                  type: object
                  description: >-
                    Key-value map of input parameters to pass into the first
                    step. Reference these in step configs with
                    {{inputs.field_name}}.
                  additionalProperties: true
                  default: {}
                  example:
                    target_url: https://example.com/pricing
      responses:
        '200':
          description: Workflow run result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRun'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - SessionAuth: []
components:
  schemas:
    WorkflowRun:
      type: object
      properties:
        id:
          type: string
          format: uuid
        workflow_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - completed
            - failed
            - waiting_for_human
        inputs:
          type: object
          nullable: true
          additionalProperties: true
        outputs:
          nullable: true
        error:
          type: string
          nullable: true
        credits_charged:
          type: number
          format: float
        execution_time_ms:
          type: integer
          nullable: true
        started_at:
          type: string
          format: date-time
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        step_results:
          type: array
          items:
            $ref: '#/components/schemas/StepResult'
    StepResult:
      type: object
      properties:
        id:
          type: string
        step_id:
          type: string
        step_name:
          type: string
        step_type:
          type: string
          enum:
            - agent
            - code
            - http
            - transform
            - dfuse
            - skill
        sequence_order:
          type: integer
        status:
          type: string
          enum:
            - completed
            - failed
        inputs:
          type: object
          nullable: true
          additionalProperties: true
        output:
          nullable: true
        error:
          type: string
          nullable: true
        execution_time_ms:
          type: integer
          nullable: true
        started_at:
          type: string
          format: date-time
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
    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:
    BadRequest:
      description: >-
        Bad request. The request body is malformed, missing required fields, or
        invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        Unauthorized. The Authorization header is missing, malformed, or the
        credential is invalid or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found in your Workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Too many requests, or insufficient credits to start this run.
      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.

````