Route callers to a human only when it’s completely necessary by setting up an intelligent IVR with Twilio Studio and Flex. Automated messages can address simple questions such as business hours or location, freeing up your agents to handle more specific inquiries.
You’ll need a few things before you can get started:
- A Twilio account
- An instance of Twilio Flex
Navigate to the Studio section of the Twilio console and select the Voice IVR flow.
You’ll notice that the canvas comes with two widgets already in place -- the Trigger widget, which kicks off our Flow when the trigger we specify is fired, and the Send to Flex widget. In this case, our trigger is going to be an Incoming Call. The Send to Flex widget should be preconfigured to route calls to your Flex instance.
In order to build our IVR, we're going to disconnect these widgets and add a few in between. These new widgets will comprise the branches of our phone menu.
Drag a Gather Input On Call widget onto the canvas and connect the Incoming Call trigger to the dot in the upper left corner of the widget. Type the message you’d like to play for your users:
Thank you for calling. For our business hours, press 1. For our location, press 2. To speak with a team member, press 3.
We’re only going to accept keypress inputs in this sample, so let’s rename the widget to
gather_digits. Save the widget.
Next, drag a Split Based On... widget onto the canvas and connect it to the dangling dot under “User Pressed Keys” in your Gather widget. In the widget configuration panel (on the right sidebar), select the Digits response from the Gather Input on Call widget as your variable to test.
The next step is to configure the branches of our IVR. Tap the red New at the bottom of the Split widget to reveal the Transition On... dropdown menu. Select Condition Matches to create a new Transition.
In the right sidebar, find the new Transition that you just created, and select Equal To from the dropdown. We’re going to set this value to 1, to hear our office’s business hours. Save the new transition and it will appear on the widget.
Drag a Say/Play widget onto the canvas, and type in the message you’d like to play when a caller presses 1. In this case, we’re sharing our regular business hours.
Repeat the steps above to set another Say/Play widget to a keypress of 2, and enter the message you’d like to play. In this sample, we’re playing a message about our office’s address.
Now, let’s handle the “speak with a team member” case. In order to enqueue a call for Flex, we’ll reconnect the Send to Flex widget that came with the flow. Connect it to the “No Condition Matches” dangling dot from the Split widget.
Your final canvas should look something like this:
Publish your flow, and it will be live on your Flex phone number.
Now it’s time to test it out! Dial your Twilio number, and listen for the initial menu prompt. Select the option of your choosing from the IVR, and watch along in Flex as callers who press 3 are routed to your agent!