Skip to main content

Salesforce Agent Availability Flow

Overview

The Check Agent Availability for Routing flow determines whether a live agent is available before routing an incoming chat session. If an agent is available, the conversation is routed to the chat queue. If no agent is available, the flow records the reason and ends gracefully without routing.


Flow Structure

The flow consists of the following elements:

Start
└── agentAvailability (Action: Check Availability for Routing)
└── agent_Availability (Decision)
├── [check agent availability] → route to chat queue (Route Work) → End
└── [Default Outcome] → Reason for Not Routing Assignment (Assignment) → End

Flow Elements

1. agentAvailability — Action

PropertyValue
TypeAction
LabelagentAvailability
DescriptionCheck Availability for Routing

Calls the Salesforce built-in action to check whether any agents are currently available in the configured queue or skill set.


2. agent_Availability — Decision

PropertyValue
TypeDecision
Labelagent_Availability

Evaluates the result from the availability check and branches accordingly.

OutcomeConditionNext Step
check agent availabilityAgent is availableroute to chat queue
Default OutcomeNo agent availableReason for Not Routing Assignment

3. route to chat queue — Route Work

PropertyValue
TypeRoute Work
Labelroute to chat queue

Routes the incoming chat session to the appropriate chat queue when an agent is available. After routing, the flow ends.


4. Reason for Not Routing Assignment — Assignment

PropertyValue
TypeAssignment
LabelReason for Not Routing Assignment

Sets a variable to capture the reason why the session was not routed (e.g., no agents available). This value can be used downstream for reporting, logging, or displaying a fallback message to the user. After the assignment, the flow ends.


How to Create This Flow in Salesforce

Prerequisites

  • Salesforce org with Omni-Channel and Messaging (or Chat) enabled
  • An existing chat queue configured in Omni-Channel setup
  • Appropriate permissions to create and activate flows

Step 1: Open Flow Builder

  1. In Salesforce, go to Setup → search for Flows → click New Flow.
  2. Select Omni-Channel Flow as the flow type.
  3. Click Create.

Step 2: Add the Agent Availability Action

  1. Click the + icon on the canvas to add the first element.
  2. Select Action.
  3. Search for and select Check Agent Availability for Routing.
  4. Set the Label to agentAvailability.
  5. Configure the input parameters (queue, skill, or channel) as required by your org setup.
  6. Click Done.

Check Agent Avilability Routing


Step 3: Add the Decision Element

  1. Click + below the action to add the next element.
  2. Select Decision.
  3. Set the Label to agent_Availability.
  4. Add an outcome:
    • Label: check agent availability
    • Condition: Set the condition to evaluate whether the availability result from the previous action is true (agent available).
  5. Leave the Default Outcome label as-is or rename it descriptively.
  6. Click Done.

Decision Node

Step 4: Add Route Work (Agent Available Path)

  1. Click + on the check agent availability branch.
  2. Select Route Work.
  3. Set the Label to route to chat queue.
  4. Configure the routing destination to your target chat queue.
  5. Click Done.

Route to work

Step 5: Add Assignment (No Agent Path)

  1. Click + on the Default Outcome branch.
  2. Select Assignment.
  3. Set the Label to Reason for Not Routing Assignment.
  4. Add a variable assignment to store the no-agent reason, for example:
    • Variable: {!reasonNotRouted}
    • Value: No agents available
  5. Click Done.

Reason for Not routing

Step 6: Save and Activate

  1. Click Save and give the flow a name, e.g., Check Agent Availability for Routing.
  2. Click Save As New Version if updating an existing flow.
  3. Click Activate to make the flow live.
tip

Test the flow using the Debug button before activating to verify both branches behave as expected.