Loading
Salesforce now sends email only from verified domains. Read More
Service
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Understand the Details of the Routing Lifecycle

          Understand the Details of the Routing Lifecycle

          When you dig more deeply into Omni-Channel and the routing process, there are two particular objects that are worth understanding better: PendingServiceRouting (PSR) and AgentWork.

          Required Editions

          View supported editions.

          What Is PSR? What Is AgentWork?

          PSR (PendingServiceRouting) is a Salesforce object that gets created when work is routed using Omni-Channel. PSR is a transient object that contains routing information about a work item that is in the midst of being routed. The system automatically creates the object and deletes the PSR when a support rep accepts the work item. Command Center for Service shows PSRs in its Queues Backlog and Skills Backlogs tabs.

          AgentWork is a Salesforce object that automatically gets created when the routing system finds a potential support rep to handle the work item. It contains information about the work item and the routing status. This object is never automatically deleted, but you can manually delete it when the State field is in a non-active state. (Active states are Assigned and Opened. All other states are considered non-active states.)

          Why Should I Care?

          When a record’s owner is assigned to an Omni-Enabled Queue, or the record is routed via the Omni-Flow Route Work action, a PSR record is created automatically. You can also use Apex to manually create and update this record for more complex use cases not supported in flows, such as finely-granular prioritization, especially when reopening, transferring, or reassigning work. However, doing so isn’t recommended unless absolutely necessary.

          What Is the Basic Lifecycle?

          In the simplest scenario, a PSR record is created when a work item is routed using Omni-Channel. When the system finds a potential support rep to handle the work item, an AgentWork record is created. When a rep accepts the work item, the system deletes the PSR record. The system never automatically deletes the AgentWork record, but the record can be deleted manually when it enters a non-active state (such as Closed, Unavailable, Declined, Canceled, Transferred).

          What Is the Detailed PSR and AgentWork Lifecycle?

          To fully understand the lifecycle of these two objects, refer to this state diagram. In addition to the creation and deletion of PSR and AgentWork records, this diagram describes the PSR.IsPushed state and the AgentWork.Status value in different phases of the lifecycle.

          Routing lifecycle state diagram

          The PSR record is transient whereas the AgentWork record sticks around until it's explicitly deleted.

          Why does AgentWork contain multiple work records for the same work?

          Each time a work item is assigned to a support rep, a record is created in AgentWork. For example, if a rep transfers a work item to another rep, two records exist–one for each rep. If the work is assigned to a new rep but the original rep keeps the work open, AgentWork contains multiple active records for the work item–one for each rep. AgentWork can have multiple work records for the same rep and work item if the work item is routed to the same rep multiple times.

          When is the AgentWork record set to Closed?

          An AgentWork record isn’t closed until one of these events happens.

          • For tab-based capacity, a record closes when the assigned rep closes the work tab.
          • For status-based capacity, the record closes when the work has a completed status or the work is reassigned.
          • If After Conversation Work is enabled, the work closes if the After Conversation Work period ends.

          Why isn’t a work item in a queue assigned to a support rep in Omni-Channel?

          Work isn't assigned to a support rep if the queue doesn't have a routing configuration. Without a routing configuration assigned to the queue, Omni-Channel doesn’t route work items in the queue.

          What are the usage and limits for PSR records for my org?

          You can view the number of Pending Service Routing records that are currently in use in your org, as well as the current hourly use rate. From Setup, enter Omni-Channel in the Quick Find box and select Limits. The Limits page also displays the current Pending Service Routing record usage percentage and the Pending Service Routing record limits for your org.

           
          Loading
          Salesforce Help | Article