Skip to main content
POST
Stream Pathway Migration

Overview

Runs the same migration as Migrate Pathway with the same body and the same outcome, but delivers it as a Server-Sent Events stream so you can show progress during the multi-minute planner run. The final done event carries exactly the status, data, and errors the JSON endpoint would have returned. If you disconnect before the run finishes, the planner is aborted and nothing is created. Limited to 10 migration starts per hour per organization, counted together with Migrate Pathway and Start Pathway Translation. Requires an admin, owner, operator, or prompter role.

Headers

string
required
Your API key for authentication.

Body Parameters

object
required
The legacy pathway graph, in the shape the pathway editor exports: nodes (required, non-empty array), edges (required array, may be empty), and optional name and globalPrompt. Returns 400 INVALID_PATHWAY if nodes or edges is missing or nodes is empty, and 400 PATHWAY_TOO_LARGE beyond 500 nodes, 2,000 edges, or 2 MB serialized. See Migrate Pathway for field details.
string
Display name for the new agent when create is true. Defaults to <pathway.name> (migrated), or unnamed pathway (migrated) when the pathway has no name.
boolean
default:"false"
When true, the migrated snapshot is saved as a new agent with its first version. Any other value is treated as false (dry run).

Response

Body validation and the rate limit are checked before the stream opens, so those failures arrive as ordinary JSON responses (400 or 429). Once accepted, the response is 200 with Content-Type: text/event-stream, Cache-Control: no-cache, no-transform, and Connection: keep-alive. Each event is a single data: line holding a JSON object whose type field identifies it; no event: names are used. A comment line : ping is sent every 10 seconds as a heartbeat and should be ignored. The stream closes after the done or error event.
string
Present on every event. One of start, read_reference, read_nodes, iteration, plan_submitted, materializing, done, error.
event
Emitted once when the planner begins.
event
The planner consulted one of its internal reference documents. name (string) identifies the document.
event
The planner read the full content of specific legacy nodes. ids (array of strings) lists their IDs.
event
One planner turn finished. Turns can be one to three minutes apart.
event
The planner submitted a plan. Carries scenarios, endCalls, and openQuestions (integers). A rejected plan is repaired and resubmitted within the same run, so this can fire more than once.
event
The plan is being turned into an agent snapshot. No other fields.
event
The run finished. Emitted once, then the stream closes.
event
The planner itself failed. message (string) is safe to show to users. The stream closes after it.
null | array
null on success, or a list of error objects if the request failed.

Docs for agents: llms.txt