Routing Glossary

Object Routing in Managed Package

The Routing Queue (RQ) within the managed package is set up to allow for the routing of leads, accounts, cases, and opportunities to the appropriate owner based on round-robin functionality. Here the functionality supported by the Routing Queue.

Setting up an Object to be Routed in SFDC

To set up an object to be routed, you would create a process builder flow that will trigger the routing based on the exact situation that you want the object to be routed (e.g. when the object is created or when the object is edited or in a particular state, etc.). Please see below for the details on how to set up the process builder flows.

The RQ is a “longest waiting” agent-based routing system. This means with all of the settings below, the longest waiting agent will receive the next object.


The RQ allows for you to setup various types of limits on how many items will be sent to each participant as part of the round robin process. There are many different kinds of limits that can be set:

-Queue Level Limits – this is the limit established at the queue level. All the participants in the queue will be subject to this limit. Queue level limits are used to ensure that no participant will ever end up with more than the limit.

-Personal Limit – this is a limit set for an individual. The limit can be different for each member of the team. You would use individual limits to manage things like:

  • Seniority – senior folks can handle more than junior folks
  • Employment types – e.g. full time staff can handle more than part time folks

In addition to the above limits – there are time based limits that can be used for managing productivity and performance goals:

  • Hourly Limits – this limits the number of items that a participant can receive each hour.
  • Day Limits – this limits the number of items that a participant receives each Day
  • Weekly Limits – this limits the number of items that a participant can receive each week

The above limits can be effectively used to achieve a weight distribution based on the above time frames.

Times & Timezones

The RQ is setup to work with UTC time only. Which means the configuration has to be done with UTC time.

Designing your Routing Queues

The RQs can be set up based on your needs in the following areas:

1.) Route based on Tags – This is where you can use any other text fields to send the routing to a particular RQ. For instance, you can set up different queues based on the Lead Source or Industry, etc. You can basically use any text field (other than description and notes fields) - or Tags – to match them to a queue.

2.) Time-zone based – This is where you can set up queues based on the time zones and where to route the objects to. For example, you can create a North America Queue and a Europe Queue where depending on when the lead was created you can route them to the North American team or the European Team.

3.) Skills-based routing – this is where you can set up queues based on the skills of the team members. For instance, you can route based on language skills such as a queue for English speaking agents and a queue for Spanish speaking agents, etc.

4.) “Logged In” Agent-based routing – this is where agents can log into a system like LiveAgent. When the agent is logged in, they will be part of the queue and when they log off – they will no longer receive objects routed to them. The logged-in status is determined by using the “Logged In Agent” checkbox on the User Object. To enable to disable this flag – see settings below.

You can also use a combination of the three models above.

Setting up Your Routing Queue

To setup a routing queue, add the “Routing Queues” tab to your view. Click on New and fill out the following details.

Attributes of the Routing Queue

  • Queue Name
  • Description – add a detailed description of the queue
  • Capacity Limit – see Queue Level Limits above
  • Tags – a comma separated list of tags that will be matched to the incoming object
  • Enabled – whether the queue is enabled or not. To turn off a queue – simply uncheck this box.
  • Type – the type of object being routed. Options are Leads, Cases, Accounts and Opportunities
  • Default User – If there are no available participants in the queue to route an incoming object, then the object will be sent to this default user. You can either have a default user or Salesforce Queue/Group for leads and cases.
  • Default Queue – Only valid for cases and leads. Setup a Salesforce Lead/Cases queue and add the Name of the queue here. Please make sure the name in this field is the API name of the salesforce queue.
  • Use Agent Login – if this setting is checked, then the agent’s logged in status (from the user object) will be considered in the routing.
  • Route Duplicates to Same Owner – This setting routes duplicate leads (see Duplicate Detection below) in the last x number of days to the same owner.
  • Look For Dupes in Last (days) – defines the last x number of days during which a duplicate will be detected.
  • Route By Account Team Role – This setting will route the lead to a particular role in the Account Team related list on the related account. See below for Account Team Based Routing.
  • Account Field for Role Tags – You can select either the Account Type (standard field) or the Account Status (Custom Field). Based on the value of either of these fields, the lead can be routed to the correct role.
  • Additional Notification Text – see notes below. This is a custom message that will be appended to the chatter notifications. You can use this to @mention people or other chatter groups as necessary.

Once the Queue is setup, you will need to setup two other objects. Queue participants and Queue Timing. Click on the new queue that you just created above and in the layout you will see the two items above as related lists.

Queue Participants Setup

There are two types of participant records that can be created: User or Role based.

User Based Participants

This is the default routing logic where a participant record is created for each individual user who is to participate in the round robin routing of the queue.

Click on the “New Queue Participant” button from the related list to create a new participant for each member of the queue. See below for the details to create the new participant:

  • Participant Name – Provide the name of the user
  • User – click on the search button and find the user you want to associate with this participant
  • Participating – this is a checkbox that says this user is actively participating in the routing. To turn off a user from being part of the routing logic, just uncheck this box.
  • Routing Queues – this should be pointing to the queue the participant will be part of
  • Vacation Start & End Date– You can automatically remove a user from participating in the queue by entering a Vacation Start and End Date. For this duration the user will be taken out of the routing queue and then automatically put back in. Use this to enter known time off so that you don’t have to remember to click the participating checkbox above manually each time a team member is on vacation.
  • Limits – please see above for limits. You can set a personal limit, hourly, daily and weekly limits for each team member.

Please do not edit the counters.

