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

# Execute a workflow

> Manually triggers the execution of a workflow. The workflow will run asynchronously in the background. The response acknowledges that the execution has been accepted and provides the ID of the new workflow run.



## OpenAPI

````yaml /api/en/workflows.yaml post /workflows/{workflowId}/execute
openapi: 3.0.3
info:
  title: Altostrat Workflows API
  version: 1.0.0
  description: >-
    Create, validate, execute, and monitor SDX workflows through the public
    `/workflows` gateway path. The reference intentionally omits internal
    dashboard-builder and local development endpoints.
servers:
  - url: https://v1.api.altostrat.io
    description: Altostrat SDX Production API
security: []
tags:
  - name: Workflows
    description: Manage workflow definitions, the core automation blueprints.
  - name: Workflow Runs
    description: Execute, monitor, and manage individual workflow executions.
  - name: Vault
    description: Securely store and manage secrets used by your workflows.
  - name: Webhooks
    description: Endpoints for triggering workflows from external systems.
  - name: Utilities
    description: Helper endpoints for building and debugging workflows.
  - name: Workflow Logs
    description: Inspect workflow execution logs and aggregate log statistics.
  - name: Authorizations
    description: Manage delegated account authorization for workflow runs.
paths:
  /workflows/{workflowId}/execute:
    post:
      tags:
        - Workflow Runs
      summary: Execute a workflow
      description: >-
        Manually triggers the execution of a workflow. The workflow will run
        asynchronously in the background. The response acknowledges that the
        execution has been accepted and provides the ID of the new workflow run.
      parameters:
        - $ref: '#/components/parameters/WorkflowId'
      requestBody:
        description: >-
          An optional context object to pass initial data to the workflow's
          trigger node.
        content:
          application/json:
            schema:
              type: object
              properties:
                context:
                  type: object
                  description: A key-value map of initial data for the workflow.
                  example:
                    user_id: usr_123
                    site_id: site_456
      responses:
        '202':
          description: >-
            The workflow execution has been accepted and is running
            asynchronously.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRun'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - BearerAuth: []
components:
  parameters:
    WorkflowId:
      name: workflowId
      in: path
      required: true
      description: The prefixed ID of the workflow (e.g., `fl_...`).
      schema:
        type: string
      example: fl_01h3j4k5l6m7n8p9q0r1s2t3u4
  schemas:
    WorkflowRun:
      type: object
      properties:
        id:
          type: string
          description: The unique prefixed identifier for the workflow run.
          example: fl_run_01h3j4k5l6m7n8p9q0r1s2t3u4
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
            - awaiting_ui_interaction
          description: The current status of the workflow run.
          example: completed
        error_message:
          type: string
          nullable: true
          description: If the run failed, this contains the error message.
          example: 'Webhook request failed: 503 Service Unavailable'
        started_at:
          type: string
          format: date-time
          description: The timestamp when the workflow run started.
          example: '2025-10-31T12:00:00.000000Z'
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            The timestamp when the workflow run finished (either completed or
            failed).
          example: '2025-10-31T12:00:05.000000Z'
        duration_in_seconds:
          type: number
          nullable: true
          description: The total duration of the workflow run in seconds.
          example: 5
        logs:
          type: array
          description: >-
            An ordered list of log entries for each step of the execution. Only
            returned when retrieving a single run.
          items:
            $ref: '#/components/schemas/WorkflowLog'
    WorkflowLog:
      type: object
      properties:
        id:
          type: string
          description: The unique prefixed identifier for the log entry.
          example: fl_log_01h3j4k5l6m7n8p9q0r1s2t3u4
        node_id:
          type: string
          description: The ID of the node that generated this log entry.
          example: n2
        component_id:
          type: string
          nullable: true
          description: The component type of the node that generated this log.
          example: webhook
        status:
          type: string
          enum:
            - success
            - error
            - warning
          description: The status of this specific step execution.
          example: success
        output:
          type: object
          additionalProperties: true
          description: The JSON output produced by the node.
          example:
            status: 200
            body:
              message: ok
        created_at:
          type: string
          format: date-time
          description: The timestamp when the log entry was created.
          example: '2025-10-31T12:00:02.000000Z'
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          description: A broad category for the error (e.g., 'invalid_request_error').
          example: invalid_request_error
        code:
          type: string
          description: A short, unique string identifying the specific error.
          example: parameter_missing
        message:
          type: string
          description: A human-readable description of what went wrong.
          example: The 'name' parameter is required for this request.
        doc_url:
          type: string
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_missing
  responses:
    Unauthorized:
      description: >-
        Unauthorized - The request requires authentication, but a valid token
        was not provided.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: >-
        Forbidden - The authenticated user does not have permission to perform
        this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found - The requested resource could not be found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServerError:
      description: Internal Server Error - An unexpected error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Standard JWT for user sessions obtained via Altostrat authentication.

````