---
schema_version: "1"
id: 9a7e2bb6ea101e59ef95980c8aa80fee8c6ff1e6070c5bb3212657692b6313ff
title: Make Smarter Routing Decisions by Checking Service Rep Availability
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/omnichannel_check_availability_for_routing.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.omnichannel_check_availability_for_routing.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: efa5407da4d82174b0ccb55cf8c33b05bb71dee03ec38101acb8c1a0ddd24cfc
description: Optimize routing by using information collected about your organization’s capacity to handle new work requests. Add the Check Availability for Routing action to an Omni-Channel flow to determine service rep availability and estimated wait time. This action can return the number of online service reps and number of work items waiting to be picked up given the specified routing requirements, including routing type and parameters. It can also estimate how long the customer has to wait before they reach a service rep. You can then build routing logic based on the results. For example, if the service rep has more than five backlogged work items in their queue, you can route work to another queue instead.
products:
  - Service Cloud
release: "264"
---
# Make Smarter Routing Decisions by Checking Service Rep Availability

Optimize routing by using information collected about your organization’s capacity to handle new work requests. Add the Check Availability for Routing action to an Omni-Channel flow to determine service rep availability and estimated wait time. This action can return the number of online service reps and number of work items waiting to be picked up given the specified routing requirements, including routing type and parameters. It can also estimate how long the customer has to wait before they reach a service rep. You can then build routing logic based on the results. For example, if the service rep has more than five backlogged work items in their queue, you can route work to another queue instead.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small "><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.service_editions_reference.htm&amp;language=en_US" target="_blank">View supported editions</a>.</td></tr></tbody></table>

