POST
/v1/agents/{agent_id}/workflowsCreate a workflow
Creates a workflow for a specific agent using a definition, routing configuration, and optional steps and settings. Include definition and routing; nested required fields include definition.kind and routing.primary.endpoint.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
agent_idstringrequired
The unique identifier of the agent to associate with the workflow.
Workflow configuration. Include definition and routing; nested objects and step items have additional required fields.
definitionobjectrequired
allOf — the merged object should show `kind` (required) plus retries/timeout_ms.
routingobjectrequired
Three levels of required nesting.
stepsarray<object>optional
$ref array items, each containing a further $ref (condition).
matrixarray<array>optional
An array of arrays — nested 'Add new item'.
targetstringoptional
oneOf — the builder renders the first variant (string).
priorityintegeroptional
The workflow priority: `1`, `2`, or `3`.
labelsobjectoptional
Free-form key-value data for workflow labels.
201Returns the created workflow object.
Error handling
The agent_id path parameter must identify an existing agent. definition and routing are required, definition.kind is required, and routing.primary.endpoint is required. Each steps item must include id and action, action must be speak, listen, or transfer, and a condition must include expr.