Skip to main content
POST
Migrate Pathway

Overview

Takes an exported pathway graph and uses Bland’s migration planner to re-architect it as an agent: the planner decides the scenario structure, and every legacy prompt, code snippet, and webhook body is carried over verbatim. By default the call is a dry run that returns the plan, the proposed agent snapshot, and a lint report for review; set create to true to also persist a new agent with its first version. A run takes several minutes; to receive progress events while it runs, use Stream Pathway Migration. For a deterministic conversion with no planner, see Migrate Pathways. Limited to 10 migration starts per hour per organization, counted together with Stream Pathway Migration 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. 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.
string
Display name for the new agent when create is true. Whitespace is trimmed. 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 and the response is 201. Any other value is treated as false (dry run, 200).

Response

Returns 200 for a dry run and 201 when an agent was created. Returns 422 when the migrated snapshot fails validation or lint, or, in create mode, when the planner’s report contains a blocking loss (MIGRATION_BLOCKING_LOSS), an open question (MIGRATION_OPEN_QUESTION), or a custom-code step with no saved snippet (MIGRATION_CUSTOM_CODE_UNSUPPORTED). In those cases review the dry-run output before creating.
object
The planner’s migration plan. It references legacy nodes by ID rather than repeating their content.
object
The proposed agent configuration: behavior (nodes and edges), settings, contact, and optionally knowledge. This is the same shape Create Agent Version accepts, so you can edit it and save it to any agent. Abbreviated in the example below.
object
Structural checks on the snapshot: errors (array of strings; non-empty blocks creation) and warnings (array of strings).
object
Planner usage for the run: inputTokens, outputTokens, and iterations.
boolean
false for a dry run, true when an agent and first version were saved.
object
Present only when created is true. The new agent record: id, org_id, name, created_by (string | null), created_at, updated_at, and deleted_at (null). Its dev, staging, and production environments are created unpinned; see Get Agent.
object
Present only when created is true. The agent’s first version: id, org_id, agent_id, branch_id (null), snapshot (identical to data.snapshot), name (Migrated from pathway: <pathway name>), created_via (manual), revision (0), created_by (string | null), and created_at.
null | array
null on success, or a list of error objects if the request failed.

Docs for agents: llms.txt