Setting up a TaskRouter Workspace: Add and Configure Task Queues

Task Queues assign Tasks to Workers based on Worker attributes. For our example, we will use two Task Queues - one for requests in Spanish and one for requests in English.

With your Workspace open in the TaskRouter web portal, click 'Task Queues' then 'Create Task Queue'.

Task Queue #1 - Spanish

Our first Task Queue will target Workers like Alice who possess Spanish language skills.

Target Workers are described using an SQL-like syntax which matches against the JSON attributes of Workers. Use the HAS operator to check whether a Worker's languages array includes the value "es":

Be sure to set the Reservation Activity to 'Reserved' and the Assignment Activity to 'Busy'.

Target Workers Expression: languages HAS "es"

Task Queue #2 - English

To complete our example of language-based routing, create a second Task Queue, this time targeting Workers like both Alice and Bob who possess English language skills:

Target Workers Expression: languages HAS "en"

Validating Task Queue Filters

Reopen the 'Customer Care Requests - English' Task Queue and scroll to the bottom of the page. You should see that both Alice and Bob are eligible to receive tasks from this Task Queue:

Reopen the Spanish Task Queue for comparison - only Alice will show in the list of matching Workers:

Wonderful. We have created two Task Queues to target our Workers. But before a Task Queue assigns a Task to a Worker, the Task needs to be created and added to the Task Queue. That's the role of a Workflow.

Next: Add a Workflow »

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.