Now that you've navigated the Flex UI and handled your first voice and SMS Tasks, you can start customizing your Flex instance.
Currently, when a call or SMS comes in, it goes into a single Queue that all Agents are part of. As you are developing your call center, you will want to create multiple Queues for different purposes and assign Agents to these Queues based on their roles and skills. For example, you might want to have a Sales Queue for sales inquiries and a Support Queue where your Support team can help existing customers. You might also create Skills and Queues based on the languages that your Agents speak.
In Flex, you can accomplish this Skill-based routing by creating Skills (which are general categories that you use for grouping your Agents and assigning Tasks), assigning Agents to those Skills, and then creating new Queues to match these Skills.
The steps involved in setting up Skill-based routing are:
This section of the onboarding guide covers steps 1-4. You create an IVR system in the next step of the Onboarding Guide.
To get started with Skill-based routing, you first want to create a new Skill in the Flex Admin UI. Typically, you create one Queue for each Skill you create. For example, you might create the Skill "Sales" and then create one Queue called "Sales" to route all sales traffic to Agents with the Sales skill.
In the Flex UI Admin View, navigate to the Skills section. Here, you can see a list of existing Skills and create new Skills.
You can create Skills with or without levels. If you create a Skill with levels, you can then assign Agents the Skill and give them a specific level - for example, you can create a Support skill with levels 1 through 5, and then categorize Agents with this Skill based on their expertise or seniority. This allows you to route tasks based on an Agent's level within a given Skill. If you create Skills without levels, everyone with that Skill will be at the same level.
Skill names should not have spaces in them, to ensure compatibility with TaskRouter (which you will be using later to route Tasks to the correct Queues).
Adding levels to Skills may route more than the ideal amount of Tasks to the Agents in the more advanced levels. Tasks are routed to Agents with higher levels before Agents with lower levels. It's important to keep this in mind if you choose to use Skills with levels.
To get started, create a new Skill called "Sales":
You will now see this Skill added to the list on the right side of the page.
When you create a new Skill, it includes the Skill's Queue expressions and Workflow expressions. These expressions are written in TaskRouter Expression Syntax and will be important later when you create new Queues and Workflows based on these Skills. You do not need to use these now, but you will be prompted later in this guide to refer back to these values.
Next, create another Skill called "Support":
You should also see this new Skill added to the list on the right side of the page.
Now that you've created two new Skills, you can assign an Agent to these Skills.
Navigate to the Teams View in the Flex UI. You should refresh the page after creating new Skills for them to populate in the Teams view.
Click on your Agent to bring up their details. Under Skills in the Agent Detail View, choose the Sales skill to assign to this Agent from the dropdown list of available Skills. Click the blue + button to assign this Skill. Then click Save at the bottom of the Agent Details panel.
Once a Skill is added to an Agent, you can toggle it on and off in the future from the Agent Details View, or remove it from their profile entirely.
Next, you will create a Queue for each Skill you have created. Creating a new Queue allows tasks to be routed to specific Agents based on their Skills.
You perform this section in the Twilio Console rather than in the Flex UI.
This is the first introduction to TaskRouter in this overview. TaskRouter is a core component of Flex, and is the system that routes Tasks based on various criteria.
Below is a glossary of TaskRouter terms used in this Overview:
In a new browser tab, navigate to the TaskRouter section of the Twilio Console. Then, click on Workspaces in the left navigation bar under TaskRouter. One Flex instance can only have one Workspace, so you will only see one item in this Workspaces list.
Click on that Workspace to enter it.
Next, you see a list of all Task Queues. Currently, you only have one, called Everyone. Right now, when a Task comes in, it is automatically routed to this Queue. This Queue captures anything that doesn't match another Task Queue's routing logic.
You now want to create two new Task Queues for the two Skills you set up earlier. Click View all Task Queues, above the list of existing Queues, and then click on + Create new Task Queue.
When creating a new Queue, you need to define several pieces of information. This next block walks through what each piece means, and afterward you will see how to complete this section for each new Queue.
First you'll create the Sales Queue. Here are the values you should provide for each item in the Create new Task Queue page:
Once you have filled these fields out, click Save. You have now created a new Sales Queue.
Complete this again for the Support Queue:
You should now have two Queues: Sales and Support. From the Task Queues main menu, where you see a list of all your existing Queues, click on the new Sales Queue you created. Then, scroll down to the bottom of the page to see a list of Matching Workers who meet the criteria for this Queue. You should see your one Agent that you assigned the Sales Skill earlier.
If you go into the Support Queue and scroll down to the list of Matching Workers, you shouldn't see anyone, since you did not assign anyone the Support Skill.
A Workflow defines the rules for distributing Tasks to Workers. Your Workflow receives incoming tasks from the IVR system you build in the next section of the guide, and it routes those tasks the appropriate Queue.
You can get to the Workflows section in the Twilio Console by going to TaskRouter > Workspaces > Click on your only Workspace > Workflows.
You should see one existing workflow, called "Assign to Anyone", which is the Workflow that routes any new Tasks to the Everyone Queue.
Click on Create new Workflow at the top of the page.
Under Properties, complete the following details:
Task Reservation Timeout: 20
You can leave Assignment Callback blank. You would use this field if you were building custom logic with a separate application for how to handle accepted Tasks.
Then add two filters, which tell the workflow how to direct incoming traffic. Under Edit with UI, click +Add a Filter.
First, add the Sales filter. This looks for any incoming Tasks that indicate they require the Sales Skill and route them to the Sales Task Queue you created. Complete the following pieces of information:
"Sales" IN task.skillsNeeded
.
Next, create a new filter for Support. Click on +Add a Filter again and fill out the following information:
"Support" IN task.skillsNeeded
.
Finally, click Save at the bottom of the page to save this Workflow.
You have now created a TaskRouter Workflow. When you send an incoming call to this workflow (which you will set up in the next step), it evaluates the incoming Task, looks to see whether it requires the Sales or Support skills, and routes the Task to the appropriate Queue if so. You set the default timeout value to 20 seconds, meaning that TaskRouter waits for the first reserved Agent to accept the task for 20 seconds before moving on to the next available Agent.
You can add additional filters to Workflows beyond Skills filters and can add a number of attributes to Tasks to route them appropriately. Learn more about what's possible with the TaskRouter Expression Syntax here.