SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

A Guide to Voice Queues and TaskQueues with TaskRouter

Overview

Twilio uses "Queue" resources in both Programmable Voice and TaskRouter, each with different functionality. This guide focuses on TaskRouter‑integrated voice solutions and details how Voice Queues (live calls) relate to Workflows and TaskQueues (groups of Workers).

Product

Programmable Voice, TaskRouter, Flex

Voice Queues and TaskQueues

Summary

Resource Description (in integrated flows) Identifier Example Related Resources
Voice Queue

Programmable Voice resource that contains live calls waiting to be bridged. 

In TaskRouter-integrated flows, each Voice Queue relates to a single TaskRouter Workflow.

QUxxxxxxxxx TaskRouter Workflow, Voice Queue Members (calls)
TaskQueue TaskRouter resource that groups Workers by attributes. Workflows route Tasks to one or more TaskQueues.  WQxxxxxxxxx TaskRouter Workers, Tasks, Workflows

How queues work together 

  1. An inbound call hits TwiML with <Enqueue workflowSid="WWxxxxxxxxx" />.
  2. The caller is placed into the Voice Queue associated to that Workflow (QUxxxxxxxxx).
  3. TaskRouter creates a Task (WTxxxxxxxxx) and routes it through the Workflow to eligible TaskQueues (WQxxxxxxxxx.) and Workers (WKxxxxxxxxx).
  4. When a Worker accepts the Reservation, the call is bridged and leaves the Voice Queue.

Programmable Voice Queue

The Voice Queue holds live callers while TaskRouter finds an eligible Worker. 

  • Voice Queues contain Calls, not Tasks.
  • All calls for a TaskRouter Workflow will share the same Voice Queue.
  • Once a reservation is accepted, the caller is bridged and removed from the Voice Queue.

Identifier prefix: QUxxxxxx

TaskRouter TaskQueue

A TaskQueue is a logical grouping of Workers defined by a TargetWorkers expression (for example, skills HAS "sales"). 

  • TaskQueues contain Tasks, not phone calls.
  • Workflows route Tasks to one or more TaskQueues based on routing rules and priorities.
  • Changing a TaskQueue can affect Worker eligibility, but will does not change the Voice Queue used by the Workflow.

Identifier prefix: WQxxxxxxx

Common Misunderstandings

  • Don’t assume changing a TaskQueue changes the Voice Queue; the Voice Queue is tied to the Workflow (WWxxxxxxxxx), not to any TaskQueue.
  • Don’t compare the number of Tasks in a TaskQueue to the number of calls in a Voice Queue; they represent different objects.
  • If a Workflow routes to multiple TaskQueues, callers enqueued with that workflowSid still share the same Voice Queue.

Additional Resources

Have more questions? Submit a request
Powered by Zendesk