Flows is a feature of the WhatsApp Business Platform that allows you to swiftly develop and deploy native, task-centric workflows on WhatsApp. This results in enhanced interactions between customers and businesses.
With WhatsApp Flows businesses can design, build and customize their own journeys, which can make chatbot and AI agent solutions better, as well as offer end-to-end experiences.
For users, Flows can improve interactions with businesses on WhatsApp, leading to better task completion and fewer drop-offs than alternative channels.
For businesses, Flows can improve engagement and completion rates, resulting in improved business outcomes.
With Flows, you can:
Present simple input forms (in order to schedule an appointment, for example)
Create workflows that guide users through multiple screens (for ordering products, for example)
Create endpoints that exchange data across screens to enable more complex interactions (such as guiding a user through a process with multiple potential outcomes)
An example of Appointment booking Flow is shown below:
In this documentation, you'll find easy-to-follow guides for Flows integration, API references, explanations of common terminology, and much more.
Leveraging Flows
Flows is built for form-based use cases. You can create Flows to achieve a range of tasks with your customers, including:
Lead generation
Appointment booking
Registration, Sign up, and Sign in
Customer support and feedback
And many more
How are Flows configured and used?
Flows are linked from a Call To Action (CTA) in a message. Flows are composed of:
Screens: When tapping on the Flows CTA in a message, the user will access the initial screen of the Flow. The user can then interact with the Flow to move through multiple screens until completion.
Layouts: These define how components are presented within a Flow, providing a structured look and feel.
Components: You can use components to display information, and to create input fields for your users. You can display information with Text, Images, and Embedded links. You can create input fields for your users to complete using Text Inputs, Dropdowns, Checkboxes, Radio Buttons, Opt-in, and Date Pickers.
Flows can be attached and sent as Business Initiated Messages (Template Messages), as well as standard messages (Session Messages).
Lifecycle of a Flow on Meta Dashboard
Flows on the WhatsApp Business Platform undergo various states, each signifying different functionalities and restrictions. Here's a breakdown:
Business-Set Flow states: These states are the default states through which the Flow passes.
Draft State: A Flow is actively being modified.
Capabilities: Can be sent for testing; can be deleted if no longer needed.
Next States: Deleted (if in Draft state), Published.
Published State: Ready for deployment to real users.
Capabilities: Cannot be modified or deleted to maintain consistency.
Actions: Create a new Flow based on the existing one (using clone_flow_id) or deprecate it using the /deprecated API call.
Next States: Deprecated, Throttled.
Deprecated State: No longer sent to real users; still visible on users' devices.
Actions: None (terminal state).
System-Set Flow States:
These states are internal states set by the system. Businesses don’t have any control on these states.
Throttled State: Flow limited to 10 messages/hour due to endpoint issues.
Actions: Open a support case via the Support Portal for assistance.
Next States: Published, Deprecated, Blocked (upon further deterioration).
Blocked State: Flow cannot be sent or opened due to severe endpoint issues.
Actions: None (terminal state).
Understanding these states is crucial for developers, ensuring smooth interactions between businesses and customers on WhatsApp.
Steps to be followed
Pre Requisites
The WhatsApp business number should be onboarded to the Exotel console.
The WhatsApp number should be hosted either on On-Premise or Cloud API.
You have configured the webhook for the phone number to receive the callbacks.
An example webhook is shown in the figure below:
In case you are using our WhatsApp APIs, you need to integrate the updated Flows request and response for the Send Message API (for sending new type of session message and Template message) with the new callback formats.
Please refer to the developer documentation here.
Note: You can now configure a chatbot and start using the WhatsApp Flow feature to send automated flow messages.
Create Flow
There are 2 ways to create WhatsApp Flows:
Use WhatsApp Manager
Use the Flows API
We are currently using the first approach above to create Flows. WhatsApp Manager contains two options to create Flows:
Inclusion of Flows while creating Message Templates
Using Flows Builder under the Account Tools section
Option 1: Inclusion of Flows while creating Message Templates
Step 1: Create Your Flow Template
Login to your Exotel account and click on the WhatsApp option from the left side menu.
Navigate to the WhatsApp Flows option from the Left Side Menu and click on Meta Dashboard link for the Template with Flows section.
It will open the WhatsApp Business Manager portal in the new tab, search and open your valid WABA account from top right corner. In the WhatsApp Manager of your WhatsApp Business Account, select Account tools on the left-side menu and then click Flows.
Click on the Create Template button and Select the Category as Marketing and the type as Form.
Fill the basic information details for the template, the steps remain the same as the Exotel console like template name, and select language. Click on Continue.
Fill the other template details like Header, Body, Footer with samples and navigate to the Buttons section where you need to provide the Button Text and select the Type of the form (you can select the relevant use case to get a pre-filled form) and click on Create.
It will open an UI and within this UI you can create Flows using the drag and drop Form Editor, without having to write any Flow JSON code yourself.
After you create and submit a Message Template with a Flow attached using this UI, you can send it to your users once it is approved by Meta.
Below is the reference video for a Lead generation use case form with the template which will help you!
Creating Flows in Message Template Creation
Step 2: Sync the Exotel Template Console
Go to the Template Management section on the messaging console.
Select the same WABA from the dropdown on which this template was created.
Click on the Sync icon to update the newly created Template on our console to start using the Template.
Option 2: Using Flows Builder under the Account Tools section
In this section, we'll walk you through creating your very first Flow. At the end of this tutorial, you'll have a completed and published demonstration Flow, ready to be sent to other WhatsApp users.
To do this, we'll use the Flows Builder UI in WhatsApp Manager. Remember, if you haven't already gone through the prerequisites, be sure to read through it before starting this guide.
Step 1: Create Your Flow
Login to your Exotel account and click on the WhatsApp option from the left side menu.
Navigate to the WhatsApp Flows option from the Left Side Menu and click on Meta Dashboard link for the Free Form Message.
It will open the WhatsApp Business Manager portal in the new tab, search and open your valid WABA account from top right corner. In the WhatsApp Manager of your WhatsApp Business Account, select Account tools on the left-side menu and then click Flows.
On the top right of the page, click the button titled Create Flow. A dialog will open where you can enter some details about your Flow.
What do these fields mean?
Name: The name is a unique identifier for your Flow across your business account. Generally, try to choose a name that describes your Flow and its purpose. In this case, enter my_first_flow.
Categories: Choose any categories that match the purpose of your Flow from the list of options. If none of the categories listed make sense for your Flow, just check "Other". In our case, choose "Other".
Template: WhatsApp Flows has a few template Flows pre-created to make it easier for you to get started. If any of the templates are similar to what you'd like your Flow to do, use a template as a starting point for your Flow or leave this blank.
Step 2: Build Your Flow JSON
To help you move quickly, here's a very simple demonstration ("Hello World") Flow. You can edit it here and then copy-and-paste it over to the Flows Builder UI when you're ready. (You can also preview it inside the builder.)
Once you've pasted the JSON into the Flows Builder UI, click Run to preview the Flow. If you're happy with the demonstrated Flow, click Save.
Step 3: Test Your Flow
The easiest way to test a Flow is by using the Interactive preview option which simulates the real experience. You can click on the Flow's green Complete button to see the Flow in action.
Step 4: Publish Your Flow
When you first created your Flow, it entered the Draft state. And as you edited and saved the modified Flow JSON content, it remained in the Draft state. You are able to send the Flow while it's in the Draft state, but only for testing purposes. If you want to send the Flow to a larger audience, you'll need to Publish the Flow.
Note: Remember, once a Flow has been published it can no longer be modified. See Flow Status Lifecycle for more information on the different Flow states.
To publish your Flow, open the menu to the right of the Save button and click Publish. Once published, the Flow can be sent to anyone!
What's Next?
Congratulations! ? Your Flow can now be sent to real users. To learn how you can actually send your Flow, read the next section to Send the Flows
Build Data Channel
Setup and Consume webhook notifications
You will have to set up the Webhook to receive the WhatsApp Flows callbacks for your WhatsApp phone number.
Setup the Webhook
You can set up the Webhook for WhatsApp phone numbers from the Exotel Messaging console.
Go to the Webhooks section and navigate to the Phone Number.
Click on the Edit icon on the right-hand side of the table.
Paste your Callback URL and click on Save. (This will take 10-15 mins to be active).
Consume the Webhook notifications
Upon flow completion, a response message will be sent to the WhatsApp chat.
You will receive it in the same way as you receive all other messages from the user - via message webhook. response_json field will contain flow-specific data.
As you have configured the webhook for the number on the Exotel Message Console, you will receive the callbacks with the Flow details as the sample response present below:
Sending a Flow
You are able to send your WhatsApp Flow once you have created it. On this page, we will explore the existing APIs for sending a message, as well as the modifications required for sending a message with a Flow.
There are two types of messages with which you can attach a Flow:
Template messages from the Business
In reply to user-initiated conversations
Details of how a Flow can be attached to these message types is explained below.
Template messages from the Business
You can send a template message with a WhatsApp Flow. Only the approved templates with the Flow buttons can be sent to the users via Campaigns or APIs.
We have introduced a new button type called FLOW. Use this type to specify the Flow to be sent with the template message.
Please follow the steps below to send a Flow via Template messages.
Step 1: Create and Sync the Template with Flows
Given that the template is created on the Meta dashboard and you have synced the Templates on the Exotel dashboard.
You can refer to this section to complete this step - Step 1: Create Your Flow Template
Step 2: Send the Template via Exotel Campaign Console
Let us see how to send a Campaign with the Template Flows CTA button.
Login to the Exotel dashboard and navigate to the Campaign console from the left-sided menu.
Select WhatsApp and Click on the Create button from the top right corner.
Provide the Campaign name, Select the correct WABA ID where this new template with Flow button was created on the Meta dashboard.
Select the Phone Number, and attach the Audience List details to the campaign to whom you would want to send the message and click on Next.
Select the correct Template name which has the ‘Form’ present in the button and click on Next. Templates with a Flow attached to them will be shown as ‘MARKETING - FORM’ to differentiate the Flows templates with the other Marketing category templates (see below)
Review the selected Template with the Flow button with the Preview screen present on the RHS on the third step and click on Next.
Schedule your campaign as per your requirement and click on Create Campaign button to send the template messages.
Alternative to Step 2: Send the Template Message via API
Please follow Step 1 for creating the template with Flow on the Meta dashboard.
You can then use the Send Template Message API (Business Message) to send the Flow message via API.
You need to configure the endpoint in a similar way how you use to send other messages - POST https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages
You can get the API credentials and details from your Exotel account under the API Credentials section.
Following are the key parameters related to Flow that you need to pass (along with the other mandatory/optional parameters in the Send Template Message API) - Postman API Collection.
To and from number
Template Name
Language Code
Flow Token - Optional (this can be passed any static value)
Hit the send message API to send and test your template message containing the Flow.
In reply to user-initiated conversations
You can send a message with a Flow in a user-initiated conversation using a message with a Call To Action (CTA).
You can send this message either through Send Message API with information specific to the Flow. The Flow is triggered when the user clicks on the CTA button.
Please follow the steps below to send a Flow via user-initiated conversation message types.
Step 1: Create the JSON flow on meta
Given that the required JSON Flow is created on the Meta dashboard and you have successfully published the Flow you are good to go.
You can refer to this section to complete this step - Create Free Form Flows
Step 2: Send the JSON Flow
You can use the Send Template Message API (User Initiated Message) to send the Flow message via API.
You need to configure the endpoint in a similar way how you use to send other messages - POST https://<your_api_key>:<your_api_token><subdomain>/v2/accounts/<your_sid>/messages
You can get the API credentials and details from your Exotel account under the API Credentials section.
Following are the key parameters related to Flow that you need to pass (along with the other mandatory/optional parameters in the Send Message API) - Postman API Collection.
To and from number
Content type - Interactive
Header, Body and Footer Text for the Message
Below are more details:
Action -> name
flow_message_version
flow_id
flow_token
flow_cta
flow_action
flow_action_payload -> Screen name
flow_token: Copy it from the Meta Dashboard from the Flows Section, click on the Manage option on the right hand side.
It will open the Modal which will provide you the Flow Token and other details for that published flow.
Configure the API payload and Hit the send message API to send and test your message.
Make sure an active conversation is present to send a free form session message.
Note: You can also configure a Chatbot and send an automated reply with Flow CTA button using the Chatbot UI. Please Contact your CSM for more details to understand how to configure and use the Chatbot with your WhatsApp number.
Note: Currently, we support static Flows in WhatsApp i.e. Flows where the questions shown in the subsequent Flow screens are not dependent on the data provided in the previous screens. If your use case is around dynamic Flows, e.g. displaying the available seats for a movie show is dependent on the date and time of the show selected, please contact [email protected] with the subject of the email as mentioned below, and we’ll be happy to assist you.
Email subject: Enable dynamic WhatsApp Flows feature