# 2. @utils.escalate action - triggers the transfer
# 3. escalation topic - handles the handoff flow
#
# ★ Prerequisites:
# - Omni-Channel configured in Salesforce
# - Queue/Skill created for routing
# - Messaging channel active (Enhanced Chat, etc.)
#
# This is a COMPLETE template - customize for your use case
system:
instructions: "You are a helpful customer service agent. Be professional, friendly, and helpful. If you cannot resolve an issue or the customer requests a human, transfer them to a live agent."
messages:
welcome: "Hello! I'm here to help you today. What can I assist you with?"
error: "I apologize, but I encountered an issue. Let me connect you with a human agent."
config:
agent_name: "{{AGENT_NAME}}"
default_agent_user: "{{AGENT_USER_EMAIL}}"
agent_label: "{{AGENT_LABEL}}"
description: "Customer service agent with human escalation capability"
variables:
# Required linked variables for messaging context
EndUserId: linked string
source: @MessagingSession.MessagingEndUserId
description: "Messaging End User ID"
RoutableId: linked string
source: @MessagingSession.Id
description: "Messaging Session ID"
ContactId: linked string
source: @MessagingEndUser.ContactId
description: "Contact ID"
# Escalation tracking variables
escalation_requested: mutable boolean = False
description: "Whether customer requested human agent"
escalation_reason: mutable string
description: "Reason for escalation"
# ⚠️ Use 'number' not 'integer' - integer type is NOT supported in AiAuthoringBundle
attempts_before_escalation: mutable number = 0
description: "Number of attempts before escalating"
language:
default_locale: "en_US"
additional_locales: ""
all_additional_locales: False
# ★ CONNECTION BLOCK - Required for @utils.escalate to work
# This defines where escalated conversations are routed
# Use singular 'connection' for one channel, plural 'connections' for multiple
connection messaging:
# ⚠️ IMPORTANT: Only "OmniChannelFlow" is supported (not "queue", "skill", or "agent")
outbound_route_type: "OmniChannelFlow"
# API name of your Omni-Channel Flow
outbound_route_name: "{{OMNI_CHANNEL_FLOW_NAME}}"
# ⚠️ REQUIRED: escalation_message must be included when connection block is present
escalation_message: "Transferring you to a human agent now..."
# Optional: Allow agent to adapt responses during escalation
adaptive_response_allowed: True
# ★ MULTI-CHANNEL EXAMPLE (use 'connections' plural for multiple channels)
# connections:
# messaging:
# outbound_route_type: "OmniChannelFlow"
# outbound_route_name: "Chat_Support_Flow"
# escalation_message: "Connecting you to chat support..."
# adaptive_response_allowed: True
# telephony:
# outbound_route_type: "OmniChannelFlow"
# outbound_route_name: "Phone_Support_Flow"
# escalation_message: "Transferring to phone support..."
# adaptive_response_allowed: False
# Entry point
start_agent topic_selector:
label: "Topic Selector"
description: "Routes users to appropriate topics based on intent"
reasoning:
instructions: ->
| Greet the customer and determine their needs.
| If they ask for a human or live agent, route to escalation.