Skip to main content
Back to how-to guides Use this pattern when an agent must stop and pass the conversation to a person.

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 write ESCALATE. 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.
  1. Checks the reason (5 to 500 characters) and the priority (low, medium, high, or critical).
  2. Selects a routing entry from the routing block.
  3. Creates a task in the human-agent queue when the platform database is available.
  4. Starts the transfer through the connection, or the voice leg transfer on a voice channel.
  5. Shows the confirmation message to the customer.
  6. Pauses the session when the block has on_human_complete rules.
A marking-only construct stops the agent but does not call a person. Use it as a stop signal. Pair it with a trigger or a flow terminal when a person must receive the conversation.

Choose a trigger type

A trigger names a condition and a reason. The WHEN 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

The routing 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

  1. The customer answers the GATHER prompt. The runtime stores dispute_amount.
  2. Before the next model turn, the runtime evaluates dispute_amount > 500. A true result matches the trigger.
  3. The runtime calls the escalation with the trigger REASON and PRIORITY. It applies any SET on the trigger first.
  4. It copies the context_for_human values for the human agent. The full payload is covered in How to package context for human escalation.
  5. It creates a task and starts the transfer through genesys with the queue and skills.
  6. 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.
  7. After a successful transfer, the platform forwards the customer messages to the human agent.
The runtime evaluates deterministic triggers before the model runs. A value that a tool writes during the turn does not fire a trigger until the next turn. The 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.
This block has no 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

Set MAX_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 the WHEN text.
The model sees 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.
The compiler rejects a list with two default entries, a default that is not last, and a prompt-only when.

Escalate from a supervisor

A supervisor can own an ESCALATE: 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 with ESCALATE. 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.
Cap the repeats of a constraint with 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

Set escalation_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.
This block is a syntax harness. In a project, a tool result writes failed_lookups, not a GATHER prompt.

Change the confirmation message

The built-in confirmation depends on the channel and includes the reason and priority. Set escalation_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.
On voice channels, the behavior setting 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 dollars to the minimal example. The trace shows a decision event escalation_trigger_check with outcome match, then escalation with priority high.
  • Test the miss. Send 200 dollars. The trace shows escalation_trigger_check with outcome skip. The agent completes with its own message.
  • Check the transfer. Look for agent_transfer_initiated with your provider name and queue. escalation_triggered shows hasAgentTransfer as true when the routing entry names a connection.
  • Check a routing list. escalation_routing_check lists each entry with match or skip. escalation_routing_no_match means no entry matched.
  • Read refusals. escalation_rejected carries a reasonCode such as ESCALATION_TRIGGER_NOT_MATCHED or ESCALATION_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.connection or the project default.
  • The queue and skills exist in the human-agent platform, and agents are staffed for them.
  • Every field in context_for_human exists in the session. A missing field appears as escalation_context_missing in the trace.
  • Every REASON is safe for the customer to read, or a custom confirmation template hides it.
  • Every flow PRIORITY is low, medium, high, or critical.
  • Every REASON is 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 voice block on each voice entry.
  • Alert on escalation_rejected, agent_transfer.transfer_failed, and escalation_routing_no_match.

Common mistakes

Troubleshooting