How to Create an Automated Flow for a WhatsApp Chatbot

Available with a paid pricing plan, as well as during the 7-day free trial

The flow builder is the main tool to set up your bot to welcome new subscribers, assist users, sell products, and notify a manager about users’ questions in the chatbot. Also, a chatbot can gather information and send it to your system for future use.

All you need is to create keywords, design the bot’s structure, and drag-and-drop elements in the SendPulse flow builder.

Below you can find a detailed table of contents. Use it as a map for comfortable navigation to find all of the possible triggers and elements to get started adding them to your bot’s flow.

Choosing a Trigger for Your Flow

By default, there are “Welcome message,” “Standard reply,” and “Unsubscribe from bot” flows. And you can create your own new triggers to get more functionality.

Choose your bot. Navigate to the “Bot Structure” tab and choose a trigger.

Welcome Message Flows

The flow starts after a user subscribes to your chatbot — i.e. after entering the /start command or via subscription widget.

Users can subscribe by following a link to your WhatsApp link https://wa.me/id.

This flow introduces your bot to users. Here you can write a little about your bot and its features – how the bot can be useful, what information the bot can provide, how often the bot will send messages, and the content of those messages.

Standard Reply

The flow will launch in response to any user question that is outside your bot’s scenario, or by sending an image to a bot. Here you can add a message with information that a manager will contact them during business hours and reply to the user.

You can set up a cool-down interval for launching a flow that is between 1 minute and 24 hours — so your bot won’t launch a second time within the specified interval.

Unsubscription from Bot

This a flow with one message element that will launch after a user unsubscribes using the /stop or /unsubscribe command.

Catalog Order

The flow starts when you receive an order from the product catalog if you have created it in the Facebook Commerce Manager.

By default, the "Action" element is added to this flow with the "Notify me" action and an automated reply to your subscriber.

Read also: How to Add a Product Card in a WhatsApp Chatbot.

Trigger Flow

You can add keywords — triggers, that your bot will react to and launch your flow.

Click “Create a new trigger.” Write your command using one or several words. For example, you can use the words “Order,” “Tickets,” “Price,” or “Delivery.”

If the user enters a part of a keyword linked to your command, your bot will suggest prompts such as a button with the name of your trigger. When the user clicks the button, the flow will launch.

You can also restrict the callback for a specific period of time.

Learn more: How to Manage Chatbot Flow Triggers

After creating the trigger, click Create flow and start editing it.

Building Your Flow

It’s important to think about the architecture and logic structure of your bot carefully. A well-designed bot will let users easily get a reply to their questions or place an order successfully by providing the necessary information.

Formulate the bot’s tasks, divide its functions into sections, think of how you will connect the elements, and start creating your bot’s flow using our drag-and-drop builder.

Start

You can choose the first element that launches your flow: "Message," "Filter," "Randomizer," and "API Request."

For example, using the "Filter" and "API Request" elements, you can check the subscriber's data and personalize your communication by starting your flow only for those users who have or do not have the requested data or branch your flow and send different messages. Using the "Randomizer" element, you can diversify your chatbot's auto-replies or create an A/B test.

To make an element a start element, connect the desired element to the “Start.”

To see which trigger starts your flow, click on the "Start."

The “Message” Element

You can create regular messages or send template messages. Regular messages can be sent only within 24 hours after the last message is sent by the user, while template messages can be sent anytime.

Regular Messages

Using the "Regular message" type, you can create a message of any type and add various blocks to it: text, video, gallery, buttons, user data request, and so on.

Go to the “Regular message” tab, and start adding elements.

You can add the “Message” element to any part of your flow. For example, in the last block of your flow, you can thank your users, confirm their order, and send information from your gathered variables, asking if the information is correct.

Text

Within the “Message” element select the text element type and add the text of your message. Also, you can add emoji and variables to personalize your messages.

To add a variable click {} in the right corner of the text block and choose the variable you want to add from the drop-down menu. If you have a value for this variable in the user’s contact information, they will receive a message with the value filled in.

You can add the following types of variables.

Custom variables for contacts You can transfer variables when a user subscribes to your chatbot. Set and update variables manually in the "Audience" section. Set and update variables automatically in a flow using the "Action — set variable," "User input," and "API request" elements.
System variables You can insert the text of the last message from your subscriber using the last_message variable. You can also add a subscriber ID using contact_id.
Global variables You can create your own variables in your bot settings and use messages with predefined values that will be shared with all of your subscribers. By default, $bot_name, $bot_id, and $current_date are available.
Button

