POST
Create Workflow
Создаёт агента из графа узлов и рёбер, который вы передаёте напрямую. Используйте этот способ, когда вам нужен полный контроль над структурой воркфлоу, или при программной генерации агентов. Объект workflow_definition содержит nodes (шаги разговора) и edges (переходы между шагами). Структура полей показана в схеме запроса на этой странице. Для ручной работы в панели используйте редактор сценария.

Headers

authorization
string | null
X-API-Key
string | null

Body

application/json

Create a workflow from a definition.

The legacy body is {name, workflow_definition}. Every other field is optional (Ф7, ADR agent-creation-wizard-functionality §10.2): a PortableAgentDocument from GET /workflow/{id}/export can be posted as is — its format/format_version header is validated and unknown keys (exported_at, stripped_refs, …) are ignored.

name
string
required
workflow_definition
Workflow Definition · object
required
format
string | null

Portable agent format name (agentika.agent). Omit for the legacy body; when set, format_version is required.

format_version
integer | null

Portable agent format version. An unsupported one is 422 unsupported_agent_format_version.

workflow_configurations
WorkflowConfigurationDefaults · object | null

Workflow configurations of the new workflow (validated like PUT /workflow/{id}). Model overrides, a custom ambient-noise storage key and masked secrets are refused (422 configuration_not_importable).

template_context_variables
Template Context Variables · object | null
call_disposition_codes
CallDispositionCodes · object | null
target_actions
TargetActionsConfig · object | null

Bot-level target-action defaults of the new workflow (null = none). Stored under new action ids.

Response

Successful Response

id
integer
required
name
string
required
status
string
required
created_at
string<date-time>
required
workflow_definition
Workflow Definition · object
required
current_definition_id
integer | null
required
template_context_variables
Template Context Variables · object | null
call_disposition_codes
CallDispositionCodes · object | null
target_actions
TargetActionsConfig · object | null

The stored layer: {"actions": []} means explicitly off; the model itself is absent (NULL column) when the level inherits.

total_runs
integer | null
workflow_configurations
Workflow Configurations · object | null
version_number
integer | null
version_status
string | null
workflow_uuid
string | null
model_is_realtime
boolean | null

Whether the effective model of the returned workflow_configurations (draft if any, else published) is realtime — the runtime's resolution: the workflow's model_configuration_v2_override, else the organization's configuration with legacy model_overrides. A realtime model does not support conversation_start_policy wait_client / wait_then_greeting (saving that combination is 422 start_policy_unsupported_for_realtime). null: not computed by this endpoint, or the model configuration does not resolve.