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

# Run

> Trigger a Runchat workflow by ID. Pass inputs by parameter ID, or post a JSON body that flows into the workflow's webhook node.

<Note>
  This endpoint **runs a workflow that already exists**. To *build or edit* a
  workflow programmatically, the [MCP server](/concepts/integrations/mcp) or
  [CLI](/concepts/integrations/cli) are usually the easiest path — they expose
  the full canvas toolset (create nodes, connect, run, publish) as native tools
  and handle auth. The same tools are also available over plain HTTP via the
  [Canvas API](/api-reference/canvas-tools).
</Note>


## OpenAPI

````yaml POST /{runchat_id}
openapi: 3.1.0
info:
  title: Runchat API
  description: API for executing Runchat flows and retrieving schema information.
  version: 1.0.0
servers:
  - url: https://runchat.com/api/v1
    description: Relative path for the API endpoints
security:
  - bearerAuth: []
tags:
  - name: Execution
    description: Endpoints related to running Runchat flows.
  - name: Schema
    description: Endpoints for retrieving Runchat flow structure and definitions.
  - name: Canvas
    description: >-
      Endpoints for programmatic canvas manipulation — reading, creating,
      connecting, and running nodes.
  - name: Jobs
    description: >-
      Endpoints for triggering saved Runchat jobs — scheduled flow runs and
      agent tasks.
paths:
  /{runchat_id}:
    parameters:
      - name: runchat_id
        in: path
        required: true
        description: The unique identifier for the Runchat flow.
        schema:
          type: string
    post:
      tags:
        - Execution
      summary: Execute Runchat Flow
      description: >-
        Executes a Runchat flow by creating a new instance or continuing an
        existing one. Requires input data matching the flow's API inputs or a
        webhook structure.
      requestBody:
        description: >-
          Input data for the Runchat execution. Provide `runchat_instance_id` to
          continue an existing execution. The `inputs` object structure should
          match the parameters defined in the Runchat API schema, keyed by
          `paramId_nodeId`. Alternatively, send raw data for webhook-triggered
          flows.
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecutionRequest'
            examples:
              apiInput:
                summary: Example with API Inputs
                value:
                  runchat_instance_id: existing-instance-uuid
                  inputs:
                    prompt_xyz123: Generate a story about a robot.
                    maxTokens_abc456:
                      - 100
              webhookInput:
                summary: Example with Webhook Data
                value:
                  runchat_instance_id: new-or-existing-instance-uuid
                  event: user_created
                  user_id: usr_789
                  timestamp: '2024-01-01T12:00:00Z'
              newInstance:
                summary: Example Creating New Instance
                value:
                  inputs:
                    query_nodeA: What is the weather?
      responses:
        '200':
          description: Successful execution of the Runchat flow.
          content:
            application/json:
              schema:
                type: object
                properties:
                  metadata:
                    type: string
                    format: json
                    description: Stringified JSON containing execution metadata.
                  runchat_instance_id:
                    type: string
                    description: >-
                      The unique identifier for the Runchat instance to be used.
                      If omitted a new instance will be created.
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/BasicParameter'
                    description: Array of output data from the executed nodes.
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    ExecutionRequest:
      type: object
      description: Request body for executing a Runchat flow.
      properties:
        runchat_instance_id:
          type: string
          description: Optional identifier to continue an existing Runchat instance.
        inputs:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: number
              - type: boolean
              - type: array
                items: {}
              - type: object
          description: >-
            Object containing input data keyed by 'paramId_nodeId'. Values can
            be primitive types, arrays, or structured objects for tree/list
            inputs (e.g., {"0": [...], "0:1": [...]}).
      additionalProperties: true
    BasicParameter:
      type: object
      properties:
        id:
          type: string
          description: >-
            Unique identifier for the parameter, often in the format
            'paramKey_parentNodeId'.
        label:
          type: string
          description: User-friendly label for the parameter.
        type:
          $ref: '#/components/schemas/DataTypes'
        description:
          type: string
          description: Description of the parameter.
        data:
          type: array
          items:
            type: object
            description: >-
              Represents a single data item, type varies based on the
              parameter's 'type' field.
          description: >-
            The actual data associated with the parameter, represented as an
            array of items.
      required:
        - id
        - label
        - type
        - description
        - data
    DataTypes:
      type: string
      enum:
        - string
        - number
        - boolean
        - object
        - image
        - video
        - audio
        - model
        - message
        - context
        - code
        - array
        - instruction
        - 'null'
        - markdown
        - file
        - format
        - html
        - pdf
        - trigger
        - select
      description: Enumeration of supported data types within Runchat.
    Error:
      type: object
      properties:
        error:
          type: string
          description: A message describing the error.
      required:
        - error
  responses:
    BadRequest:
      description: >-
        Bad Request - The request could not be understood or was missing
        required parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal Server Error - An unexpected error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication using Runchat API key. API keys can be
        created from the account menu

````