Fairly assigning leads, account or opportunities to sales reps is core to how sales teams manage ownership. In most cases that means round robin assignment in Salesforce. This post outlines the (many) ways you can use Salesforce's tools to get this done.
Before you implement round robin assignment in Salesforce, think about what you're trying to achieve. Some of the options below (e.g. Lead Assignment Rules) only apply to Leads and won't work for Accounts, Opportunities, Tasks, etc. For example, if you're assigning qualified opportunities to account executives (AEs) you'll need to make sure you pick the right option.
The dealer starts with one player, gives that player a card and then goes around the table, handing each player a card until some number of cards have been given out. This is a good way to evenly divide a large number of things (cards) among a small number of people (players). That's basic round-robin.
You should consider whether you want to do the basics or if your round robin needs weighting, capping, load balancing or availability management. Just be aware that the methods below will focus on the most basic form of round robin.
The rest of this post will cover the following methods for doing round robin assignment in Salesforce:
- Lead Assignment Rules
- Process Builder [Deprecated]
- Using sales engagement software
- Bonus method using Gradient Works
But first, some math and an example involving a deli...
Round robin, modulo and... deli tickets?
Most of the examples below use the MOD Salesforce formula operator in some way. Mod is short for the "modulo operation" which sounds complicated but is actually pretty simple: it just gives you the remainder left over after you divide two numbers. For example:
- MOD(5,3) is 2 because 5 divided by 3 has a remainder of 2
- MOD(9,3) is 0 because 9 divided by 3 has no remainder (3 goes evenly into 9)
- MOD(2731,3) is 1 because 2731 divided by 3 has a remainder of 1 (3 goes into 2731 910 times if you're curious)
The neat part about the mod operation is that it's always a number between 0 and 1 less than the number you're dividing by. So if you take any number mod 3, the result will always be either 0, 1 or 2. Ok, maybe that could be useful... but how? Glad you asked! Let's see how we can use MOD to evenly assign something.
Imagine you run a deli and you've got 3 sandwich artists. The artists get paid $0.50 per sandwich so you want to make sure each gets an equal number of customers throughout the day or else somebody will make less money and be upset.
The good news is that every customer that walks in takes a number from the little ticket dispenser by the door. Each new customer's number is 1 more than the previous customer's number. Cool so how do you turn this system into a way of allocating customers? Glad you asked that too! Here's a little algorithm:
- Write the names of each sandwich artist on a board and give them each a number between 1 and 3.
- Take each new customer's ticket number and MOD it by 3 (the number of sandwich artists). This gives you a remainder between 0 and 2.
- Add 1 to the remainder so you have a tidy result between 1 and 3.
- Use the resulting number between 1 and 3 to pick that customer's sandwich artist from the board.
Putting it all together, let's say your new customer takes a ticket with the number 8. You do 8 mod 3 and get 2. Add 1 and you get 3. Pick sandwich artist number 3 and send them this new customer. The next customer pulls a 9. 9 mod 3 is 0. Add 1 and you've got, well, 1. Send them on to sandwich artist one. Repeat.
I don't know about you but those customers sound suspiciously like Leads (or really anything else you'd want to assign) to me. It turns out that most of the solutions below use a variation on this where the ticket dispenser machine is replaced by an auto number field.
Now if you're not too hungry for a pastrami on rye, let's actually look at our options.
1) Round robin with Lead Assignment Rules (LARs)
We've done a deep dive on Salesforce Lead Assignment Rules in another post so we won't repeat everything here. However, if you've done any googling at all for "round robin lead assignment in Salesforce" you've probably encountered this Salesforce Help doc about creating round robin lead assignment rules.
The basic idea in the Salesforce Help doc is precisely the deli counter example above:
- Add an auto-number field to Lead that counts up every time there's a new lead
- Add a formula field on Lead to calculate the "Round Robin Id" by MODing the Lead number by the number of sales reps and adding 1
- Hard-code Lead Assignment Rule Entries matching "Round Robin Id" to a rep
Step 3 looks like this:
Let's break down the good, the bad and the ugly of this approach.
- It's pretty simple with no complicated automation
- It's built-in so it comes with no strings attached (besides that Salesforce license $$$)
- Leads only - Lead Assignment Rules only work for - you guessed it - leads
- Hard to manage - Whenever reps get added, leave the company or just go on PTO, you have to update both the Round Robin Id formula to change the number of reps and update out the rule entries to assign Round Robin Ids to different reps
- No audit trail - However, you can help by tracking field history for the owner field.
- The minute you have any additional routing rules where some leads are created but aren't assigned to this group, your assignment gets skewed. Here's an example. Let's say 4 leads are created and given numbers 1, 2, 3 and 4. Let's say 2 and 3 aren't assigned because they used a gmail address. What happens when Leads 1 and 4 get assigned? They'll both get assigned to the rep in slot 2 (MOD(1,3)+1 = 2, MOD(4,3)+1 = 2). Reps 1 and 3 aren't going to be happy about that.
2) Round robin with Process Builder
[Ed. Note: Please don't use this method since Salesforce is retiring process builder.]
Emily Douglas from Formstack discussed how to use Process Builder for round robin assignment at Dreamforce 2018. This solution is nice and flexible because it can be applied to any object. In fact, her example uses Contacts. Here's her overview slide:
If you watch the video and look closely, you'll see it's basically the same "deli counter" process used by the Lead Assignment Rule approach. The main difference here is that the last step happens in Process Builder which is much more flexible than Lead Assignment Rules and isn't tied specifically to the Lead object.
This means that the good, bad and ugly of this approach is pretty similar to the earlier approach.
- Built-in - You don't need anything besides Salesforce
- Any object - The pattern can work for any object, not just Leads. All you have to do is set up the custom fields on the object and set up a process builder to operate on objects of that type
- Versioning - Process builder maintains versions as you make changes so at least you can refer back to the way things used to be if you make a tweak. Just note that this doesn't apply to the formula fields, only the logic in process builder
- Duplication - This approach describes a pattern you can use for any given object with some custom fields and a process builder. You'll need to try to keep that pattern consistent across every object you build this for.
- Hard to manage - As with the LAR approach, you've got to manually edit a formula field to change the list of reps
- More workflow effort - Unlike the LAR approach, you have to explicitly build in logic in process builder to do the assignments
- Process Builder is on its way out - Salesforce has publicly stated that Flow is the future of workflow automation on the platform, not Process Builder. It's not going anywhere soon but it's not being improved.
- Skewed assignments - Just like the LAR approach, this relies on a single deli-counter style auto number field. This will skew in the exact same way if you start implementing more complex routing rules. It is possible to eliminate some of these issues in process builder, but at the expense of a lot more complexity.
3) Round robin with Apex
As you probably know, developers can build entirely custom logic on the Salesforce platform using the Apex programming language. A typical Apex solution for round robin assignment usually takes the form of one of these two approaches:
- A variation on the deli-counter approach we've discussed so far, using a combination of formula fields to compute an auto-number value, the Apex version of the modulo operation (Math.mod) and triggers to kick off the code. This approach has all the drawbacks of the LAR and Process Builder approach.
- A more flexible (and powerful) approach that uses a set of custom objects, each of which define "slots" in multiple round-robin queues. At the expense of a lot more complexity, this approach allows you to distribute the same type of object fairly to different groups based on any routing logic you can imagine.
A full Apex implementation is too complex to discuss here so let's just look at the good, the bad and the ugly of using Apex to do round-robin:
- Nearly-infinite flexibility - If you can describe it, you can most likely do it with Apex. Assigning any object, with any logic is entirely possible.
- Round-robin can coexist with other routing rules - It's entirely possible to build complex routing rules to different groups of users without skewing your round robin
- Version control - Modern development approaches mean you can keep track of and independently test different versions of the code.
- Developers, developers, developers - It's code. You'll need a developer to write it in the first place and you'll need a developer to maintain it, debug it and change it.
- Maintenance and change will be difficult. In my experience most code solutions in Salesforce become very hard to maintain over time, especially when the original author leaves. Even if you do have developers to support the custom solution, they're often very busy with other priorities and can't make changes on a time schedule that the business leads.
4) Round robin with Flow
We've talked a lot about Salesforce Flow around these parts because it's the future of Salesforce automation. The important thing to know about Flow is that it provides nearly all the flexibility of Apex with the low-code approachability of Process Builder. That makes it an ideal way to build solutions like round robin assignment.
There are several good examples of using Flow for this. You can find one in the book Lightning Sales Ops by Matt Bertuzzi but I'm going to specifically focus on this one by the sales operations consultants Kicksaw.
Here's a screenshot of Kicksaw's Flow in action:
The Kicksaw solution has a lot of moving parts but it gets rid of the "deli-ticket" skew problem that we discussed above. It introduces separate groups of reps with different territories so it can be used with more complex routing logic. It also always assigns to the rep who's gone the longest without receiving an assignment. While this won't allow for round robin assignment with weighting and capping, it will do the job for basic round robin quite well.
My main issue with the Kicksaw solution is that it introduces an unnecessary process builder component to trigger execution of the Flow. That's easily done with record-triggered Flows.
- Flexibility - Flow gives you the flexibility to do most things you can do in Apex
- Maintainability - Admins can update the Flow logic and change the various user lists without needing any developer help
- Routing rules without skew - Support multiple territories and routing logic without worrying that it will skew your assignment process
- Future proof(ish) - Flow is the (current) future of automation on Salesforce
- More logic to deal with - Flow can require sorting out some tricky logic similar to programming; not all admins are comfortable with that
- A lot to configure - The full Kicksaw solution requires some custom objects, a queue and even some Lead Assignment Rules in addition to Flow. That can be a lot.
- It's all on you - In the end this solution is custom to your Salesforce and relies on you and your team to maintain it.
4.5) Round robin with Sales Engagement software
I'm throwing in a "4.5" here because these recommendations aren't strictly Salesforce but instead might give you the ability to do basic round robin assignment with tools you already have. Sales engagement tools like Outreach and Salesloft have some basic round robin capabilities backed in so you may be able to get away with using them.
- You're already paying for it
- Functionality is super limited and generally only applies to a few use cases
- If you get rid of your sales engagement product, you'll also lose any round robin functionality you're using
Bonus! Round robin with Gradient Works
You didn't think I was going to let you get out of here without talking about how Gradient Works makes round robin assignment in Salesforce easy did you?
If you're looking for a no-code round robin assignment solution that's flexible enough to handle whatever routing rules you throw at and advanced enough to optimize any of the assignments in your customer lifecycle, check us out.
By the way, round robin is such an important part of how sales teams manage assignment and handoffs, that we put together a whole round robin assignment knowledge base for sales teams. Go check it out.