Skip to main content
Back to how-to guides Use this pattern when a conversation needs both flexible judgment and predictable execution. A good enterprise flow has one or two places where the agent reasons, such as judging urgency or explaining a result. Deterministic steps surround them: they collect data, set variables, call tools, branch, and finish.

Concept

ABL sets the execution style per step inside FLOW. Every step declares REASONING: true or REASONING: false. There is no default.
  • REASONING: true hands the step to the model. The step GOAL is the model’s objective for that step.
  • REASONING: false runs the step as scripted. The step runs the actions it declares: GATHER, SET, CALL, RESPOND, ON_INPUT, ON_RESULT, and THEN.
Use reasoning steps for judgment: interpreting messy user language, choosing a tone, deciding whether a situation is urgent, or explaining a result. Use deterministic steps for control: collecting required fields, setting session values, invoking tools, branching on known outputs, and ending the flow. The agent-level MODE: line is removed. A MODE: line causes error E560. Declare REASONING on each step instead.

Validation rules for step modes

Minimal working example

How it works

The first step is deterministic. The platform collects policy_id and claim_type before it does anything else. The second step is a reasoning step because urgency is not a clean list of values. The user may describe an accident, water damage, loss, injury, or uncertainty in their own words. The third step is deterministic. It builds claim_summary from known values. The last step is a reasoning step. It turns the known state into a user-facing explanation.

When a reasoning step ends

A reasoning step runs as soon as the flow reaches it, when the step has a GOAL. The model speaks first. In the minimal example, assess_urgency has THEN only. The model asks its clarification question, if it asks one, and the flow moves on without waiting for the answer. Use EXIT_WHEN when the step must wait. See Hold a reasoning step until a decision is recorded.

Reasoning step settings

The structure makes the flow easier to test. You can check that required fields exist before assess_urgency, that claim_summary exists before explain_next_steps, and that completion follows the explanation step.

Common variations

Hold a reasoning step until a decision is recorded

Use EXIT_WHEN when the model must reach a result before the flow continues. The model records the result in a session variable. The EXIT_WHEN condition reads that variable.
Here, urgency is a session variable that the model writes. The default_urgency step sets it when the model cannot decide in three turns. The fallback keeps the flow from stalling. The runtime refuses model writes to fields declared READONLY: true. Do not use a READONLY field as an EXIT_WHEN fact that the model must write.

Reason first, then collect

Start with a reasoning step when users open with broad language, such as “I need help with something that happened yesterday.” The reasoning step decides what to ask next. Then the flow moves to deterministic collection. Add EXIT_WHEN so the reasoning step waits for the user.

Collect first, then reason

Start with deterministic collection when compliance, eligibility, identity, or required intake fields must exist before any judgment is useful.

Reason after a tool result

Use a deterministic CALL with ON_SUCCESS and ON_FAIL to fetch known data. Then use a reasoning step to explain the result. This keeps tool execution predictable and lets the final response adapt to the user. The get_claim_status tool in this example is a project-local assumption. Bind it to your own claim system in the project.

Verification

  1. Validate the project. Confirm every FLOW step declares REASONING: true or REASONING: false, and no E200, E201, W200, or W201 appears.
  2. Test a routine claim, an urgent claim, and an unclear claim.
  3. Confirm collect_claim gathers both fields before assess_urgency.
  4. Confirm prepare_summary sets claim_summary before explain_next_steps.
  5. For the EXIT_WHEN variation, answer the clarification question and confirm the flow moves to explain_next_steps. Then give no usable answer three times and confirm the flow goes to default_urgency.
  6. Inspect the trace. Look for flow_step_enter, flow_step_exit, and flow_transition events to see the step order. Look for reasoning_zone_enter and reasoning_zone_exit events to see where the model ran and why the step exited.

Production readiness checklist

  • Keep deterministic steps free of goals and available-tool lists.
  • Keep each reasoning goal narrow, so the model knows the decision or explanation it owns.
  • Set EXIT_WHEN on every reasoning step that must wait for the user.
  • Add MAX_ATTEMPTS and ON_EXHAUSTED to every EXIT_WHEN step.
  • Add fallback paths for unclear input, failed tool calls, and exhausted attempts.
  • Use deterministic steps for required data, compliance checks, and actions with side effects.
  • Monitor traces for loops, skipped steps, and repeated clarification turns.

Common mistakes

Troubleshooting