ESCALATE when an agent cannot safely or confidently continue execution and requires human intervention. Escalation transfers the conversation to a human operator or handling system, ensuring continuity while preventing incorrect or risky automated responses.
Unlike agent-to-agent routing (HANDOFF / DELEGATE), escalation is specifically designed for human involvement and should not be modeled as a handoff to a human agent.
When to Use Escalation
Typical scenarios include:- User frustration
- Customer complaints
- Policy validation requirements
- System failures
- Repeated routing failures
- High-risk or high-value operations
How Escalation Works
- Agent evaluates escalation triggers.
- When a trigger condition is met:
- A new task is created in the Inbox for a human agent to review and proceed.
- Agent execution is suspended.
- A human agent reviews and completes the task.
- After completion:
- The system executes configured post-completion actions.
- The workflow may resume, transfer, or end.
DSL Configuration
Trigger Properties
| Property | Type | Required | Description |
|---|---|---|---|
| WHEN | string | Yes | Condition that triggers escalation. |
| REASON | string | Yes | Human-readable reason for the escalation. |
| PRIORITY | string | Yes | Priority level: low, medium, high, or critical. |
| TAGS | string[] | No | Tags for routing and categorization in the human agent queue. |
Priority Levels
| Level | Use case |
|---|---|
| low | Non-urgent requests (e.g., general feedback). |
| medium | Standard requests (e.g., user requests human assistance). |
| high | Urgent issues (e.g., repeated failures, outages). |
| critical | Immediate attention required (e.g., compliance violations, fraud). |
Context for Human
Thecontext_for_human block defines what data is sent to the human agent. This ensures the human agent has full context without asking the user to repeat information.
Structured Context
Routing Configuration
Controls how escalation is routed to the human system.| Property | Type | Required | Description |
|---|---|---|---|
| queue | string | No | Target queue in the human agent system. |
| skill_tags | string[] | No | Required skills for the human agent. |
| priority_boost | number | No | Additional priority applied to the task. |
Post-Completion Behavior
Defines what happens after the human agent completes the task.| Action | Behavior |
|---|---|
| COMPLETE | End the workflow |
| HANDOFF | Transfer back to an agent |
| CONTINUE | Resume the current agent |
Examples
Escalation from Supervisor
Escalation via ON_ERROR
THEN: ESCALATE triggers the escalation flow after retry attempts are exhausted.
Escalation vs Handoff
| Aspect | ESCALATE | HANDOFF |
|---|---|---|
| Target | Human operator | Another agent |
| Visibility | User interacts with human | User interacts with agent |
| Use case | Failure / escalation scenarios | Multi-agent routing |
| Control flow | Suspends agent execution | Transfers execution |
Troubleshooting
| Issue | Resolution |
|---|---|
| Escalation never triggers | Verify the WHEN condition references variables that are actually set during the conversation. Test with explicit values. |
| Human agent lacks context | Include conversation_history in context_for_human. List all relevant session variables-IDs, collected data and current state. |
| Conversation stalls after human completes | Define on_human_complete handlers for all possible human outcomes (resolved, needs_agent, needs_followup). |