Concept
Escalation moves a conversation from an agent to a human agent. Escalate when the agent cannot or must not continue. Typical reasons are a request above the agent limit, a customer who asks for a person, repeated failure to collect data, and a policy that requires review. Pick the route that fits the situation.Which ESCALATE constructs reach a person
ABL offers several ways to writeESCALATE. They do not behave the same. Only some of them start a transfer.
A full escalation runs these steps. Voice channels differ in the transfer details.
- Checks the reason (5 to 500 characters) and the priority (
low,medium,high, orcritical). - Selects a routing entry from the
routingblock. - Creates a task in the human-agent queue when the platform database is available.
- Starts the transfer through the connection, or the voice leg transfer on a voice channel.
- Shows the confirmation message to the customer.
- Pauses the session when the block has
on_human_completerules.
Choose a trigger type
A trigger names a condition and a reason. TheWHEN text decides who evaluates it.
A condition counts as deterministic when it has a comparison or boolean operator,
IS SET or IS NOT SET, the literal true, false, or *, or a has( or abl. function call. Free text that contains the lowercase word in also counts as deterministic. Keep prompt-only text free of operators and the word in.
Write the REASON of a prompt-only trigger as the instruction the model follows. Write every REASON so a customer can read it. The built-in confirmation message includes the reason and the priority.
If an agent has a deterministic trigger and none matches, the runtime refuses the model’s escalate action. Do not mix a deterministic trigger with a prompt-only trigger when you rely on the model to escalate.
Route the escalation
Therouting block says where the conversation goes.
routing takes a single mapping or an ordered list of entries. An entry can have an id and a deterministic when. The first matching entry wins. One entry without a when is the default and must come last.
Condition values for a routing when include system.channel, system.channelType, system.isVoice, system.locale, system.language, and system.triggerPriority.
What happens when no human agent is reachable
A machine-only agent that prints text and has no working connection does not reach a person.
Minimal working example
Billing_Agent collects the disputed amount. A dispute above 500 dollars goes to a human agent. A smaller dispute completes in the agent.
genesys is a project-local assumption. It names a human-agent connection in your project. The queue billing_disputes and the skill billing must exist in that platform. dispute_amount comes from the GATHER field.
How it works
- The customer answers the
GATHERprompt. The runtime storesdispute_amount. - Before the next model turn, the runtime evaluates
dispute_amount > 500. A true result matches the trigger. - The runtime calls the escalation with the trigger
REASONandPRIORITY. It applies anySETon the trigger first. - It copies the
context_for_humanvalues for the human agent. The full payload is covered in How to package context for human escalation. - It creates a task and starts the transfer through
genesyswith the queue and skills. - The customer sees a confirmation with the reason and priority. On a voice channel it reads
Escalated to human agent. Reason: Dispute above the agent limit. Priority: high. - After a successful transfer, the platform forwards the customer messages to the human agent.
EXECUTION setting in Re-check triggers after tool calls changes this.
When the block has on_human_complete rules, the runtime pauses the session. The customer receives a waiting message until a human resolves the task. See How to resume after a child agent or human agent completes.
Common variations
Escalate from a flow step
Use a flow terminal when the escalation belongs to a step.THEN: ESCALATE WITH REASON "..." PRIORITY level sets the reason and priority. The priority must be low, medium, high, or critical.
triggers. The flow terminal needs only the ESCALATE: block with routing. Without the block, the terminal marks the session escalated and nobody receives it.
Escalate after repeated failed attempts
SetMAX_ATTEMPTS and ON_EXHAUSTED on a flow step. After the last failed attempt, the step takes the ON_EXHAUSTED target.
Let the model decide
Use a prompt-only trigger for judgment calls such as frustration. The model decides. The runtime never evaluates theWHEN text.
Customer is upset or repeatedly asks for a person (priority: high) and a rule to help the customer at least once first. A model that escalates passes its own reason, which must be 5 to 500 characters.
Route by channel and priority
Use a routing list when voice and chat need different destinations. Order the entries from most specific to the default. The default entry comes last.claims_sip is a project-local SIP transfer destination. claim_amount comes from the GATHER field.
when.
Escalate from a supervisor
A supervisor can own anESCALATE: block. The supervisor model sees the same escalation rule. A specialist reads its own block, so give each specialist that needs a person its own ESCALATE:.
Billing_Agent is a stand-in for your specialist.
Stop on a constraint
A constraint can stop an agent withESCALATE. This marks the session escalated and shows the confirmation. It does not start a transfer. Use it for a hard stop, and add a trigger when a person must take over.
MAX_REPEATS. After the cap, ON_EXHAUSTED runs. Without an ON_EXHAUSTED, the default is ESCALATE, which is also marking-only.
Re-check triggers after tool calls
Setescalation_recheck_after_tools when a tool result can make a trigger true in the middle of a turn. The runtime then evaluates the triggers again after each tool result. A tool ON_RESULT mapping must write the field that the trigger reads.
failed_lookups, not a GATHER prompt.
Change the confirmation message
The built-in confirmation depends on the channel and includes the reason and priority. Setescalation_format in MESSAGES to replace it. The template accepts {{reason}}, {{priority}}, {{agent.name}}, {{channel}}, and {{escalated_at}}. A Localization asset or a project Escalation Template for the channel takes precedence over escalation_format.
speaking.handoffs.human: silent removes the spoken confirmation for trigger and flow escalations.
Verification
- Compile the project and fix every error and warning on the
ESCALATE:block. - Test the match. Send
My disputed charge is 750 dollarsto the minimal example. The trace shows a decision eventescalation_trigger_checkwith outcomematch, thenescalationwith priorityhigh. - Test the miss. Send
200 dollars. The trace showsescalation_trigger_checkwith outcomeskip. The agent completes with its own message. - Check the transfer. Look for
agent_transfer_initiatedwith your provider name and queue.escalation_triggeredshowshasAgentTransferastruewhen the routing entry names a connection. - Check a routing list.
escalation_routing_checklists each entry withmatchorskip.escalation_routing_no_matchmeans no entry matched. - Read refusals.
escalation_rejectedcarries areasonCodesuch asESCALATION_TRIGGER_NOT_MATCHEDorESCALATION_ALREADY_IN_PROGRESS. - Test a prompt-only trigger with a short, calm message. The agent must answer first. Then repeat the request and confirm the escalation.
- Read traces with How to debug routing decisions in traces.
Production readiness checklist
- The connection exists, is active, and is the one in
routing.connectionor the project default. - The queue and skills exist in the human-agent platform, and agents are staffed for them.
- Every field in
context_for_humanexists in the session. A missing field appears asescalation_context_missingin the trace. - Every
REASONis safe for the customer to read, or a custom confirmation template hides it. - Every flow
PRIORITYislow,medium,high, orcritical. - Every
REASONis at least 5 characters. - A fallback exists for a failed transfer. The agent keeps the conversation, so its next turn must help.
- Test a transfer outside staffed hours, a failed connection, and a routing list with no match.
- Test voice and chat separately. Confirm the
voiceblock on each voice entry. - Alert on
escalation_rejected,agent_transfer.transfer_failed, andescalation_routing_no_match.