Introducing Last In, First Out (LIFO) Support for TaskRouter
Time to read: 3 minutes
Today we’re excited to announce that TaskRouter now supports Last In, First Out (LIFO) for routing tasks. Before we get into LIFO, a quick refresher: TaskRouter is a skill-based routing engine, designed for routing work such as customer support interactions or sales leads to the best matched agent. The addition of LIFO means that you can now choose between the default behavior where the longest waiting task gets delivered to the next available worker, or a new option where the task that has been waiting the least amount of time will be routed to the next available worker.
So why LIFO? Certainly for a lot of call center use cases, the default (FIFO) behavior is what’s called for. However, we’ve seen a lot of folks use TaskRouter for all sorts of use cases beyond the typical inbound support contact center. One of those where LIFO is really important is in handling leads.
Let’s take an example where you are generating leads on your website and have agents call back those leads. A lead is hottest at the moment it’s created, and ‘cools down’ quickly, equating to an increasingly lower chance to convert that lead. So it is really important to connect the first free agent to the hottest (newest) lead in the system, since that has the highest likelihood of conversion. This is where LIFO helps you out.
LIFO is a TaskQueue level setting and you can enable it on a TaskQueue by passing TaskOrder=LIFO while either creating a TaskQueue or updating an existing TaskQueue. The default is FIFO.
In a FIFO Queue, if you have 5 tasks from F1 as the oldest to F5 as the newest, they will be routed as follows (Task furthest on the right is the next to be assigned to the agent):
In a LIFO Queue, if you have 5 tasks from L1 as the oldest to L5 as the newest, they will be routed:
Now let’s imagine your setup has Workers shared between LIFO and FIFO TaskQueues. We need to specify whether the most recent task from the LIFO queue or the oldest task from the FIFO queue is most important. In this case the preference by which they consume tasks from a FIFO Queue vs a LIFO Queue depends on a workspace level setting PrioritizeQueueOrder. Simply pass PrioritizeQueueOrder=LIFO or PrioritizeQueueOrder=FIFO while creating a new workspace or updating an existing workspace.
Let’s take a look at how the PrioritizeQueueOrder setting works if your Agent is able to take tasks from both TaskQueues. We’ll combine the two examples above, and set PrioritizeQueueOrder to FIFO. In this case, the Tasks are routed in the following order:
Compared to if PrioritizeQueueOrder is set to to LIFO:
There are many possible use cases that can be satisfied using LIFO, or combining LIFO and FIFO Queues. If you find you need additional functionality on top of LIFO and FIFO, we want to hear from you. In the meantime, we can’t wait to see what you build.
Related Posts
Related Resources
Twilio Docs
From APIs to SDKs to sample apps
API reference documentation, SDKs, helper libraries, quickstarts, and tutorials for your language and platform.
Resource Center
The latest ebooks, industry reports, and webinars
Learn from customer engagement experts to improve your own communication.
Ahoy
Twilio's developer community hub
Best practices, code samples, and inspiration to build communications and digital engagement experiences.