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

# Execute Workflow

> Submits a workflow for asynchronous execution and returns an execution_id to poll. The request accepts either a structured payload referencing a stored workflow_id (preferred) or inline workflow JSON (legacy). Authentication accepts the x-api-key header or an X-Webhook-Secret header matching the workflow trigger's webhookSecret.



## OpenAPI

````yaml openapi/superflow.yaml POST /workflows/execute
openapi: 3.0.3
info:
  title: Lyzr SuperFlow API
  version: '1.0'
  description: >-
    SuperFlow orchestration API covering workflow CRUD, the execution lifecycle
    (run, pause, resume, terminate, rerun), scheduling, and human-in-the-loop
    approvals. Chat-completions and agent CRUD endpoints are documented
    separately and are not part of this surface.
servers:
  - url: https://inference.studio.lyzr.ai/api
security:
  - ApiKeyAuth: []
tags:
  - name: workflows
    description: Create, read, update, delete, and share workflow definitions.
  - name: workflow-execution
    description: Run workflows and control the execution lifecycle.
  - name: workflow-schedules
    description: Cron-driven recurring triggers for stored workflows.
  - name: approvals
    description: Human-in-the-loop approval requests raised by running workflows.
paths:
  /workflows/execute:
    post:
      tags:
        - workflow-execution
      summary: Execute a workflow
      description: >-
        Submits a workflow for asynchronous execution and returns an
        execution_id to poll. The request accepts either a structured payload
        referencing a stored workflow_id (preferred) or inline workflow JSON
        (legacy). Authentication accepts the x-api-key header or an
        X-Webhook-Secret header matching the workflow trigger's webhookSecret.
      operationId: executeWorkflow
      requestBody:
        required: true
        description: Workflow execution request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteRequest'
      responses:
        '202':
          description: Execution accepted; poll GET /executions/{id} for status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecuteResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid webhook secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: No access to stored workflow
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ExecuteRequest:
      type: object
      properties:
        workflow_id:
          type: string
          description: Reference to a stored workflow. Preferred over inline JSON.
          example: wf_9f2c1a
        workflow:
          type: object
          description: >-
            Inline workflow definition (legacy). Provide either workflow_id or
            workflow, not both.
        input:
          type: array
          description: Trigger data passed to the workflow's entry nodes.
          items:
            $ref: '#/components/schemas/Item'
    ExecuteResponse:
      type: object
      properties:
        execution_id:
          type: string
          example: exec_5b7d3e
        status:
          type: string
          example: running
        outputs:
          type: object
          description: Final outputs keyed by node, present once the run completes.
          additionalProperties:
            type: object
            additionalProperties:
              type: array
              items:
                $ref: '#/components/schemas/Item'
        node_outputs:
          type: object
          description: Per-node intermediate outputs.
          additionalProperties:
            type: object
            additionalProperties:
              type: array
              items:
                $ref: '#/components/schemas/Item'
        errors:
          type: array
          items:
            type: string
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
    Item:
      type: object
      additionalProperties: {}
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Tenant API key. Required on every endpoint.

````