Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Core Concepts: Routing


Twilio Flex uses TaskRouter to distribute calls, messaging sessions, and other types of work to agents in your contact center. It uses Tasks to represent calls, messages or other communications, and to capture all the necessary information for routing them. For every call or message that needs to be handled by a human agent (i.e., it moves past the pre-agent stages like an IVR), a Task should be created using the TaskRouter API. TaskRouter will then route that Task to a suitable agent (also known as a "TaskRouter Worker").

One customer communication is normally captured by a single Task. Each agent can handle multiple Tasks at a time (a chat with multiple customers for example).


How TaskRouter Works

how-taskrouter-works page anchor
TaskRouter Diagram.pending, until successfully ending with completed. TaskRouter's primary job with a pending Task is to find an available Worker to handle it.

Each Task carries with it all the information about the engagement — from the caller's number in a voice call to their data entered during an IVR interaction. These can then be surfaced to the agent who accepted the Task, giving them enough context to help the customer. Task assignment is handled bythe Workflows within a TaskRouter Workspace.


A Workflow defines the rules for routing Tasks to Workers. A Workflow configuration defines the mechanism for routing Tasks to Queues and Workers, assigning priorities, and escalating when needed. Your Workflow can implement skills-based routing for multi-skilled Workers, prioritized routing, or other common routing models.

Whenever a new Task is added to the Workflow, it will be evaluated against the Workflow configuration. Workflow configuration is defined as JSON and works like a case statement: the Task will be routed based on the first matching TaskRouter Expression.


task-queues.Rate this page:

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.