To connect "Message" element with other elements in your flow, add a button or user input element to the message element. This is one of the most important elements for communicating with your users - buttons engage users and let them chose a direction for your bot to take them to the next part of your flow.

To add a button, click + Add button. You can add up to 3 buttons.

Name your button in the first field. Note, you are limited to 20 characters. Also, you can add emoji to the button’s text.

The text on the button should be easily understandable - it’s important for users to understand what will happen when they click on the button and know what specifically they need to choose. Make sure that the next element in your flow corresponds to what the button says it will do to maintain the logic of your bot.

Select a button type: "Button," "List," or "Payment."

List Button

You can add a list button that opens a list of clickable options. Press "List," enter button text, a section name, title, and description.

You can add up to 10 items. You can place all the elements in one section or make 10 sections of 1 element each.

Please note that in one "Message" element, you can add either one list button or up to three regular buttons.

Payment Button

To accept payments for goods or services, select the "Payment" button type, and configure it as follows: select a payment system, and enter a payment amount and the name of your product.

The process of sending payment forms via WhatsApp chatbots is different from other channels. When a user clicks the payment button, your bot will not automatically open the payment page, but will send a payment link in a separate message. The user needs to follow the link and pay using a selected payment system.

Images

Diversify your messages by using visual content that relates to your text.

Click on the Add button and choose the "Image" element. Click the Select file button to upload an image from your computer or device, or drag and drop a file into the upload field.

There are no limitations to the size of the image, but note, that the image resolution for WhatsApp will be 500 px in width and 200 px in height.

To upload an image from a link, select "Upload image by URL" in the drop-down menu and specify the link to the image in the field.

You can also specify a dynamic path to the image. For example, using the "API request" element or an a360 event, launching the flow via API, you can send a product picture and use this variable in the following message, displaying order data to the client.

To do this, select a variable or specify a JSON path in the field and pass the path to the image in the variable's value. Thus, each client will receive an image according to their order.

File

You can add files in any format, except executable files, up to 20 MB in size. Attach tickets, checklists, certificates, checks, instructions, or other additional materials.

Click Choose File to upload a file from your computer or device, or drag and drop a file into the upload field.

To upload a file via a link, choose “Upload file via URL” from the drop-down menu and specify the file’s link in the field.

You can also specify a dynamic path to the file. For example, if you use the API Request element, or launch a flow from an A360 event or via the API request, you can send a file and use this variable in the next message when displaying order data to the customer.

To do this, select a variable or specify the JSON path in the field and pass the file path in the variable value. Thus, each customer will receive a file linked to their order.

Product Card

If you have a catalog with products configured in Facebook Commerce Manager, you can add a card or a list of products.

Click "Add" and select "Product." Enter the Catalog ID, Product ID, message body, and footer.

To add multiple products, divide the products into sections.

Learn more: "How to Add a Product Card in a WhatsApp Chatbot."

Video and Audio

You can add video and audio files (up to 5 MB each) to your messages. For video files, you can use the MP4 and 3GP formats, and for audio files, use the AAC, MP4, MPEG, and AMR formats.

User Input

You can gather information from users and save it to a variable for future use. Users can enter any value, and you only need to set up the type of validation for this value, e.g., string (for text values), number, date, phone number, email address, URL, regular expression, geolocation, or image or document.

Click the “Add” button and choose the “User input” element. Choose the validation type, add a warning message for users who enter the wrong value, and choose the variable where you want to store information.

Learn more: How to Add a User Input Element.

The received email address, phone number, and other user data are saved in the automatically generated mailing list from our Email service.

You can also choose the period to wait for a response from the user. If the user does not respond within the selected time, the wait for a response from the user will expire and the chatbot will no longer check the entered data for validity to record user's response.

Also, under the message, you can add quick replies buttons so users can choose from predefined responses instead of typing their own.

 

You can divide your scenario and send the next message, depending on whether the user entered the requested data (green dot branch) or not (red dot branch).

Moving Elements

By default, each element you add is placed at the end of the message element you are working on. Hover on the element that you want to move up or down and click on the corresponding button.

Template Message

Using the "Template" message type, you can send transactional message templates that were approved by Facebook.

Go to the “Template” tab, and choose a template.

If you added variables to your template, select them from the dropdown menu where suggested. Each user receives a message with a value for their contact from the "Audience" tab.

If you added an image to your template, select the file from your device.

Continuing the Flow

You can connect the next element after the "Message" element using the button or the "Input" function. You can also continue your flow without waiting for the user's response.

Learn more: How to Continue a Chatbot Flow without a User Action

