How to Create WhatsApp Bot For Your Business & Test It in Real Time!

Jiaqi Pan
CEO, Landbot
Illustration: Jana PĂ©rez

Since the launch of WhatsApp Business API, companies have been competing to create a WhatsApp bot to enhance their customer experience. Thanks to the Landbot no-code builder, you can do just that quickly, cost-efficiently and without coding. This article will guide you through the process step-by-step!

What is a WhatsApp Bot?

A WhatsApp bot is an automated conversational software integrated with the messaging app using WhatsApp Business API. Chatbots on WhatsApp can be rule-based (more practical and structured) or use NLP (natural language processing) for a more natural conversational effect.Its major advantages include:

  • Being able to communicate with the customer base promptly and asynchronously (at a time most convenient to the customer);
  • Getting in touch with customers in their comfort zone (an app they use daily)
  • Delivering a personalized experience with every interaction.

Besides customer support, a Whatsapp bot can be used for lead generation and sales, product recommendation, customer feedback collection, booking, internal company communication, and so forth. Industries most likely to profit from a WhatsApp chatbot include real estate, travel & hospitality, finance, education, and eCommerce.

Who Can Build WhatsApp Bots?

Since the launch of WhatsApp Business API back in August 2018, a wave of excitement swooped over the marketing world.

Though not everyone was instantly eager on the idea, seeing the 1.6 billion WhatsApp monthly users in 2019 did the trick.

‍In 2020, the stats are ever more convincing showing WhatsApp's MAU reaching an incredible 2 billion.

‍Promising WhatsApp statistics were hard to ignore once the messaging app opened for business.However, the API key is not up for grabs just for anyone.

The whole service is still in the BETA stage. Hence, Whatsapp Business API, still not open to the public, requires businesses to pass through an application process that currently prioritizes medium and large and enterprise businesses in specific industries.

In this sense, even the vaguest of WhatsApp Business articles are right. Before you can grace your audiences with an official WhatsApp chatbot, you need to:

Without completing these two steps launching your chatbot won’t be possible whether you are doing it solo or using a chatbot solution like Landbot.HOWEVER!There’s a way you can build and test a WhatsApp bot BEFORE that process is complete!Just continue reading if you are interested in how it works…

How to Create a WhatsApp Bot without Coding & Test As You Go

To be able to follow this tutorial, naturally, you need to create a free account with Landbot.

‍Landbot is a verified WhatsApp API solution provider working with Zendesk's Smooch. It's also the best chatbot maker for the job since it doesn't require any coding.

Don’t worry, the initial signup is completely free, no credit card is required and a 5-day free trial will enable you to get access to try out all the features and learn how to make a WhatsApp bot without coming anywhere near a single line of code.


Answer the signup questions to personalize your experience.


And, once you are done, let the sign-up process take you straight to the builder for a little tour and intro to the builder.

landbot-tutorial-whatsapp-chatbot builder

Whether you take the tour or skip it is up to you. But it’s a good way to get familiar with the drag and drop workings of the builder which looks and is the same whether you are building a web, Facebook Messenger, or WhatsApp bot.After the tour, exit the builder and go to the main dashboard.

NOTE: This tutorial explains how to create a rule-based WhatsApp chatbot using a decision-tree-like structure powered by integrations. If you are interested in creating an NLP-based AI assistant, check out our guide to building Dialogflow WhatsApp chatbot.

  • 1. Set Up WhatsApp Bot Canvas

There are two ways you can start building a chatbot for WhatsApp Business.Firstly, you can simply click on the “Build a Chatbot” button in the upper right corner and select WhatsApp as the channel and go straight to the building.


Secondly, you can start by connecting your phone number to Landbot and creating your own personal WhatsApp Business Testing channel.Click on the Channels icon on the left side of the dashboard.


Next, click “Try it for Free” and before you enter your phone number, accept terms and conditions:


Insert your phone number with country code and click “Confirm”.


Once your number is approved and test channel created, click open the section “Linked Bot”


You will notice there is only one “WhatsApp Testing - Bot” available on the list.

This is only because you haven’t created any WhatsApp bots yourself but as you go and create more, you will be able to link and test any of your chatbots.For now, select the default testing chatbot and press “LINK BOT”.


Save changes.And… soon you will receive a message on your WhatsApp, from the chatbot you’ve just selected.


Go on and chat with it a bit!

Though, when your attention is back at the desktop, you are ready to go to the main dashboard once again.There, you’ll notice, a new (WhatsApp) bot appeared on your list.


  • 2. Start Building the WhatsApp Bot

Click on the chatbot and enter the builder.

First, you will see a little disclaimer that not all Landbot features are usable in WhatsApp because of the restrictions of its interface. This concerns UI related features such as button responses.


Click “Got it!” and behold, in front of you is the humble anatomy of the bot with which you just chatted on your WhatsApp.


You can check out this flow and play around with… though in this tutorial, I’ll delete the pre-designed demo and start from scratch to show you some of the best WhatsApp bot features for the ultimate flow.

  • 3. Create Your First Block

As an example, I will throw together a simple product survey chatbot as it makes it easy to demonstrate a variety of features.

