Skip to main content
POST
/
v1
/
workflows
/
{workflow_id}
/
invoke
/
stream
Invoke Workflow (Stream)
curl --request POST \
  --url https://api.xpander.ai/v1/workflows/{workflow_id}/invoke/stream \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "input": {
    "text": "",
    "user": {
      "id": "<string>",
      "email": "<string>"
    }
  },
  "id": "02843b37-4d77-48a0-8da7-2c76afe54401"
}
'
{
  "id": "87b81bf7-7777-456e-805d-2767da39c62d",
  "agent_id": "47c3b020-9a6b-4699-8d94-d92d71929b53",
  "organization_id": "91fbe9bc-35b3-41e8-b59d-922fb5a0f031",
  "status": "pending",
  "result": null,
  "created_at": "2026-04-10T19:01:35.114410Z",
  "finished_at": null,
  "source": "api"
}
Invoke a workflow with real-time streaming via Server-Sent Events (SSE). Receive live updates as the pipeline progresses through each node on the canvas — including tool calls, agent reasoning, sub-agent triggers, and the final result.

Path Parameters

workflow_id
string
required
Workflow ID (UUID)

Query Parameters

version
string
The workflow version to invoke. Defaults to the latest deployed version.

Request Body

Same as Invoke Workflow (Sync) — see that page for full request body documentation.

Response

Returns a text/event-stream response with Server-Sent Events. Each event contains a JSON payload with task update information. Events are sent as the workflow executes, including status changes, intermediate results, and the final TaskFinished event.

Example Request

curl -N -X POST "https://api.xpander.ai/v1/workflows/<workflow-id>/invoke/stream" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{"input": {"text": "Generate a comprehensive report"}}'

Notes

  • The stream ends with a TaskFinished event type
  • Each SSE event is a data: line containing a JSON object
  • Use Cache-Control: no-cache and Connection: keep-alive headers for best results
  • Ideal for building real-time UIs that show pipeline progress across nodes

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

workflow_id
string
required

Query Parameters

version
string | null

The workflow version to invoke. default = latest

Body

application/json
input
AgentExecutionInput · object
required
id
string

Pass the id from a previous response to continue a multi-turn conversation with the same agent. Omit for a new conversation.

Example:

"02843b37-4d77-48a0-8da7-2c76afe54401"

Response

Successful Response