Smart Routing in Agentforce: Escalate Conversations Only When Agents Are Available
Published on: 7/8/2025

Step 1: Create a Custom Action to Check Agent Availability
-
Navigate to Agentforce Asset > Create new action via flow
-
Create a Custom Action named
CheckAgentAvailability
(an OOTB action already exists and you can use that one)) -
This action should:
-
Call the Agent Availability Action
-
Return the number of available agents
-
The response should ideally include a count (e.g., availableAgentCount
) that can be used in your escalation logic.
Step 2: Configure the Escalation Topic
- Open the Escalation Topic in Agentforce.
- Add a instuction to call the Agent action before routing to the outbound omni flow.
3. Add an Action block to call the CheckAgentAvailability
custom action(flow).
4. Store the returned value in a variable, e.g., agentCount
.
Step 3: Use Conditional Logic for Routing
-
Add a Condition in instruction in the Escaltion Topic.
Logic:
-
If
agentCount > 0
→ Proceed to the Transfer to Agent step or Route to Queue. -
Else
→ Show a message like:"It looks like no agents are available right now. Would you like us to create a case so someone can follow up with you later?"
-
Result
With this setup:
-
If agents are online, the chat is escalated normally.
-
If no agents are available, customers are notified and optionally offered a fallback, like case creation. You can use the context/custom variable to create case for the customer.
This ensures that customers aren’t left waiting in limbo and helps manage expectations transparently.