Flows
Last updated
WhatsApp Flows is a way to build structured interactions for business messaging. With Flows, businesses can define, configure, and customize messages with rich interactions that give customers more structure in the way they communicate.
You can use Flows to book appointments, browse products, collect customer feedback, get new sales leads, or anything else where structured communication is more natural or comfortable for your customers.
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)
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.
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
Meta will continue to expand Flows capabilities to unlock additional use cases in the future. We will keep you updated.
Sign Up
Appointment Booking
Flows are linked from a 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, as well as standard messages. See Best Practices.
WhatsApp Flows are supported for numbers hosted either through Cloud API or as On-Premise API hosted by 360dialog.
The minimum version for development and go-live with WhatsApp Flows using the On-Premise API is v2.51.1.
As announced in November 2023, Meta is transitioning to a fully Cloud-hosted WhatsApp Business Platform and will stop supporting On-Premise API in October 2025. Starting from On-Premise client v2.53, all new feature updates will be exclusively delivered to Cloud API. While the On-Premise API client will receive quarterly releases, they will focus solely on bug fixes and security patches.
Clients can set up Flows directly from the WhatsApp Business Manager UI. To access it, the user must have admin rights to manage the account. The Flows editor can be found under the "Account tools" section under the main menu in Meta's WhatsApp Manager.
Find in Form Builder section below payload examples with code snippets and explanations of how different Flows come together to create immersive experiences for users.
Flows can be crafted through our Partner API. We have enabled various endpoints to perform different operations to Flows. Alternatively, your clients can access a Flow builder user interface through the "Account tools" section in Meta's WhatsApp Manager.
Meta has introduced a new flow JSON template “Book an Appointment” which you can use as reference when creating a flow in Builder. The flow template can be found here.
To use the endpoints below, retrieve the {waba_account_id}
suffix using the Partner API. (eg. WABA ID "120000000000000
" corresponds to the ID "XxXxxXX
". If the correct ID is not parsed, the API will return an error.
POST
https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows
New Flows are created as drafts.
PATCH
https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/{flow-id}
Existing Flows can be updated using the update endpoint, by providing the Flow ID.
POST
https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/{flow_id}/assets
The individual screens of a Flow are defined through a "Flow JSON", that can be updated through this endpoint. To learn more about the Flow JSON definition follow this documentation link.
GET
https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/{flow_id}/preview
Flows can be previewed through a public link generated with this endpoint. The preview will show how the screens will look like, but will not be interactive. The final screens might render slightly different for some users.
DELETE
https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/{flow_id}
While a Flow is in draft status it can be deleted. Once published a flow can only be deprecated (see endpoint documentation further down).
GET
https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows
This endpoint can be used to retrieve a list of flows under a WhatsApp Business Account (WABA).
GET
https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/{flow_id}
This endpoint will return a specified flow's details such as: id
, name
, status
, and validation errors if they exist. You can request other fields by using the fields
param in the request.
GET
https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/{flow_id}/assets
Returns all assets attached to a specified flow.
POST
https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/{flow_id}/publish
You can publish your flow once you have ensured that the Flow meets the design principles of WhatsApp Flows, the Flow complies with WhatsApp Terms of Service, the WhatsApp Business Messaging Policy and, if applicable, the WhatsApp Commerce Policy.
Once published, a flow cannot be modified. Changes to a flow can be done by cloning it and modifying the cloned copy of the Flow.
POST
https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/{flow_id}/deprecate
Once a flow is published, it cannot be modified or deleted, but can be marked as deprecated.
If you're subscribed to our Partner API webhooks, you will receive events regarding the statuses and performance of your business' Flows.
Currently, there are webhooks to monitor:
Additional information on the webhook events' payloads can be found in Meta's developer documentation here.
In order to later de- and encrypt data passed through WhatsApp Flows, every WhatsApp Business Account (WABA) requires a key pair, which needs to be signed for every phone number sending Flows within the WABA.
Generate a public and private RSA key pair by typing in the following command in the terminal/console within your operating system (Note: OpenSSL needs to be installed):
The generates 2048-bit RSA key pair encrypted with a password you provided. Next, you need to export the RSA public key to a file, which can be accessed within your file system:
For every phone number sending Flows the public key needs to be signed. This will be done through the our WhatsApp Business API endpoints. The process differs for Cloud API and On-Premise.
As announced in November 2023, Meta is transitioning to a fully Cloud-hosted WhatsApp Business Platform and will stop supporting On-Premise API in October 2025. Starting from On-Premise client v2.53, all new feature updates will be exclusively delivered to Cloud API. While the On-Premise API client will receive quarterly releases, they will focus solely on bug fixes and security patches.
In Postman, when inputting the business public key as a parameter in the Body, select JSON format.
POST
https://waba-v2.360dialog.io/whatsapp_business_encryption
POST
https://waba.360dialog.io/v1/settings/business/whatsapp_business_encryption
You can verify the public key by retrieving it through the following endpoints.
GET
https://waba-v2.360dialog.io/whatsapp_business_encryption
GET
https://waba.360dialog.io/v1/settings/business/whatsapp_business_encryption
When the Flow needs to exchange data with your backend systems, it will make an HTTP request to an endpoint, that you provide. This endpoint needs to be set up so that it can receive and process POST
requests.
With this endpoint you will receive data passed into the Flow by the end user, which you can process e.g. storing it in your database.
Once set up you will share the data channel endpoint URL with the Flow through the Flow's Flow JSON.
Meta has introduced an endpoint example in NodeJS that works with the “Book an Appointment” flow JSON end to end, with app secret validation, endpoint error codes, and script to create public/private key. The endpoint code is available on Github and Glitch.
Since you're the owner of the endpoint you will not be able to validate the payload and verify the origin of the incoming webhook event. We will launch a solution during Q1/24 to improve the endpoint security by providing a secure proxy service. Announcements will be made here and through email communication.
The body of each request passed to your endpoint will be encrypted and will have the following format:
You can then proceed to decrypt this data using the encrypted_aes_key
. You can find a detailed example with sample code on this page of Meta's developer documentation.
After encryption the data will have the following format:
After processing decrypted request you can process the data end craft a response object, that will be encrypted and returned back to the Flow. A sample response payload before encryption would follow the format:
The response payload needs to be encrypted using the AES key received in the request and can afterwards be send back as Base64 string. An example on how to encrypt the data can be found in Meta's developer documentation via this link.
Your endpoint will receive requests in the following cases:
User opens the Flow
User submits the screen
User presses the back button on the screen
Error notification request (in case your endpoint returned with invalid content on the previous request)
For a detailed explanation of all cases and how to process the individual requests, please refer to Meta's developer documentation for implementing endpoint logic.
Once the Flow closes you will receive a message payload through your messages webhook URL, which will look like the followig example:
Adm users can use the Flows Builder, which allows Flows to be sent directly via WhatsApp Manager. The functionality works only with phone numbers registered to Cloud API.
You can send a Message with a Flow in a user-initiated conversation using a Message with a Call To Action (CTA). You send this message either through the On-Prem client or Cloud API with information specific to the Flow. The Flow is triggered when the user taps the CTA button.
To send a message with a Flow, you can use the new type of the Interactive Object named flow
with the following properties:
Send a POST call to the /messages endpoint.
Sample Request for Cloud API
Sample Response
You can send a template message with a WhatsApp Flow. Only published Flows can be sent this way. Use the new button type called FLOW
. Use this type to specify the Flow to be sent with the template message.
First you need to create a template. Here is an example request:
Sample Response
Ensure that your template passes all required reviews so that status
is APPROVED
instead of PENDING.
See Template Statuses.
Now you can send a template message with a Flow using the following request:
Sample Request for Cloud API
Sample Response
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. See Webhook Notifications for more details.
Here are some guidelines to optimize both the WhatsApp Flows user and developer experience.
The Feedback Form Flow can be used to collect customer feedback for an experience that includes purchase and delivery of a product. It can also easily be modified to collect other kinds of customer feedback as well.
This example tutorial breaks out the wrapper scaffolding code from the screen code. However, you should combine all the code in these examples using the Form Builder.
Wrapper Code
Include the following code to "wrap" the 2 screens of the Feedback Form (the General Satisfaction Questions screen, and the Rating Questions screen):
General Satisfaction Questions Screen:
The Form component organizes all the input fields on the page and sets the footer CTA to be disabled until all required fields have been completed.
RadioButtonsGroup and TextArea components are used to get input from the user.
You can decide for each input field whether it is required or not using the boolean “required” field.
Additional items to note here are the navigate
action which is designed to navigate to the chosen screen. This example also passes a payload to the next screen - the form collects the would_recommend
and how_to_do_better
payload so it can be received as part of the user’s response.
Once you have the first screen in the Builder and modified as needed, the following can be pasted below it: