TaskRouter | Jul. 01, 2024

Adjust task sorting with virtual start time

TaskRouter routes tasks in priority order, starting with the highest priority. If multiple tasks have the same priority, it uses the task creation time to break the tie, sorting tasks from oldest to newest so that the oldest task is routed first. 

However, in some scenarios, the task creation time doesn't reflect the actual date and time that the customer interaction originally began, and the task is sorted lower than it should be. For example:

  • A customer calls, waits for 20 minutes, and is offered a callback. The customer hangs up and a new task is created for the callback. The 20 minutes that the customer waited during the first call are not captured in the task creation time for the new task.

  • A customer begins a conversation in one channel, such as chat, and switches to a different channel, such as a voice call. Moving to another channel creates a new task with a later task creation time, so the new task is prioritized lower.

To correct how these types of tasks are prioritized, you can now specify a "virtual start time," which is an optional parameter. When specified, virtual start time is used in place of the task creation time to determine where the task is sorted in the list. 

For example, if we added a virtual start time to the second task that was created in the callback example above, we could set it to match the time that the original task was created. That would enable the customer to keep their place in line for a callback.

For more information, see our documentation:

  • Queue Ordering for a more detailed description of how virtual start time works, including examples
  • VirtualStartTime on the Task Resource page for information about how to use this parameter

Flex TaskRouter