Connecting Elements

Drag a line from the blue drop of one element to another element to connect them.

Click on the line twice and you will see a button to remove a connection.

The disconnected elements will be highlighted in yellow, remember that you need to link it to another element.

Elements with empty fields will be highlighted in red, reminding that you need to fill in fields. For example — if you added a button but did not enter text for it or used a link element but did not enter a URL. You cannot save your flow until you fill in these fields.

A “Flow” Element

You can simplify your bot’s structure and move your user to another flow.

To do this, add an element, then choose the “Flow” element and select the flow you want to link from the drop-down list.

The “Flow” element will be the last element in this branch of your existing flow. You cannot link it to another element to continue the original flow.

An “Action” Elements

The Action element is visible only to you. Select the element in the panel on the left and drag it after the block you're tracking.

Then select what action you want to create:

Open the chat Open a chat with a subscriber in the "Conversations" section
Unsubscribe from the bot Unsubscribe a user from bulk and automated messages
Add or Remove tags Assign a tag to a subscriber, remove a tag assigned to a user
Add variable Set the variable value to be assigned to the subscriber or updated. You can also create a new variable
Send webhook Send a POST request with user data to your URL
Create deal Create a deal in your CRM when a specific action is performed, for example, clicking the "Buy" button
Notify me Send a message on behalf of your chatbot to the system chatbot or Telegram group

A "Filter" element

Segment customers based on their personal data and previous messages received. Select the element in the left sidebar, and drag it after the element that will start your script branching.

Then select the condition itself. Combine conditions by adding the operators “any” or “all,”, or add independent additional conditions.

Read also: How to Use the "Filter" Element in the Chatbot Flow Builder.

After adding conditions, add the additional flow elements to each of the Filter element options if the condition is met (green dot) or not met (red dot).

An “API Request” element

Send requests to a third party server to create objects or retrieve data. Get data and use it in your chatbot messages.

You can save the received data to a variable or add it to a message as JSONPath.

Drag the "API Request" element to the workspace, connect it to the element, after which you want to retrieve data. Select the type of request and enter the URL to send the request to.

After testing the request and receiving a successful response, configure the mapping settings. If you need to save the value from the response to a variable, select the key from the received request and the variable to save to. If you want to use the received value once without saving it to a variable, copy {{$ ['somekey'] ['nestedkey']}} and use it in the next message element.

Read more: How to Send and Receive Data from External Sources

A “Pause” Element

This is the period during which no automatic messages are sent to the subscriber. The pause can be set in minutes, hours, or days.

You can choose to pause in between using the "Time period" option or until a specific time using the "Till Time" option.

Select the "Time period" option and set a pause between sending flow elements from 1 minute to 24 hours. Use it in a flow, for example, to warm up a client. After the specified time, the next message will be sent.

Please note: WhatsApp only allows the following message to be sent after user interaction for 24 hours.

If you select a pause of more than 1 day between elements, you can set the time at which the message will be sent. The system considers the next day any time after 00:00 according to the time zone set in the settings of your personal account.

Also, you can select "Till time" and set a delay until a particular time. For example, you can use this option to indicate business hours or promotion hours.

Also, using the "Pause" element, you can set the condition for executing the next element of the flow: always or when the subscriber is inactive.

A "Random choice" element

Send elements from your chatbot script at random for A/B testing, creating quizzes, and more. You can customize the size of the recipient group for each option and send random information and test different chatbot scenarios.

Drag the item "Random choice" element to the working area, connect it to the item you start branching the script from.

Adjust the ratio for each option — the percentage of users that will receive each option, or split the flow into equal parts. The higher the value, the more users will get this option.

Save and Launch Your Flow

When you finished creating your flow and have looked over all of the elements, save your flow before exiting. Click Save and send it to yourself to test the flow and check if everything is working correctly.

You can also save an updated version of the flow while leaving the current version unchanged. To do this, click Save as a new flow. The new flow will be saved in the "Flows" section.

Note: your flow must have at least one "Message" or "Action" element.

After that, you can exit your flow by clicking Save and exit.

Analyzing Your Results

Sendpulse allows you to track general statistics on a chatbot in the "Statistics" tab.

You can see the number of messages sent and read, redirections from the flow, both in total and separately for each message in the "Bot structure" tab.

In the statistics section, you will see the number of list button clicks and the list of subscribers who clicked it.

    Rate this article about "How to Create an Automated Flow for a WhatsApp Chatbot"

    User Rating: 5 / 5

    Popular in Our Blog

    Try creating a chatbot for Facebook Messenger for free