Skip to main content

Workflow Definition Schema

Schema reference for the workflow_definition object used in the Agents API
4 min read

The workflow_definition object passed to Create from Definition and Update Agent defines the full conversation graph. It is the same structure the dashboard's visual workflow builder reads and writes — building an agent in the UI produces a workflow_definition under the hood, and anything you can configure visually can equally be expressed here as JSON.


Nodes#

Each node represents a step in the conversation.

FieldTypeDescription
idstringUnique node ID (UUID recommended)
typestringOne of the node types below
positionobjectVisual coordinates in the workflow builder
dataobjectNode configuration — fields vary by type

Node types#

TypeDescription
startCallEntry point for telephony calls
endCallTerminates the call
agentNodeLLM-powered conversation step
globalNodeGlobal configuration applied across all agent nodes
triggerConfigures API-triggered outbound calls
webhookSends configured post-call data asynchronously after completion
qaRuns quality analysis on the completed call

Node data fields#

Common fields (all node types)#

FieldTypeDefaultDescription
namestringrequiredDisplay name for the node
promptstringrequired*LLM system prompt. *Not required for trigger, webhook, qa nodes
allow_interruptbooleanfalseAllow the caller to interrupt the agent mid-speech
wait_for_user_responsebooleanfalsePause and wait for caller input before continuing
wait_for_user_response_timeoutnumbernullSeconds to wait for input before timing out
detect_voicemailbooleanfalseDetect and handle voicemail on outbound calls
delayed_startbooleanfalseDelay execution of this node
delayed_start_durationnumbernullDelay in seconds
add_global_promptbooleantrueMerge the globalNode prompt into this node's prompt

agentNode — data extraction#

FieldTypeDefaultDescription
extraction_enabledbooleanfalseExtract structured data from the conversation
extraction_promptstringnullCustom prompt to guide extraction
extraction_variablesarray[]Variables to extract (see below)

Extraction variable schema:

type is one of string, number, or boolean.

agentNode — tools#

FieldTypeDescription
tool_uuidsstring[]IDs of tools (HTTP API, call transfer, etc.) to attach to this node
document_uuidsstring[]IDs of knowledge base documents available to this node

trigger node#

FieldTypeDescription
trigger_pathstringUnique UUID that becomes the API trigger endpoint path

webhook node#

FieldTypeDefaultDescription
enabledbooleantrueWhether this post-call webhook is enabled
http_methodstringGET, POST, PUT, PATCH, or DELETE
endpoint_urlstringTarget URL
credential_uuidstringnullUUID of a stored auth credential
custom_headersarray[]Additional request headers [{"key": "...", "value": "..."}]
payload_templateobjectnullRequest body template (supports context variables)

qa node#

FieldTypeDefaultDescription
qa_enabledbooleantrueEnable QA analysis
qa_system_promptstringnullCustom evaluation prompt
qa_modelstringnullLLM model to use for evaluation
qa_min_call_durationinteger15Minimum call duration in seconds to run QA
qa_voicemail_callsbooleanfalseInclude voicemail calls in QA
qa_sample_rateinteger100Percentage of calls to analyse (1–100)

Edges#

Each edge connects two nodes and defines when the transition fires.

FieldTypeDescription
idstringUnique edge ID
sourcestringID of the originating node
targetstringID of the destination node
data.labelstringShort label shown in the workflow builder
data.conditionstringNatural language condition the LLM evaluates to trigger this edge
data.transition_speechstringOptional speech the agent says before transitioning

Validation rules#

  • All source and target IDs in edges must reference existing node IDs
  • All nodes except trigger, webhook, and qa must have a non-empty prompt
  • Node IDs must be unique within the workflow
  • Each workflow must have exactly one startCall or trigger node as the entry point

Minimal example#