---
title: "POST /v1/ai/workflow/chat/stream"
method: POST
path: "/v1/ai/workflow/chat/stream"
---

# POST /v1/ai/workflow/chat/stream

`POST /v1/ai/workflow/chat/stream`

Stream AI chat for workflow generation and updates via SSE

## Request body

- union
  - object
  - ChatParams
    - `definition` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityWorkflowDefinition — Definition is the full workflow graph to execute. Must contain a "root" node with type "manual". All action nodes referenced in children arrays must be present.
      - `inputSchema` GithubComB3FunB3MonoServicesB3osWorkflowInternalPkgEntityWorkflowInput[]
        - `description` string
        - `key` string
        - `required` boolean
        - `type` string — "string", "number", "boolean", "object", "array"
      - `nodes` object, required
      - `sensitivePropKeys` string[]
    - `description` string — Optional - for generating new workflow
    - `failedRunId` string — Optional - ID of a failed run to provide error context for debugging
    - `images` ChatImageAttachment[] — Optional - images attached to the message (base64 for LLM, IPFS for storage)
      - `base64` string
      - `ipfsUrl` string
    - `lastEventIndex` integer — Last received event index for replay (reconnection)
    - `message` string — Optional on reconnect, required for new sessions
    - `name` string — Optional - for generating new workflow
    - `preferredMode` 'planning' | 'building' | 'repair' | 'conversation' — Optional - user's preferred mode hint; overrides auto-classifier when set
    - `requestId` string — Client-generated UUID4 for persistent session tracking (optional for legacy/inline mode)
    - `sessionId` string — Optional - for create page (temporary session context)
    - `timezone` string — Optional - user's IANA timezone (e.g. "America/New_York") for time-aware responses
    - `workflowId` string — Optional - for edit page (existing workflow context)

## Response `200`

SSE stream with events: chunk, node, done, error

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/b3-fun/apis/b3os-workflow-api.md) · [All operations](https://skmtc.net/b3-fun/apis/b3os-workflow-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/b3-fun/b3os-workflow-api/versions/5a750a5a9596/schema)
