Twilio Flex Quickstart (Advanced): Multiple Users and Skills-based Routing

In just a few minutes, you can set up basic skills-based conversation routing to multiple queues in your Twilio Flex contact center.

This quickstart takes you through adding an administrator to your contact center, and then assigning different skills to the two agents. We'll modify an IVR designed in Twilio Studio to pass conversations into two queues defined by Twilio TaskRouter.

At the end of this guide, you'll have a contact center with an IVR that can:

  • Answer common user questions
  • Pass callers into a "support" queue
  • Pass callers into a "sales" queue, and
  • Maintain an "everyone" queue.

The two specialized queues will only target an agent with the appropriate sales or support skill.

This quickstart builds upon the IVR from the Flex Basics Quickstart. You should complete that quickstart first.

In this quickstart, we will:

  1. Add a second administrative user to your Flex Instance
  2. Assign skills to both users
  3. Create two queues in TaskRouter corresponding to the skills
  4. Modify an IVR to pass callers into the two queues.

In production, you should use SSO User Signin to manage Flex agents. If you add administrators using the Console, they will get full access to your Flex instance and billing preferences. Be cautious with who you add as an administrator.

Prefer other types of content? See our collection of Flex video tutorials and demos.

Let's talk about skills.

Add a new administrator to a Flex Instance

Again, this quickstart builds upon the IVR from the Flex Basics Quickstart. Please finish it first if you haven't yet, then return here.

In this quickstart, we'll add a new Administrator. Note that while you can do this on a production instance, this user will have access to all instance settings, customizations, and billing preferences. However, this is the quickest way to add a second user for testing purposes (or to add legitimate administrators).

In production, you should manage your user identities through an SSO integration.

  1. Navigate to the Users section in the Twilio Console.
  2. Add a new user by clicking the red plus ('+') button. Grant only the Administrator role:
    Add an Administrator

    Note: For some mail providers, you can add a '+' in an email address to create a virtual address, as we've demonstrated in this example. You can also complete this quickstart with a teammate.
  3. Click on the invite email link to verify the new user
  4. In a private window, incognito window, or second browser, log into Twilio with the second user. Or, if you're completing this with a teammate, have them log into the instance
  5. Launch your Flex Instance with the second user

At this point, you should have two users logged into your hosted Flex Instance: the original user and the new administrator. If you've come this far, congrats – it's time to tag our "agents" with skills!

Let's hand out some credentials.

Assign skills to your Flex Agents

Skills are very similar to tags or labels on a piece of content or email. In Flex, they allow you to quickly sort your users. For this quickstart, we're going to specify sales and support skills but your contact center might have hundreds of different skill types.

Let's create two skills and assign them to our users:

  1. Navigate to the Flex Admin pane from your original administrator's Flex Instance window
  2. Under the Assignment heading, select the Skills button:
    Assign Flex skills
  3. Using the entry on the left hand side labeled 'Add New Skill', add a sales skill and a support skill:
    Flex skill type definition
  4. On the Teams page (, change the pulldown menu to 'All Agents'
  5. Click either agent and select sales from the dropdown list. Hit the blue plus ('+') to add it to the user, then click Save
  6. Click the other agent agent and select support from the dropdown list. Hit the blue plus ('+') button then click Save.

Nice – you now have skills assigned to both your agents.

Next up, we need to create two queues, one for each skill. Depending on caller intent, we're going to place calls into either a sales queue or a support queue. We'll also maintain a catch-all "Everyone" queue.

Hurry up and queue!

Create call queues in Twilio Flex using TaskRouter

TaskRouter is a very powerful tool for routing conversations in a call center. We're barely going to scratch the surface with this quickstart. We'll create two new call queues to handle two types of calls based on the skills we've previously created and assigned to our agents: sales and support.

  1. Navigate back to the Flex Admin pane from your original user's Flex Instance window
  2. Under the Assignment heading, select the Routing button:
  3. In the TaskRouter console, click the 'Flex Task Assignment' workspace, then click 'View all TaskQueues'
  4. Create a new Queue
  5. Enter the taskqueue name sales and the queue expression (routing.skills HAS 'sales') then click 'Save':
    Sales TaskQueue
  6. Create a second TaskQueue named support with the queue expression (routing.skills HAS 'support') and click 'Save'
    (Leave the 'Everyone' queue alone - that's our catch-all queue)
  7. On the left panel, click on 'Workflows'. Click the red plus ('+') to create a new Workflow
  8. Name this workflow Assign to Sales. Scroll down and click the red 'Add a Filter' button
  9. Under the Matching Workers heading, click to edit the Queue field. Set it to 'sales' and hit the checkbox to save it:
  10. Click the red 'Create' button
  11. Add another Workflow named Assign to Support. Edit the Queue under Matching Workers to go to 'support' then 'Create'

These were some pretty basic steps, but as you can see from this exploration TaskRouter is a very powerful task management routing system. In your production contact center, you can set up very intricate workflows using a combination of Skills, Workflows, and TaskQueues.

For now, this will suffice. Let's modify the IVR from the Basic Quickstart to route calls to either sales or support.

Let's modify our IVR

Modify an IVR to route calls based on agent skills

Once again, this IVR modification comes on top of the IVR built in the Basic Quickstart. If you recall, that IVR can automatically field questions regarding your business location and hours. Other messages drop into the main agent queue.

We're going to modify it so a caller is prompted to choose between sales and support. When they choose, they'll be routed to a queue where only agents with that skill tag are able to respond. They can also choose the 'general' queue, which we have set to everyone.

  1. Navigate to the Studio console and click the Voice IVR
  2. Drag a new Enqueue Call widget to the canvas
  3. Set the Name to SalesCall, set Task Router Workspace to Flex Task Assignment, and set Task Router Workflow to Assign to Sales:
  4. Create a second Enqueue Call widget for support. Set the above to SupportCall, Task Router Workspace, and Assign to Support, respectively
  5. Click the Split Widget you designed which previously matched with 1, 2, and everything
  6. Add new transitions for Equal to 3 and Equal to 4. Transition to your SalesCall and SupportCall widgets, respectively
  7. Modify your Gather Input on Call widget. You can keep options 1 and 2 as is, but change the end to something approximating "To talk to sales, press 3. To talk to support, press 4. For all other questions, press 5."
  8. Publish the flow

Ready for the payoff? With both Flex Instances open, dial into your contact center. You'll find that you now have new options; you can choose to talk to sales or talk to support. If you choose one of those, you'll only be routed to the agent tagged with the respective skill! You also have a catch-all option in '5' where you are dropped into the general queue.

Pretty cool! Your contact center is starting to come together.

Amazing, this is an excellent contact center! What's next?

Agent skills, conversation routing, and separate queues in Twilio Flex

You've come a long way with the basic quickstart and this follow-up advanced quickstart. You built an IVR which reduces agent burden with automated responses to common questions. You created three call queues, one catch-all queue, plus specialized queues for sales and support.

And this is just the beginning. Armed with these skills, you'll be able to customize your contact center to your heart's content, before modifying Flex behavior using React.

Thanks for following along in this quickstart, we can't wait to see where you go with Flex!

Where to next?

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