So, as a starter, you need a conversation opener, you can kick off with a question or a message as I did below:


As you can see, instead of simply saying the impersonal “Hi there!” I am using @name variable to pull the user's real name.


When people opt in to communicate with you via WhatsApp, besides their telephone number, you also get access to their WhatsApp name. Hence, you are free to personalize from the beginning.

  • 4. Ask a Question (Text)‍

The first question type I will share with you is a simple open-ended question.Drag an arrow from the green point of your message block and select “Text Question” from the menu:

The “Text Question” block has two fields the configure:

  • The question
  • The variable under which you want to save the user’s answer

Since at this point the answer doesn't really contain important information and is more of a customer engagement prompt, I left the variable on the default "@text" setting.

  • 5. Ask a Question (Number)

Next, I wanted to know the age of the user, as I don’t want to collect data of those under age.When you want to collect a numerical answer, the best question block to choose is “Number” - naturally.


Since I will be asking for users' age, I will create a new specific variable to capture this data.To do that, just type the desired name of the variable and click “CREATE”.


Note: If necessary, you can further customize the “Number Question” block by activating the “Advanced Options” field. It allows you to set min and max values as well as prefixes or numeric formats


  • 6. Set Up Conditional Logic

Let’s say I want to differentiate between people who are 18 and over and the rest. To do that, all I need is setting up a condition that will split the conversation flow into two branches.

Draw an arrow from the last block (age) and select “Conditions” from the blocks menu.In this case, I want to condition the @age of the respondent so I select it as the variable to condition. Next, you can choose what kind of condition to apply:

  • Equal to
  • Not equal to
  • Contains
  • Greater than
  • Less than
  • Is set

I selected, “Greater than” and set the last field to “17” so my condition looks like this:


IF @age is GREATER THAN 17 - meaning the condition is “TRUE” (green output), I will allow the respondent to continue. If it is “FALSE” (pink output) they will take a different path:


For the negative output, I chose a simple message block to inform the user he or she can’t participate in the survey and used the “Close Chat” function to mark the conversation as closed/locked in the system.

  • 7. Ask a Question (Buttons)

I know, I know… I did say the WhatsApp interface doesn’t allow the use of buttons. However, that doesn't mean you have to give up the idea of giving your users set choices completely!“Button” options questions are possible.

The only difference is that on the WhatsApp interface, the buttons will appear in the form of a numbered list (see example below).


Now, l asked my survey participants about their experience with tech to assess their background. Since there are no buttons in WhatsApp UI, like in the example above, I gave my users a little hint on how to proceed:


To save the user answer in the Button question under an easily recognizable variable, click on the three dots in the upper right corner of the block:


So, when the user types in the number 1, 2 or 3, each answer can take them down the same or a different path based on the answer.


BUT as you may have noticed, my little hint didn’t just say numbers. It also mentioned the option of typing “one of the words in bold”(You can notice some of the words in the button answers are surrounded by ** so they appear bold on the WA interface).

‍This brings me to another cool feature I wanted to show you.

  • 8. Set Up Keyword Jump

The keyword jump recognizes a specific word or a phrase in the user’s natural input and uses it to progress down a specific path.To set up a Keyword Jump, draw an arrow from the purple DEFAULT button, and select keyword jump from the list of blocks.


First, I choose the variable under which to save the response.In this case, I chose to use the same variable as for the Buttons - @tech_profile - as it concerns the answer to the same question, just in a different format.Next, I simply add the keywords I highlighted in the buttons:


Tip: If you don’t want your users to be constricted by the options completely and risk losing interesting data, you can add an “other” option to the Buttons and Keyword Jump and follow it with an open-ended question block to collect the user’s own definition.

  • 9. Set a Variable

At this stage, the survey participant would have shown me his or her tech background. However, the answers in the buttons are too wordy and I want to differentiate the tech profiles with simple labels.

It’s time to use the “Set a Variable” Block. This one allows you to assign a specific value to your variable. (If your variable is numerical, you can even use it to make calculations!)I used the block to assign a simple tech profile label.


As you can see in the image, the first button choice and the keyword corresponding to the first button choice both point to the same “Set Variable” block which sets the value of @tech_profile to “Techy”.

‍I repeated the process for each option, assigning “Works in Tech” value to the second option and “Uses Essentials” to the third option.


  • 10. Add Media

Although WhatsApp doesn’t have any of the fancy buttons and carousels of web or Facebook Messenger chatbots, you can still have fun with content formats and use videos and images to help your cause.

After setting the individual values for @tech_profile, I wanted to bring the survey back to unified flow so I set the arrows from each “Set Variable” block to flow into the same “Message” block.


The message block is pretty flexible. It does not only the messages you can share with it, since when you click on the “MEDIA” option, but you will also be able to easily upload a file, share a YouTube video or share a GIF or an image.


Of the options available, I chose YouTube and just copy-pasted the link of the video I want my bot to share.

Then I added a simple prompt asking the participants to watch the video before proceeding to answer the rest of the questions.


