FLOW: section adds structured execution steps to any agent. It defines a step-by-step execution graph where each step declares actions (collect information, call tools, respond, branch) and transitions to other steps.
Agents operate in reasoning mode by default, where the LLM autonomously decides actions based on the goal. Adding a FLOW: section gives an agent a structured step graph, with each step declaring whether it uses LLM reasoning or deterministic execution via the REASONING: toggle.
Flow structure
Basic syntax
Entry point
Theentry_point: property declares which step the flow begins at:
If omitted, execution starts at the first step listed in the
steps array.
Step list
Thesteps: array declares the ordered list of step names. While steps can transition to any other step (not just the next in order), the list establishes the canonical ordering:
Step definitions
Each step is defined as a named block underFLOW: with its properties indented:
Per-step REASONING toggle
Every step in aFLOW: section must declare REASONING: true or REASONING: false. This controls whether the step uses LLM reasoning or deterministic execution.
Reasoning step properties
WhenREASONING: true, the following additional properties are available:
Validation rules:
- A step with
REASONING: truemust have either a step-levelGOALor an agent-levelGOAL:defined. - A step with
REASONING: falseshould not have aGOAL(it has no effect on deterministic steps). - A step with
REASONING: falseshould not haveAVAILABLE_TOOLS(useCALLto invoke tools deterministically).
Entry guards
TheWHEN: property on a step defines a condition that must be true for the step to execute. If the condition is false, the step is skipped:
Attempt limiting
Steps can limit the number of times they execute (useful for retry loops):Step actions
SAY / RESPOND
TheRESPOND: action sends a message to the user. It supports template interpolation with {{variable}} syntax:
PRESENT
ThePRESENT: action displays a formatted presentation before collection. It is used alongside GATHER: to show the user what has been collected so far:
GATHER in flow steps
Within a flow step,GATHER: uses a list syntax different from the top-level GATHER: section:
Multi-field collection
Collect multiple fields in a single step using theFIELDS: sub-block:
Flow gather field properties
Each field in a flowGATHER: supports these properties:
Flow gather fields also accept the same additional properties as top-level
GATHER fields:
entity_ref, options, message_key,
satisfied_by, validation_process, retry_prompt, max_retries, preferences, sensitive,
sensitive_display, mask_config, pii_type, transient, extraction_pattern,
extraction_group, and semantics. In addition, a flow gather field may carry rich_content
format variants for its prompt. Note that flow gather uses validation: where the top-level
section uses validate:.GATHER block properties
AlongsideFIELDS:, a flow GATHER: block accepts these block-level properties:
The
STRATEGY: value controls the collection approach:
CORRECTIONS
WhenCORRECTIONS: true, the user can naturally correct previously collected values without restarting the step:
COMPLETE_WHEN
TheCOMPLETE_WHEN: condition specifies when the gather step is considered complete:
CALL…WITH…AS
TheCALL: action invokes a tool. Use WITH: to pass parameters and AS: to bind the result to a variable:
WITH parameters
TheWITH: block maps tool parameter names to values or variable references:
- Variable references:
amount(resolves the session variableamount) - Literal strings:
"domestic" - Expressions:
COALESCE(reference, "")
SET
TheSET: action assigns values to session variables:
variable = expression syntax. The expression is resolved at execution time and can reference:
- Literal values:
"pending",0,true,false - Variable references:
acctResult.balance - Function calls:
FORMAT_CURRENCY(amount, "USD"),COALESCE(value, "default"),ADD(a, b),SUB(a, b),ROUND(n, decimals) - Unique ID generation:
UNIQUE_ID(12) - Current timestamp:
NOW()
CHECK
TheCHECK: action evaluates a condition. If the condition is false, execution transitions to the ON_FAIL: step:
CLEAR
TheCLEAR: action removes variables from the session context:
TRANSFORM
TheTRANSFORM: action filters, maps, sorts, and limits an array from the session context:
LOG
TheLOG: action emits a trace-only diagnostic (not shown to the user). Use the inline or block form:
AWAIT_ATTACHMENT
TheAWAIT_ATTACHMENT: action pauses the step until the user uploads a file.
MESSAGE_KEY and BEHAVIOR
Two additional step-level properties:MESSAGE_KEY:— a locale catalog key used to localize the step’sRESPOND:message.BEHAVIOR:— free-form guidance text appended to the step’s reasoning goal (a convenience alias that folds intoGOAL).
Branching and control flow
THEN / ON_FAIL
The most basic branching:THEN: specifies the next step on success, and ON_FAIL: specifies the step on failure:
ON_FAIL: also accepts a structured block for recovery flows — COLLECT: (fields to re-collect),
GOTO: (step), RETRY: true, RESPOND:, and THEN::
ON_RESULT
ON_RESULT: provides multi-way branching based on the result of a CALL: action. Each branch has an IF: condition, optional actions, and a THEN: transition:
ON_RESULT branch properties
The
ELSE branch (a branch with no IF condition) matches when no other condition is true.
ON_SUCCESS / ON_FAIL
An alternative toON_RESULT: for simpler success/failure branching:
ON_SUCCESS: and ON_FAIL: support conditional branches:
ON_INPUT
ON_INPUT: provides branching based on user input, typically used after a GATHER: action:
Digressions
Digressions are intent-based escapes that can interrupt the current step. They match user intent patterns and respond accordingly:Digression properties
When
RESUME: true, the user returns to the interrupted step after the digression response. When GOTO: is specified, the flow transitions to that step instead. RESUME, GOTO, and HANDOFF are terminal.
For multiple ordered actions, use the canonical
DO: block instead of flat keys. Each list item is
an action (RESPOND, SET, CLEAR, CALL, HANDOFF, DELEGATE, GOTO, RESUME), and
HANDOFF/DELEGATE may carry RETURN: and ON_RETURN: (with MAP:). Mixing flat keys with a
DO: block is discouraged.Global digressions
Digressions declared at the flow level (underglobal_digressions:) are available at every step:
Sub-intents
Sub-intents are scoped intents valid only within a specific step. They handle step-specific user requests like corrections or clarifications:Sub-intent properties
Interactive actions
Flow steps can present interactive UI elements (buttons, selects, inputs) to the user. These are attached toRESPOND: messages and handled with ON_ACTION: callbacks.
Action elements
Interactive actions are defined in anACTIONS: block within a step:
Element types
Buttons
Select (dropdown)
Input fields
Action element properties
Form submission
When a step containsinput type elements, you can configure a form submission button:
ACTIONS: block also accepts an optional RENDER_ID: to give the whole action set a stable
identifier for rendering/telemetry.
ON_ACTION callbacks
TheON_ACTION: block defines handlers for user interactions with action elements:
ON_ACTION handler properties
For multiple ordered actions in one handler, use a canonical
DO: block whose list items are
actions (SET, CLEAR, LOG, RESPOND, CALL, GOTO/TRANSITION/THEN, HANDOFF,
DELEGATE, COMPLETE).Rich content
Steps can include rich content in multiple formats alongsideRESPOND: messages. The runtime selects the appropriate format based on the channel. In the .agent.abl format the block keyword is FORMATS:; the .agent.yaml format also accepts rich_content / formats.
Rich content format properties
The runtime recognizes these format keys. In addition to the messaging formats, several structured template types are available (see Rich Content & Expressions for their schemas):Voice configuration
Steps can include voice-specific overrides for text-to-speech engines:Step-level error handling
Steps can define local error handlers that override agent-levelON_ERROR: handlers:
tool_timeout, tool_error, invalid_input, validation_error,
api_error, and unknown_error (the type is not restricted to a fixed set).
Step ON_ERROR handler properties
Complete example
Related
- Language overview — syntax rules and auto-detection
- Tools — tool definitions used by
CALLactions - GATHER — top-level gather field definitions
- Agent declaration — GOAL used by
REASONING: truesteps,max_flow_iterationsand model settings