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

# Trigger Job

> Trigger a saved Runchat job. Runs the scheduled flow inputs for flow jobs, or replays the saved chat template and runs the agent loop unattended for agent jobs.



## OpenAPI

````yaml GET /job/{runchat_job_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:
  /job/{runchat_job_id}:
    parameters:
      - name: runchat_job_id
        in: path
        required: true
        description: >-
          The unique identifier for the Runchat job. Jobs are created from the
          Tasks dashboard and back either a flow run or a saved agent chat.
        schema:
          type: string
    get:
      tags:
        - Jobs
      summary: Trigger Job
      description: >-
        Triggers a saved Runchat job. If the job is backed by a flow it runs the
        flow's scheduled inputs. If the job is backed by an agent chat it
        replays the saved messages and runs the agent loop unattended.


        A new row is written to `runchat_job_history` for every invocation, with
        the resulting flow state (and, for agent jobs, the message transcript)
        persisted to R2.
      responses:
        '200':
          description: Successful job execution.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/FlowJobResponse'
                  - $ref: '#/components/schemas/AgentJobResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          description: >-
            Access denied — user does not have permission to the underlying
            Runchat.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Job or Runchat not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    FlowJobResponse:
      type: object
      description: Response shape for flow-backed job runs (GET only).
      properties:
        metadata:
          type: string
          format: json
          description: Stringified JSON containing execution metadata.
        data:
          type: array
          items:
            $ref: '#/components/schemas/BasicParameter'
          description: Output data from the executed nodes.
        job_id:
          type: string
          description: The job identifier.
        runchat_id:
          type: string
          description: The underlying Runchat identifier.
    AgentJobResponse:
      type: object
      description: Response shape for agent-backed job runs.
      properties:
        metadata:
          type: string
          format: json
          description: >-
            Stringified JSON containing the agent run metadata (token counts,
            credits, etc.).
        messages:
          type: array
          items:
            type: object
          description: >-
            Final transcript including the saved template, any appended user
            message, and the agent's responses.
        job_id:
          type: string
          description: The job identifier.
        runchat_id:
          type: string
          description: The underlying Runchat identifier.
        status:
          type: string
          enum:
            - success
            - error
          description: Outcome of the agent run.
        error:
          type: string
          description: Error message, present only when `status` is `error`.
    Error:
      type: object
      properties:
        error:
          type: string
          description: A message describing the error.
      required:
        - error
    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.
  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

````