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

# Send a chat message

> Send a natural language message to the LLM chat backend for a specific workflow.
The request includes the current workflow state and optional conversation history
so the LLM can generate contextually relevant responses.

The LLM response may contain plain text explanations and/or DSL commands
in ```flowdrop fenced code blocks. The frontend extracts and previews
these commands before execution.




## OpenAPI

````yaml /api-reference/openapi.yaml post /workflows/{id}/chat/messages
openapi: 3.0.3
info:
  title: FlowDrop™ API
  description: >
    FlowDrop is a visual workflow editor for AI applications and data processing
    pipelines.

    This API provides comprehensive endpoints for managing workflows, node
    types, pipeline execution, and port configuration.


    ## Features

    - **Workflow Management**: Complete CRUD operations for workflows with nodes
    and edges

    - **Node Type Discovery**: Browse and search available node processors with
    metadata

    - **Pipeline Execution**: Execute workflows with real-time status tracking
    and job management

    - **Port Configuration**: Dynamic port compatibility system with data type
    management

    - **Real-time Updates**: Track node execution status and pipeline progress

    - **Import/Export**: Import and export workflows in JSON format

    - **Validation**: Workflow validation before execution

    - **Agent Spec Integration**: Import/export Oracle Open Agent Spec flows and
    execute on compatible runtimes (WayFlow/PyAgentSpec)


    ## Architecture

    - **Frontend**: Svelte 5 + XYFlow for visual workflow editing

    - **Backend**: Drupal 10/11 with custom node processor plugins

    - **API**: RESTful JSON API with consistent response format

    - **Storage**: Drupal entity system with workflow versioning


    ## Authentication

    API endpoints require Drupal authentication. Use Bearer token or
    session-based authentication.


    ## Rate Limiting

    - Node Discovery: 100 requests/minute

    - Workflow Operations: 50 requests/minute

    - Pipeline Execution: 20 requests/minute


    ## Error Handling

    All errors return a consistent format with success flag, error message, and
    optional details.
  version: 1.0.0
  contact:
    name: FlowDrop Support
    email: shibinkidd@gmail.com
    url: https://www.drupal.org/project/issues/flowdrop?categories=All
servers:
  - url: http://localhost:5173/api/flowdrop
    description: Local development server (Svelte)
  - url: https://flowdrop.ddev.site/api/flowdrop
    description: Local Drupal server
security:
  - BearerAuth: []
  - SessionAuth: []
tags:
  - name: System
    description: System health and status endpoints
  - name: Node Types
    description: Node type discovery and metadata endpoints
  - name: Configuration
    description: System configuration endpoints including port configuration
  - name: Workflows
    description: Workflow CRUD operations
  - name: Pipeline
    description: Pipeline execution and monitoring
  - name: Playground
    description: Interactive workflow testing and chat interface
  - name: Interrupts
    description: |
      Human-in-the-Loop (HITL) interrupt endpoints for workflow interactions.
      Interrupts allow workflows to pause execution and request user input.
  - name: Validation
    description: Workflow validation
  - name: Import/Export
    description: Workflow import and export operations
  - name: Chat
    description: |
      LLM Chat Interface for natural language workflow building.
      Translates user intent into DSL commands via a backend LLM integration.
  - name: Agent Spec
    description: >
      Oracle Open Agent Spec integration endpoints.

      Provides bidirectional conversion between FlowDrop workflows and Agent
      Spec format,

      plus runtime execution on compatible runtimes (WayFlow, PyAgentSpec).

      @see https://github.com/oracle/agent-spec
paths:
  /workflows/{id}/chat/messages:
    post:
      tags:
        - Chat
      summary: Send a chat message
      description: >
        Send a natural language message to the LLM chat backend for a specific
        workflow.

        The request includes the current workflow state and optional
        conversation history

        so the LLM can generate contextually relevant responses.


        The LLM response may contain plain text explanations and/or DSL commands

        in ```flowdrop fenced code blocks. The frontend extracts and previews

        these commands before execution.
      operationId: sendChatMessage
      parameters:
        - name: id
          in: path
          description: Workflow ID
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatRequest'
            examples:
              simpleMessage:
                summary: Simple chat message
                value:
                  message: Add a processing node called "transform"
                  workflowState:
                    nodes: []
                    edges: []
              withHistory:
                summary: Message with conversation history
                value:
                  message: Now connect it to the start node
                  workflowState:
                    nodes:
                      - id: node-1
                        type: start
                      - id: node-2
                        type: processing
                    edges: []
                  history:
                    - role: user
                      content: Add a processing node called "transform"
                    - role: assistant
                      content: Done! I've added a processing node named "transform".
      responses:
        '200':
          description: Chat response with LLM-generated content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMessagesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    ChatRequest:
      type: object
      description: Request payload for sending a chat message
      required:
        - message
        - workflowState
      properties:
        message:
          type: string
          description: The user's natural language message
          example: Add a node called "transform" and connect it to the start node
        workflowState:
          type: object
          description: |
            Serialized current workflow state including nodes and edges.
            This gives the LLM context about the current workflow being edited.
          additionalProperties: true
        history:
          type: array
          description: Optional conversation history for multi-turn context
          items:
            $ref: '#/components/schemas/ChatHistoryMessage'
    ChatMessagesResponse:
      type: object
      description: Wrapped response for chat message send
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/ChatResponse'
    ChatHistoryMessage:
      type: object
      description: A single message in the chat conversation history
      required:
        - role
        - content
      properties:
        role:
          $ref: '#/components/schemas/ChatMessageRole'
        content:
          type: string
          description: The message text content
          example: Add a new processing node called "transform"
    ChatResponse:
      type: object
      description: |
        Response from the chat endpoint containing the LLM's reply.
        The content may include markdown formatting and fenced code blocks
        with DSL commands (```flowdrop blocks).
      required:
        - content
      properties:
        content:
          type: string
          description: |
            The LLM's response content. May contain markdown and
            ```flowdrop fenced code blocks with DSL commands.
          example: |
            I'll add a processing node and connect it to your start node.

            ```flowdrop
            add transform processing
            connect start:output transform:input
            ```
        conversationId:
          type: string
          description: Optional conversation ID for backend session tracking
          example: conv-abc123
    ErrorResponse:
      allOf:
        - $ref: '#/components/schemas/ApiResponse'
        - type: object
          properties:
            success:
              type: boolean
              example: false
            error:
              type: string
              description: Error message
            code:
              type: string
              description: Error code
            details:
              type: object
              description: Additional error details
    ChatMessageRole:
      type: string
      description: Role of the message sender
      enum:
        - user
        - assistant
      example: user
    ApiResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the request was successful
        data:
          description: Response data (type varies by endpoint)
        message:
          type: string
          description: Response message
        error:
          type: string
          description: Error message (if any)
  responses:
    BadRequest:
      description: Bad request - invalid parameters or request body
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error: Invalid request parameters
            code: VALIDATION_ERROR
            details:
              field: name
              message: Name is required
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error: Resource not found
            code: NOT_FOUND
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error: Internal server error
            code: INTERNAL_ERROR
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token for authentication
    SessionAuth:
      type: apiKey
      in: cookie
      name: SESS
      description: Drupal session cookie

````