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

# Run Workflow

> Run a workflow by ID.

Starts a browser session that executes a saved workflow. Pass input variables (form data) and receive a session ID to track progress via [polling](/api-reference/poll-session-status) or [webhooks](/integrating-simplex/webhooks).


## OpenAPI

````yaml POST /run_workflow
openapi: 3.0.1
info:
  title: Simplex API
  description: API for browser automation, web scraping, and workflow automation
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.simplex.sh
security:
  - bearerAuth: []
paths:
  /run_workflow:
    post:
      description: Run a workflow by ID.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                workflow_id:
                  type: string
                  format: uuid
                  description: The ID of the workflow to run.
                metadata:
                  type: string
                  description: >-
                    JSON string containing metadata for the workflow. This
                    metadata is passed back to you in the webhook response.
                webhook_url:
                  type: string
                  description: >-
                    Optional webhook URL to test workflow changes on. Often an
                    ngrok URL of a local version of your application.
                variables:
                  type: string
                  description: JSON string containing variables to pass to the workflow.
                  example: >-
                    {"username": "john_doe", "product_id": "12345", "quantity":
                    2}
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: >-
                    Optional list of files to upload for workflows that contain
                    file upload actions.
              required:
                - workflow_id
      responses:
        '200':
          description: Run workflow response
          content:
            application/json:
              schema:
                type: object
                properties:
                  succeeded:
                    type: boolean
                    description: Whether the workflow code executed successfully.
                  message:
                    type: string
                    description: Success or error message about the workflow execution.
                  session_id:
                    type: string
                    format: uuid
                    description: The session ID for the workflow.
                  vnc_url:
                    type: string
                    description: >-
                      The VNC URL for viewing the workflow session. You can put
                      this in an iframe to whitelabel Simplex's sessions.
                  logs_url:
                    type: string
                    description: >-
                      URL for viewing session logs. Available once the session
                      container has started.
                required:
                  - succeeded
                  - message
                  - session_id
                  - vnc_url
                  - logs_url
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        succeeded:
          type: boolean
          example: false
        error:
          type: string
          example: Invalid API key.
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Simplex API Key

````