Rate this page:

Setting up a TaskRouter Workspace: Add and Configure TaskQueues

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

With your Workspace open in the TaskRouter console, click 'TaskQueues' then 'Create TaskQueue'.

TaskQueue #1 - Spanish

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

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

Target Workers Expression: languages HAS "es"

TaskRouter TaskQueue Sample - Spanish

TaskQueue #2 - English

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

Target Workers Expression: languages HAS "en"

TaskRouter TaskQueue Example - English

Validating TaskQueue Filters

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

Matching Workers - English

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

Matching Workers - Spanish

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

Next: Add a workflow »

Rate this page:

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.


        Thank you for your feedback!

        We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more