Next, I followed the video with three open-ended questions using the Text Question blocks, making sure each answer has its own variable.


  • 11. Export Collected Data: Google Sheets

Before being able to integrate a Google spreadsheet into your WhatsApp bot, you need to create, well, the spreadsheet on your Google Drive.I created a simple sheet to collect all the data by WhatsApp bot asked about in the conversational survey.


When you have this ready, go back to the builder, draw the usual arrow and select “Google Sheets” integration from the list.


Click “Add Account”.A new tab will load asking you to give Landbot access to your Drive.Once done, the account will appear inside the integration.


Click on the “Select the Spreadsheet” and choose the one you want to integrate from the list:


After that, the builder will ask you to also indicate a specific sheet within the selected spreadsheet which can come in handy if you have multiple ones within a single spreadsheet.

When that is all done, it’s time to configure the action I want to carry out:


There are three different actions available. I can insert new data, update data or retrieve data. For the survey use case, I selected “Insert a new row” since every new submission will be new data.

Last but not least comes the fun part of pairing column names with the variables under which you stored user answers:


Just keep pressing the PLUS icon until you have assigned all the variables to their designated columns.That is it!

  • 12. Send Your Team an Email Notification

If you want to be informed about the success of your survey (or maybe a sale or an incoming support ticket), Landbot’s let’s you quickly set up an email notification.Draw an arrow and select the “Send an Email” option from the block menu.


First, decide if this email notification will go to a team member or the user. I wanted to receive a notification about the survey submission so I chose the “Your Team” option.Next, configure the email address, email subject, and message in the email.

And that is it.

  • 13. Offer Human Hand-off Option

Transfer to a human agent is more typical for FAQ bots rather than surveys but I really wanted to show you how easy it is to set up with Landbot:

So, after I sawed all the data in Google Sheets and sent myself a notification, I thanked the user and offered him the following options using Buttons block once again:


Option one offers access to learning resources, option two a chance to talk to an agent, and option three lets the user put an end to the conversation.

To set up the chatbot-to-human handoff, draw an arrow from the second “Talk to an Agent” option, and select “Human Takeover” from the menu.


If you have more agents, you can assign the responsibility for a specific chatbot to a specific agent. If you don’t assign the takeover to anyone, the bot will select the agent with the least number of conversations automatically. And that is it to be honest.

To account for a situation when no agent is online, I continued the flow with a simple message:


Since the conversation is happening on WhatsApp, the user doesn’t have to wait impatiently on the desktop, so a little waiting time is really not so inconvenient!

  • 14. Set Up Slack Notifications

I have a little bonus up my sleeve!If you don’t have agents sitting on the Landbot platform all-day long you might want to notify your agents when someone wants to talk to them.

Luckily, Landbot can send notifications via the world's most popular business communication app - Slack.

‍You can use it for anything… notifying your sales team about every new lead, a new purchase, new subscription, or notifying agents about new live support tickets.In our example, after the user indicates the need for live agent support, you can easily send a notification to the respective Slack channel:

  • Break the green arrow connecting your “Contact Support” and “Human Takeover”
  • Search for “Slack Notification” block
  • (If not set up already) connect your Slack account to Landbot
  • In the “Choose an Option…” field select one an existing Slack channel or a specific person from whom you want to receive the notification
  • In the field below, enter the message you want to appear in Slack
  • Click save
  • Connect the Slack block with “Human Takeover”

Once again, that is it!Pretty simple right?Right now, all I have to do is define a flow for the other two responses of the button choice question, but you already know the different features I could use, so I won’t waste space on it in the tutorial!

Let’s go straight to the best part - the testing!

  • 15. Test Your Chatbot!

I am only testing my chatbot after I have built the whole flow.But, to be honest, you can do it at any point throughout the creation process, as long as you save your progress by clicking the SAVE button in the upper right corner of the builder interface.

The testing feature is especially handy because it gives you an opportunity to review the final customer experience, check up on integrations, and catch possible errors before launching the bot to your customer base.

My integrations were successful as my spreadsheet updated with submitted answers:


And I received an email notifying me about the submission:

  • 16. Keep Exploring!

Though the features you saw in this article are powerful tools in creating WhatsApp bots, they still only scrape the surface of what you can achieve with Landbot.So, roll up your sleeves and keep exploring… For instance, thanks to the Dialogflow integration, Landbot even allows you to build smart NLP bots without coding.

To Sum Things Up...

WhatsApp chatbots allow you to deal with incoming messages in real-time.

Thanks to smart solutions, learning how to create a WhatsApp bot doesn’t have to be rocket science nor does it have to involve artificial intelligence to be useful business-wise.

The visual editor and builder even allow you to master formerly coder-only skills such as integrating webhooks!

If you are interested in working with Landbot WhatsApp business solution, check out our WhatsApp Solution features or sign up and start shaping the future of chatbots with your own assistant today.

It's time to leave the programmable SMS in the past and revolutionize business-customer communication.

Posted on
September 8, 2020
Want to write for us? Check our guidelines

Like what you read? Subscribe to our newsletter!

landbot logo white
linkedin logoinstagram logo
Copyright © 2021 HELLO UMI S.L.