Skip to main content
Back to how-to guides Use this guide when you decide whether an agent should be goal-driven and flexible, step-driven and predictable, or a mix of both.

Concept

An ABL agent runs without a FLOW: block or with one. A reasoning agent has an AGENT, a GOAL, optional persona or limitations, optional tools, optional gathered fields, and completion rules. There is no FLOW:, so the reasoning layer chooses the next best action inside the boundaries you define. A FLOW-based agent adds a FLOW: block and named steps. The flow owns the conversation path. Every step must declare REASONING: false for a deterministic step or REASONING: true for a bounded reasoning area. A step with neither fails to parse. Use a reasoning agent when the work fits a business goal and the conversation can adapt. Use a flow when the order of operations, checkpoints, or troubleshooting path must be explicit. Use a workflow tool, not an agent flow, for long waits, polling, scheduled work, or multi-hour orchestration.

Decision guide

Minimal working example: reasoning agent

This example is a single agent file. It shows the shape of a reasoning agent: a goal, limits, one required field, and a completion rule. It is intentionally partial. The agent finishes as soon as it knows the policy topic. For a real outcome, add the tools or knowledge sources that answer the question, and tie the completion rule to their result.
Use this shape when there is no required path beyond collecting the information needed to answer safely. Avoid WHEN: true as a normal completion rule. It completes the agent before the customer outcome exists.

Working example: deterministic FLOW for required intake

This example is a single agent file. It collects warranty information in a fixed order, then completes only after the required fields are present.
A step with required GATHER fields stays active until those fields have values. Use this shape when the customer must not skip required fields or when operations teams need to inspect the exact path a conversation followed. Step definitions can sit at the top level, as above, or indented under FLOW:. Both layouts compile to the same flow.

Working example: bounded reasoning inside a FLOW

This example is a single agent file. The reasoning step decides whether the request is a billing or a technical issue. The rest of the process stays explicit.
Use this shape when only one part of the process needs interpretation. Keep the reasoning step narrow. Give it an exit expression and an attempt limit. The handle_unclear step is the failure path. Replace its text with your own escalation or follow-up step.

How a reasoning step exits

A REASONING: true step runs until one of these events happens. Write EXIT_WHEN as an expression over session values, such as support_path IS SET or response_presented == true. The reasoning model writes the values the expression reads, or a GATHER field in the same step collects them. Do not write a plain-language phrase. The runtime does not judge phrases, and a quoted phrase counts as true, so the step exits after its first pass. Give each reasoning step its own GOAL. The step uses that goal, not the agent goal.

Verification

  1. Validate the agent file.
  2. Run a sample utterance for the reasoning-agent example: “Can you explain the parental leave policy?”
  3. Run the warranty flow with a serial number and issue description. Confirm the prompts happen in order and completion waits until both fields are present.
  4. Run the bounded-reasoning flow with “I need help with a billing issue.” Confirm the step sets support_path and the flow asks for account_id.
  5. Run the same flow with three replies that never state a path, such as “hello”. Confirm the flow reaches handle_unclear.
  6. Inspect the trace for the active step name, reasoning_zone_enter, reasoning_zone_exit, flow_step_attempts_exhausted, gathered fields, and the final completion response.

Production readiness checklist

  • Use a reasoning agent only when goal, limitations, tools, and completion rules are enough to bound behavior.
  • Use flow steps for required collection, compliance prompts, or processes support teams must inspect.
  • Give every REASONING: true step a GOAL, an EXIT_WHEN expression on a value the step sets, and a MAX_ATTEMPTS plus ON_EXHAUSTED failure path.
  • Point ON_EXHAUSTED at a step that escalates or hands the customer to a person.
  • Make every required gathered field feed completion, memory, a tool call, handoff, delegate, or another known consumer.
  • Move long waits, polling, scheduled callbacks, and multi-hour orchestration into a workflow tool.

Common mistakes

Troubleshooting