Skip to contentSkip to navigationSkip to topbar
On this pageProducts used

Customer Support Menu with WhatsApp and Twilio Studio


With Twilio Studio, you can build a Flow to start quickly responding to customer support inquiries over WhatsApp.

In this tutorial, we'll build a Studio Flow that provides a traditional customer support menu via WhatsApp and lets customers respond with their choice. Users can initiate a message to your WhatsApp number by scanning your QR code or sending a message to the number directly. At the end, you'll be set to:

  • Provide a customer support menu to start responding to the most common queries. You can use this as a base to build out your customer support presence and increase customer satisfaction.
  • Publish your custom QR codes at your physical locations and on products. Customers can scan these QR codes to quickly interact with your business on WhatsApp.

Prerequisite: A registered WhatsApp number

prerequisite-a-registered-whatsapp-number page anchor

You will need to have a WhatsApp number registered as a sender. For instructions on how to do this, please refer to the WhatsApp onboarding tutorial.

(information)

Info

The onboarding guide includes a section on registering message templates. For this tutorial, you will only be responding to incoming messages right away, so you do not need to have message templates approved.


We'll start with a fresh Twilio Studio Flow. Log into your Twilio account and navigate to the Studio Dashboard(link takes you to an external page), then tap the + icon to create a new Flow. A "Flow" is the series of Twilio elements and applications that you orchestrate through Studio.

You can name your Flow anything you like — this example will use Customer Support.

Customer Support Flow.

You'll notice that the Studio Canvas comes with a Widget already in place. That's the Trigger (Start) Widget, which kicks off the Flow when the trigger that is specified is fired.

Connect your WhatsApp Sender to your Studio Flow

connect-your-whatsapp-sender-to-your-studio-flow page anchor

Next, connect the Studio Flow to your WhatsApp number ("Sender"). Click on the Trigger (Start) Widget and locate the Webhook URL field in the right-hand menu. Copy that URL to your clipboard.

Twilio Studio Tutorial WhatsApp Customer Support Trigger Widget with webhook shown in configuration panel to the right.

Next, navigate to your WhatsApp Senders(link takes you to an external page) in the Twilio console. Click to select the sender that you want to use with this Studio Flow. Paste the Webhook URL that you copied from your Studio Flow into the field Webhook URL for incoming messages. Don't forget to click Update WhatsApp Sender.

Now, any time you receive an inbound message on your selected WhatsApp-enabled sender (number), it will be routed to your new Studio Flow.

Update WhatsApp sender webhook URL.

Create your automated responses

create-your-automated-responses page anchor

Now that you have a Studio Flow, you need to create a menu of options and respond to each option with a custom response. You also need to define a few additional triggers to give your end-users the option to reach a human.

Respond with a menu of options

respond-with-a-menu-of-options page anchor

First, capture the messages that come into the Studio Flow and respond to them with a menu. You'll start by setting the trigger in the Trigger (Start) Widget to be an Incoming Message.

Twilio Studio Tutorial arrow pointing to Incoming Message trigger on the Trigger (Start) Widget.

Studio lets you parse incoming messages in a variety of ways. For your customer service Flow, you are going to parse the message body using a Split Based On... Widget to figure out what our end-user wants to do.

Drag the Split Based On... Widget onto the Studio canvas and connect it to the Incoming Message trigger by dragging the dot to the upper left corner of the new Widget. Using this Widget, you'll define the conditions to respond to the message. First, let's define what we want the menu response to be.

Twilio Studio Tutorial WhatsApp Customer Support Split Based On Widget connected from the Incoming Message trigger.

An end-user often starts their message by saying "hi" or "help." However, you cannot always predict what their message body will say, so you will respond with a main menu of options if the message body doesn't match any of the conditions. To do this, first drag the Send Message Widget onto the Studio Canvas.

Next, connect the Send Message Widget to your Split Widget when "No Condition Matches".

Finally, click on the Send Message Widget (In this example it has been named welcome) and compose your menu message in the Widget's Message Body field. Feel free to create as many options as you'd like. It is recommended to number each menu option so that customers can easily reply with the number of their choice. The message in this example can be copied from below.

1
Thank you for contacting us on WhatsApp for support! Please reply with one of the options below to tell us how we can help you.
2
3
🌐 1. Locations and Contact
4
🎁 2. Offers Available
5
📦 3. Return Policy
6
⛑ 4. COVID-19 Information

Tip: Add some emojis to make each option stand out more and to make your customer service bot feel more welcoming.

Twilio Studio Tutorial WhatsApp Customer Support Send Message Widget placed on Canvas with configuration panel shown on right with custom message.

You can now test this first version of your Studio Flow. Click Publish in the top right and send a message to your WhatsApp number. You should receive a response with the message you just defined. Give it a try and come back (We'll be here)!

Create a response for you first option: Locations & Contact

create-a-response-for-you-first-option-locations--contact page anchor

Next, we need to create a response for our first menu option, "1. Locations & Contact". To do this, we parse the message body, and if it is "1," we send back a response for that option.

To make your first menu option message, drag a new Send Message Widget onto the Studio Canvas and write your response in the Message Body.

Tip: Studio flows can quickly get complex. To keep things organized, name your Widgets! We are naming this widget option_1.

Next, click on the Split widget, and in the right-hand menu, click "Transitions". Create a new condition by clicking the "plus (+)" button in the New Condition box. You will see a condition appear "If Value Equal_To...", up at the bottom of the menu. Here, select Matches Any Of and define your trigger criteria in the box immediately below.

Twilio Studio Tutorial WhatsApp Customer Support Split Based On Widget added transition for option 1.

Make sure to provide a path to human escalation

make-sure-to-provide-a-path-to-human-escalation page anchor

For our match criteria, you are going to add the following triggers: "1, help, human, agent, support, location, address". Any of these terms will trigger the option that you just created.

WhatsApp requires that every bot provide an escalation path to a human agent. This ensures that your end-users always know how to reach a human. In the response, be sure to provide your support email or number to create a better experience and fulfill WhatsApp's rule.

Twilio also lets you route requests to your team of live agents and respond within the same WhatsApp conversation. For this, explore TaskRouter and Flex for these feature-rich versions of your bot.

At this point, you can test out your new menu option by sending a message to your WhatsApp sender.

Create responses for the rest of your menu options

create-responses-for-the-rest-of-your-menu-options page anchor

You can now use the same approach to create custom responses for each of your options:

  • Create a Send Message widget for each response
  • Define a Condition in your Split widget with the appropriate triggers. It is recommended to keep simple numerical triggers: 1, 2, 3, 4, etc.

Once you are done, here is what the flow will look like with four menu options:

Twilio Studio Tutorial WhatsApp Customer Support Full Menu Selection Flow.

Once your bot is done, test it out by sending messages with different options to the number.


Launch with your QR Code

launch-with-your-qr-code page anchor

Once you confirm that the bot is working, you can publish QR codes to help customers reach out. Twilio and WhatsApp provide custom QR codes that generate pre-populated WhatsApp messages of your choice. This makes it easy for your end users to open the WhatsApp application without having to type in a number.

Here is an example of what a QR code looks like; feel free to scan it:

1PWEXOAZZUEZVB1_J1ZJgq1.original.

To get a custom QR code, open a support ticket, as described in our article on rich messaging features in WhatsApp.

And with that, you're now ready to launch with your new customer service flow with WhatsApp.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.