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
- An inbound call hits TwiML with
<Enqueue workflowSid="WWxxxxxxxxx" />. - The caller is placed into the Voice Queue associated to that Workflow (
QUxxxxxxxxx). - TaskRouter creates a Task (
WTxxxxxxxxx) and routes it through the Workflow to eligible TaskQueues (WQxxxxxxxxx.) and Workers (WKxxxxxxxxx). - 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
workflowSidstill share the same Voice Queue.