Every time a lead object is routed, it’s linked to the participant record. You can use this relationship in the process builder to update the “Assigned Count” field using either workflow field updates or Process Builder Flows (see below).

Role Based Participants

For Role based participants the User file is left empty but the Account Role Field is filled in. If the Account Role field is filled in then the Tags field must contain the corresponding Account Type or Account Status value that will be used for routing.

For example – If the Account Role is “SDR” and the Tags field contains “Prospect” – then when a lead is routed for an Account that is of type prospect – the lead will be passed to the person tagged in the SDR role in the Account Team. Using this mechanism you can route to different roles based on either the Type of the account or the Status of the account.

For Role based Routing – the Account Teams functionality must be enabled in salesforce.

Duplicate Detection

For each lead the following values are calculated and populated:

1.) Domain – derived from either the primary email id or the website field.

2.) Best Matched Account – matched using the Domain key with an account that contains the same domain.

A Lead is considered duplicate if the Domains matches. A lead is attached to an account if the Best Matched Account contains the same domain key. All Role based routing then happens based on this matched account.

Queue Timing Setup

Click on the “New Queue Timing” button to create a new Queue timing object. The idea behind the queue timing object is to manage the timings for when the queue is active for routing. The recommended approach is to create an object for each day of the week. Please fill in the details below to set up a timing object:

  • Queue Timing Name – this will be auto filled when you fill in the Day of the Week.
  • Start Time – UTC start time. Please note this has to be provided in UTC time only. The queue will become active at this time.
  • End Time – UTC End time. Please note this has to be provided in UTC time only. The queue will become inactive at this time for the day of the week.
  • Day of the Week – pick the day of the week for this this record applies to. Sunday =0 thru Saturday =6.
  • Routing Queue – should show the queue for which this timing record is being created.
  • Date (OPTIONAL) – see below. You can fill in a day of the week or a date. Date always overrides the day of the week.

In addition to the “Day of the Week” routing record, you can create a timing record for specific dates such as holidays. When a “Date” timing record is present, it takes priority over the “Day of the Week” routing record.

The best way to replicate the records is to click on the “clone” function and edit the Day of the Week field to set up a record for each day of the week.

Calling the Routing Queue

For the queue to be activated, it has to be called from a process builder flow when the condition for routing is met. You can initiate the routing under the following situations:

  • When the object is created or after a certain period of time after the object is created
  • When the object is edited or when a specific field is edited or has a specific value
  • When the object is assigned to a specific user or salesforce queue

This gives you a number of possibilities on when to route the object. To start the routing, create a new process builder on the object and call into the “LeadRouting” salesforce visual flow by passing the following parameters:

  • InputType – Leads, Accounts, Opportunities or Cases
  • InputLeadTiming – the date to be used for routing. This date will be compared against the Queue Timings field to decide which queue should route the object
  • InputRecordID – pass in the ID field of the object
  • InputTags – the field to use as the tags to match to the right queue.

Managing Capacity

The counter in the queue keeps increasing, every time an object is routed. When the user is done processing the object, you would want to reduce the capacity so that the user can accept new objects. To do this, you must write a process builder flow that will decrement the “Assigned Count” from the related Participant Object.

You can trigger the Reduction in assigned count based on the following conditions which can be enabled through the process flow:

  • When the Object has been processed to the best of the ability of the person who received the object – e.g. when a Lead has been converted or Closed or When a Case has been reassigned to someone or closed.
  • When the Status field reaches a particular status – e.g. when the Lead Status is Closed or Rejected.

Using the process builder, you have enormous capability to trigger the capacity management by reducing the available capacity when a particular planned task is completed.

Enabling “Logged in Agent” Flag

The user object has a custom field called “Agent Logged In” which can be turned on or off to enable the “Logged In” routing capability above. Please note the Routing Queue must be configured to support this by enabling the “User Agent Login” flag on the queue definition.

For example for LiveAgent – you can do the following:

Create a process builder that will change the status to checked when a new LiveAgent Session object is created when the user logs in. When this happens, check the “Agent Logged In” flag to true.

When the “LogOut Time” field is updated, this means the agent has logged off. Use this in the process builder to check the “Agent Logged In” flag off.

This way – whenever the agent is logged into LiveAgent – they are available for queue routing. When they are not logged in, they will not get any objects routed to them.


A chatter Notification is posted on the routed item and the new owner will be @mentioned. To setup notifications to be received by email – please configure your chatter settings to receive the notifications. The chatter notification will also inform you the basis on which the lead was routed.

In addition to the notification, there is a link that is created between the rule that routed the lead and the lead itself using the “Routing Rule” field on the lead. You can use this for reporting purposes.

The Additional Text setting on the queue can be used to post a custom message or @mention someone when the routing occurs. To @mention someone – you must use the format @[].

Troubleshooting the Queue

How do I know the queue is routing?

To make sure the queue is available for routing, you need to check 3 things:

1.) Ensure that a Queue Timing record shows as “Active Routing Record”. If not visible on the Related List view of the queue, add the “Active Routing Record” checkbox field to quickly see whether a routing record is shows as active. If no routing records are listed as “Active” with the flag checked, then this means the queue is not actively routing.

2.) Check the list of participants to see if at least one of them is NOT-DISQUALIFIED. The “disqualified” checkbox is turned on if the user is currently under any of the below conditions:

  • Limits reached for routing
  • On Vacation
  • Not Logged in and the Queue requires Logged In status.
  • Associated user is not active in salesforce (i.e. user object is not active)

3.) If the Routing Queue finds no active participant, it will route to the default user or queue.