Skip to main content
POST
Migrate Pathways

Overview

Deterministically converts up to 20 pathways into complex scenarios, one per pathway, with no AI planning involved. Each pathway is either referenced by ID or supplied inline as an exported graph (the JSON-file import). By default the scenarios are wrapped in a new agent whose system prompt is built from the pathways’ global prompts, and the agent plus its first version are created (201). Set create to false to receive just the scenario nodes for insertion into an existing agent (200). For planner-driven translation, use Start Pathway Translation. Limited to 60 imports per hour per organization. Requires an admin, owner, operator, or prompter role.

Headers

string
required
Your API key for authentication.

Body Parameters

array
required
One to 20 entries. Each entry must contain exactly one of pathway_id or pathway. Returns 400 INVALID_PATHWAYS for an empty array or a malformed entry, and 400 TOO_MANY_PATHWAYS beyond 20.
string
Display name for the new agent. Whitespace is trimmed. Defaults to the pathway’s name when exactly one pathway is given, otherwise Migrated pathways.
boolean
default:"true"
When false, no agent is created; the response carries the converted scenario nodes instead, ready to add to an existing agent’s behavior.nodes with Create Agent Version.

Response

Returns 201 when an agent was created and 200 in convert-only mode. Returns 422 with INVALID_MIGRATED_SNAPSHOT or MIGRATION_LINT_FAILED when the converted result does not validate.
boolean
true when an agent and first version were saved, false in convert-only mode.
object
Present when created is true. The new agent record: id, org_id, name, created_by (string | null), created_at, updated_at, and deleted_at (null). See Get Agent for its environments.
object
Present when created is true. The agent’s first version: id, org_id, agent_id, branch_id (null), snapshot (the full agent configuration, abbreviated in the example below), name (Migrated from N pathway(s)), created_via (manual), revision (0), created_by (string | null), and created_at.
array
Present when created is false. One complex-scenario node per pathway, each with id, type, position, and data (including the nested data.flow). IDs are unique within the response; remap them if they collide with nodes already in your agent.
array
Human-readable notes about constructs the conversion could not carry faithfully. In convert-only mode this also notes each pathway whose global prompt or memory setting was not carried, since those belong to the agent rather than a scenario. When several pathways have global prompts in create mode, a warning notes they were merged into the system prompt.
object
Structural checks on the converted result: errors (always empty on success) and warnings (array of strings).
null | array
null on success, or a list of error objects if the request failed.

Docs for agents: llms.txt