1. In the Omni-Channel flow, click **+**, and select **Check Availability for Routing**.
2. Give the action a label, API name, and, optionally, a description.
3. Select the service channel.
4. In the Check Availability For field, select where to check.
    1. To check availability when you route to a queue, select **Queue**, select the queue or variable that stores the queue, and select one of these Return Output options.
        
         
        | Option | Description |
        | --- | --- |
        | **Number of online agents and queued work items** | Returns the number of reps who are online and the number of work items in the queue. If you don't select any option, this is the default. |
        | **Estimated wait time** | Returns the estimated wait time. |
        | **Return all** | Returns the number of reps who are online, the number of work items in the queue, and the estimated wait time. |
    2. To check availability when you route to a service rep, select **Agent**, and then select the service rep or variable that stores the service rep.
    3. To check availability when you route to a skill, select **Skills**, and then select one of these options.
        
         
        | Option | Description |
        | --- | --- |
        | **Define Skill Requirements** | Use to select requirements from an [Add Skill Requirement](https://help.salesforce.com/s/articleView?id=service.omnichannel_add_skill_requirement.htm&type=5&language=en_US) flow action. |
        | **Run Skills-Based Routing Rules** | Use to select predefined [skills-based rules](https://help.salesforce.com/s/articleView?id=service.omnichannel_attribute_based_routing.htm&type=5&language=en_US). This option requires that you also select the [recordId variable](https://help.salesforce.com/s/articleView?id=omnichannel_create_recordid.htm&type=5&language=en_US) in the Record ID field, which stores the ID of the work record to be routed. Omni-Channel retrieves the rules assigned to the associated work record. |
        | **Both** | Use to select predefined [skills-based rules](https://help.salesforce.com/s/articleView?id=service.omnichannel_attribute_based_routing.htm&type=5&language=en_US) and requirements from an [Add Skill Requirement](https://help.salesforce.com/s/articleView?id=service.omnichannel_add_skill_requirement.htm&type=5&language=en_US) flow action. To select predefined skills-based rules, select the [recordId variable](https://help.salesforce.com/s/articleView?id=omnichannel_create_recordid.htm&type=5&language=en_US) in the Record ID field, which stores the ID of the work record to be routed. Omni-Channel retrieves the rules assigned to the associated work record. |
5. Optionally, to assign the output of this flow action to variables so they can also be used downstream in the Omni-Channel flow, expand the Show Advanced Options section, select **Manually assign variables**, and then select the variable for each output.
    
    The action can store these output values. <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:30.03003003003003%">
              <col style="width:69.96996996996997%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d118900e270">Output value</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d118900e273">Description</th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Output value" class="slds-cell-wrap" style="vertical-align:top;" headers="d118900e270 ">Estimated Wait Time (in seconds)</td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d118900e273 ">
                  <p>The action returns the estimated wait time (in seconds) when routing work to
                    a queue or skill given the specified routing parameters. For example, if you
                    route work to a queue, this parameter shows the estimated time that the work
                    can remain in the queue before a rep picks it up.</p>
                  <p>Omni-Channel calculates estimated wait time based on the last 1-10 work items
                    that were accepted during the last 10 minutes. If no work items were accepted
                    in the last 10 minutes, the Check Availability for Routing action returns -1.
                    For calculation details, see <a href="https://help.salesforce.com/s/articleView?id=003817179&amp;type=1&amp;language=en_US" target="_blank">Knowledge Article: Estimated Wait Time
                      Calculation When Routing Work with Omni-Channel</a>.</p>
                  <p style="margin-bottom:0;">Wait times are calculated based on primary (not interruptible) work items in
                    the queue. Interruptible work isn’t included in the calculation.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Output value" class="slds-cell-wrap" style="vertical-align:top;" headers="d118900e270 ">Number of Online Agents</td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d118900e273 ">The action returns the number of service reps who are online but not
                  necessarily available to accept more work—they could be working at capacity. If
                  you route to a service rep, this value is 0 (the service rep is offline) or 1
                  (the service rep is online). If you route to a queue, this value is the number
                  of online service reps assigned to that queue. If you route to a skill, this
                  value is the number of online service reps who have the specified
                  skillset.</td>

              </tr>
              <tr class="">
                <td data-label="Output value" class="slds-cell-wrap" style="vertical-align:top;" headers="d118900e270 ">Number of Queued Work Items</td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d118900e273 ">
                  <p>The action returns the number of items waiting to be picked up, which
                    excludes items assigned to or accepted by service reps. If you route to a
                    service rep, this value is the number of PSRs directly assigned to the service
                    rep without a fallback queue. If you route to a queue, this value is the number
                    of PSRs assigned to the queue, including PSRs assigned to a specific service rep
                    with this queue as the fallback queue. If you route to skills, this value is the
                    number of PSRs that share the exact same set of mandatory skill requirements,
                    both skill and skill level, used in the action.</p>
                  <p style="margin-bottom:0;">Queue size is calculated based
                    on primary (not interruptible) work items in the queue. Interruptible work
                    isn’t included in the calculation.</p>
                </td>

              </tr>
            </tbody>
          </table>
    
    ![The Check Availability for Routing action routes to a skills requirements list and writes the results to variables.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support-264-0-0-production-enus/dd14551c-a772-4db6-9a1d-d84df8df2980/support/images/omnichannel/omni_flow_action_check_availability.png)

To make a routing decision based on the results of this action, add a Decision element to the Omni-Channel flow. In the Decision element, define the expected routing for different conditions. For instance, if at least one service rep is online and the queue size is less than or equal to 10, route cases to the queue using a Route Work action.

![The Omni-Channel flow contains the Check Availability for Routing action and then a decision tree.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support-264-0-0-production-enus/dd14551c-a772-4db6-9a1d-d84df8df2980/support/images/omnichannel/check_availability_action.png)

To route work based on the estimated wait time, output the time in a Check Availability for Routing action of an Omni-Channel flow, and use that output as input for the routing logic in a Route Work action.

The Check Availability for Routing action can be migrated with Omni-Channel Flows from sandbox to production organization without manual intervention. To migrate the Check Availability for Routing action, change the Action Version to version 2.0.0.

The references to Agent and Queue need a workaround to be migrated. Workaround for the references to the User Entity - Agent

- Use a Get Record flow action to retrieve the Agent ID (ex: By Username or email)
- In the Omni-Channel action field, use the User ID retrieved from the previous step

Workaround for the references to the Queue Entity

- Use a Get Record flow action to retrieve the Queue ID (ex: By Queue Name)
- In the Omni-Channel action field, use the Queue ID retrieved from the previous step for any field referencing a queue

The skills referenced with the action can’t be migrated.

#### See Also

- [_Knowledge Article:_ Estimated Wait Time Calculation When Routing Work with Omni-Channel](https://help.salesforce.com/s/articleView?id=003817179&type=1&language=en_US)