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

# Execute workflow

> Execute a named workflow with the provided message and stream SSE events back. Returns a Server-Sent Events stream following the AI SDK UI Message protocol. The stream includes assistant messages, tool calls, and tool results.



## OpenAPI

````yaml openapi.json post /v1/workflow/
openapi: 3.1.0
info:
  title: Illumina Lab API
  description: AI-powered workflow orchestration API for building AI applications.
  version: 0.1.0
servers:
  - url: https://api.illuminalab.com
security: []
tags:
  - name: workflow
    description: Workflow execution endpoints for running AI conversations
  - name: resources
    description: Resource and thread management within specific resources
  - name: threads
    description: Direct thread access endpoints for the authenticated team
  - name: feedback
    description: Endpoints for providing feedback on AI responses and conversations
paths:
  /v1/workflow/:
    post:
      tags:
        - workflow
      summary: Execute workflow
      description: >-
        Execute a named workflow with the provided message and stream SSE events
        back. Returns a Server-Sent Events stream following the AI SDK UI
        Message protocol. The stream includes assistant messages, tool calls,
        and tool results.
      operationId: postV1Workflow
      parameters:
        - name: authorization
          in: header
          required: true
          schema:
            type: string
            pattern: ^Bearer [\s\S]{0,}$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                workflow_name:
                  type: string
                  minLength: 1
                  description: Name of the workflow to execute
                message:
                  description: >-
                    User message in IlluminaUIMessage format with parts array;
                    see the type `IlluminaUIMessage` from
                    `@illuminalab/react-ui`
                thread_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  description: UUID of the conversation thread
                resource_id:
                  type: string
                  minLength: 10
                  pattern: ^\S+$
                  description: Unique resource identifier (min 10 chars, no whitespace)
                metadata:
                  description: Optional key-value metadata for workflow configuration
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    $ref: '#/components/schemas/AnyValue'
              required:
                - workflow_name
                - message
                - thread_id
                - resource_id
              additionalProperties: false
          application/x-www-form-urlencoded:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                workflow_name:
                  type: string
                  minLength: 1
                  description: Name of the workflow to execute
                message:
                  description: >-
                    User message in IlluminaUIMessage format with parts array;
                    see the type `IlluminaUIMessage` from
                    `@illuminalab/react-ui`
                thread_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  description: UUID of the conversation thread
                resource_id:
                  type: string
                  minLength: 10
                  pattern: ^\S+$
                  description: Unique resource identifier (min 10 chars, no whitespace)
                metadata:
                  description: Optional key-value metadata for workflow configuration
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    $ref: '#/components/schemas/AnyValue'
              required:
                - workflow_name
                - message
                - thread_id
                - resource_id
              additionalProperties: false
          multipart/form-data:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                workflow_name:
                  type: string
                  minLength: 1
                  description: Name of the workflow to execute
                message:
                  description: >-
                    User message in IlluminaUIMessage format with parts array;
                    see the type `IlluminaUIMessage` from
                    `@illuminalab/react-ui`
                thread_id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  description: UUID of the conversation thread
                resource_id:
                  type: string
                  minLength: 10
                  pattern: ^\S+$
                  description: Unique resource identifier (min 10 chars, no whitespace)
                metadata:
                  description: Optional key-value metadata for workflow configuration
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    $ref: '#/components/schemas/AnyValue'
              required:
                - workflow_name
                - message
                - thread_id
                - resource_id
              additionalProperties: false
      responses:
        '200':
          description: >-
            Server-Sent Events stream following the AI SDK UI Message protocol.
            Format: 'event: <type>\ndata: <json>\n\n' for each event.
          content:
            text/plain:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: string
                description: >-
                  Server-Sent Events stream following the AI SDK UI Message
                  protocol. Format: 'event: <type>\ndata: <json>\n\n' for each
                  event.
          headers:
            Content-Type:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: string
                const: text/event-stream
              description: ''
            Cache-Control:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: string
                const: no-cache
              description: ''
            Connection:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: string
                const: keep-alive
              description: ''
            x-vercel-ai-ui-message-stream:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: string
                const: v1
                description: AI SDK v6 stream format version identifier
              description: AI SDK v6 stream format version identifier
        '401':
          description: Error response following IlluminaError format
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Error code in format 'type:surface' (e.g.,
                          'not_found:database')
                      message:
                        type: string
                        description: Human-readable error message
                      details:
                        description: Additional error context
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          $ref: '#/components/schemas/AnyValue'
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
                description: Error response following IlluminaError format
        '404':
          description: Error response following IlluminaError format
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Error code in format 'type:surface' (e.g.,
                          'not_found:database')
                      message:
                        type: string
                        description: Human-readable error message
                      details:
                        description: Additional error context
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          $ref: '#/components/schemas/AnyValue'
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
                description: Error response following IlluminaError format
        '500':
          description: Error response following IlluminaError format
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Error code in format 'type:surface' (e.g.,
                          'not_found:database')
                      message:
                        type: string
                        description: Human-readable error message
                      details:
                        description: Additional error context
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          $ref: '#/components/schemas/AnyValue'
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
                description: Error response following IlluminaError format
components:
  schemas:
    AnyValue:
      description: JSON-compatible value
      anyOf:
        - anyOf:
            - type: string
            - type: number
            - type: boolean
            - type: 'null'
        - type: array
          items:
            $ref: '#/components/schemas/AnyValue'
        - type: object
          propertyNames:
            type: string
          additionalProperties:
            $ref: '#/components/schemas/AnyValue'

````