Rate this page:

Setting up a TaskRouter Workspace: Add and Configure a Workflow

With your Workspace open in the TaskRouter console, click 'Workflows' then 'Create Workflow'. Name the new Workflow 'Incoming Customer Care Requests'.

Every time you add a Task to TaskRouter, you will associate it with a Workflow. A Workflow examines the attributes of each incoming Task and adds it to the appropriate Task Queue. It also controls timeouts and escalations between TaskQueues - a concept not addressed in this Quickstart tutorial.

For now, in the Assignment Callback URL field, enter as a placeholder. In Part 2, we will set up a server to handle Task assignment callbacks and we'll replace this value with the address of our new server.

New Workflow Details

To make things easier for ourselves in Part 2, set a high value for "Task Reservation Timeout" - e.g. 1200 seconds. We'll be accepting Reservations manually, and having them time out will be frustrating.

In Part 3, we'll use keypresses to capture a phone caller's language preference and use that information to route to the best Worker. To do that, we'll need a Task attribute to represent the caller's language selection. We can name Task attributes whatever we want, but it seems reasonable to use "selected_language".

Add two Routing Configuration filters to the Workflow. These will route new Tasks into the Task Queues we created earlier based on the value of "selected_language".

Routing Configuration #1

The first Routing Configuration targets Tasks where the caller selected Spanish. It adds incoming Tasks to the 'Customer Care Requests - Spanish' Task Queue.

Routing Configuration Expression: selected_language == "es"

Details - Filter for Spanish Language

Routing Configuration #2

Use the 'Add a filter' link to add your second Workflow filter.

Routing Configuration Expression: selected_language == "en"

Details - Filter for English Language

Set the default Task Queue to 'None' before saving the Workflow:

Default Queue == "None"

We're just about done setting up! But before we start adding Tasks to our Workspace, we need to understand the role of Activities.

Next: Understanding Activities »

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