LogoLogo
Become a PartnerStatus Page
  • get started
    • Welcome to 360Dialog
    • Quickstarts
      • Register as a Meta Tech Provider
      • Add a WhatsApp Number
      • Set up Integrated Onboarding
      • Create a Message Template
      • Send a Message
      • (temp title) Getting started as a partner
    • Pricing & Billing
      • Payment Methods for BR: Pix & Boleto
      • Month Closing Invoice (MCI)
    • Get API Access
    • Tech Provider Program
      • Understanding the Meta Tech Provider Program
      • Becoming a Meta Tech Provider: A Step-by-Step Guide
  • MM Lite Beta Program
    • Onboarding
    • Sending Messages
    • Expected Errors & Programming Languages
    • MM Lite Sandbox Testing
      • Sending Messages using MM Lite Sandbox
      • Expected Erros & Programming Languages
  • Partner & Account Management
    • Solutions for Partners
      • Benefits for Partners
      • Partner Hub
      • WABA Management
    • Account Setup & Management
      • Prerequisites and best practices for account creation
      • Account Structure
      • Account Creation
  • Integrations & API Development
    • Webhook Events & Setup
      • Webhook Events (Partner & Messaging API)
      • Webhook Configuration & Management
    • Integration Best Practices
      • Architecture and Security
      • Best Practices for Designing Integrations
        • Design a Stable Webhook Receiving Endpoint
      • Sizing Your Environment Based on Expected Throughput
      • Design a Resilient Message Sending Service
      • Integrated Onboarding
        • Basic Integrated Onboarding
        • Custom Integrated Onboarding
        • Host Your Own Embedded Signup
      • API Key Authentication for the Partner API
  • API Reference
    • Messaging API
    • Messaging Health Status
    • Sandbox (Test API Key)
    • Differences Between Cloud API and On-Premise API for Partners
      • [will be deprecated] Messaging with On-Premise API
    • Partner API
  • WABA Management
    • Managing WABA Accounts
      • Using the Partner Hub to manage Clients and Channels
      • Using the Partner API to manage Clients and Channels
      • Partner Permission to Generate API Key
      • Checking Usage & Statistics
    • Phone Number & Hosting
      • Migrating a Phone Number
        • Migrate number from Meta or alternate BSP to 360Dialog
        • Migrate a phone number to a new WABA
        • Migrate a phone number to a new WABA to change messaging Currency
      • WhatsApp Coexistence
        • Coexistence Onboarding
        • Coexistence Webhooks
      • Hosting type Change (On-premise API to Cloud API)
    • WABA Profile & Compliance
      • Display Name Guidelines
      • WABA Profile Info
      • WABA Policy Enforcement
      • Business Account Verification
    • Partner change (between 360Dialog Partners)
    • WhatsApp Flows
    • Accelerated Onboarding
    • Business Account Verification
  • Messaging
    • Sending & Receiving Messages
      • Conversations
      • Receiving messages
      • Before sending a message
    • Message Types
      • Conversational Components
      • Checklist for Message Broadcasts and Campaigns
      • Text messages
      • Interactive messages
        • Single and Multi Product Messages
        • Location Request Messages
        • Address Messages (India and Singapore only)
      • Contacts & Location Messages
    • Template Messages
      • Template Library
      • Template Elements
      • Sending Template Messages
      • Authentication Templates
        • Zero-Tap Authentication Templates
        • One-Tap Autofill Authentication Templates
        • Copy Code Authentication Templates
      • Catalog Templates
      • Product Card Carousel Templates
      • Single-Product Message Templates
      • Coupon Code Templates
      • Limited-Time Offer Templates
      • Multi-Product Templates
    • Media Messages
      • Upload, retrieve or delete media
    • Messaging Health & Troubleshooting
      • Messaging Limits & Quality Rating
      • Errors While Messaging
      • Messages statuses
  • Commerce & Payments
    • Payments (India Only)
      • Receive WhatsApp Payments via Payments Gateway
      • Receive WhatsApp Payments via Payment Links
      • Order Details Template Message
    • Payments (Singapore Only)
      • Receive WhatsApp Payments via Stripe
    • Products and Catalogs
      • India Businesses: Compliance for Commerce
  • Support & Updates
    • Help & Troubleshooting
      • FAQ
      • Error Code Reference
      • User Support Documentation
        • Tutorials
          • Page How to Troubleshoot Login Issues in the 360dialog Hub
          • How to Report an Issue
          • How to Contact Support
        • How-To Guides
          • Raise a support request
          • Requesting a Status Update for Business Verification
        • Reference
          • Troubleshooting Embedded Signup Issues
          • Commerce Policy Checks for WhatsApp API Access
          • Support Availability & SLAs
          • Incident Issue Prioritization
          • Case Types Table
        • Explanation
          • Why Business Verification Takes Time
          • Why Some Issues Are Not Emergencies
          • Understanding the Support Process
      • Support with Meta
    • Imprint & Data Privacy
    • Product Updates & News
      • How to ensure your Template Messages will be received
      • Integrated Onboarding new look and Campaigns Best Practices
Powered by GitBook
On this page
  • How does it work?
  • Leveraging Flows
  • How are Flows configured and used?
  • Getting Started
  • Manage Flows
  • Manage Flows through the WhatsApp Manager
  • Manage Flows through the Partner API
  • Creating a Flow
  • Updating a Flow
  • Updating a Flow's Flow JSON
  • Preview a Flow
  • Deleting a Flow
  • Retrieving a List of Flows
  • Retrieve Flow Details
  • Retrieving a Flow's List of Assets
  • Publishing a Flow
  • Deprecating a Flow
  • Migrating Flows
  • Webhooks
  • Setup Data Channel
  • Generating a Key Pair
  • Signing the Public Key
  • Set Business Public Key (Cloud API)
  • Set Business Public Key (On-Premise API) [will be deprecated]
  • Verifying the Public Key
  • Get Business Public Key (Cloud API)
  • Get Business Public Key (On-Premise API)
  • Set up Data Channel Endpoint
  • Send Flow as Message
  • Send Flow Template Message
  • Receiving Flow Response
  • Best Practices
  • Form Flows
  • Testing
  • Designing your Flow

Was this helpful?

  1. WABA Management

WhatsApp Flows

PreviousPartner change (between 360Dialog Partners)NextAccelerated Onboarding

Last updated 2 months ago

Was this helpful?

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)

How does it work?

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.

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

Meta will continue to expand Flows capabilities to unlock additional use cases in the future. We will keep you updated.

Sign Up

Appointment Booking

How are Flows configured and used?

Flows are linked from a CTA in a message. Flows are composed of:

  1. 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.

  2. Layouts: These define how components are presented within a Flow, providing a structured look and feel.

  3. 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.

Getting Started

WhatsApp Flows are supported for numbers hosted either through Cloud API or as On-Premise API hosted by 360dialog.

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.

Manage Flows

Manage Flows through the WhatsApp Manager

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.

Manage Flows through the Partner API

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.

Creating a Flow

POST https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows

New Flows are created as drafts.

Request Body

Name
Type
Description

name*

String

Provide a name for your new flow

clone_flow_id

String

id of source flow from the same WABA

categories*

Array[String]

A list of Flow categories

Allowed values: SIGN_UP, SIGN_IN, APPOINTMENT_BOOKING, LEAD_GENERATION, CONTACT_US, CUSTOMER_SUPPORT, SURVEY, OTHER

endpoint_uri

String

The URL of the WA Flow Endpoint.

Starting from Flow JSON version 3.0 this property should be specified only via API. Do not provide this field if you are cloning a Flow with Flow JSON version below 3.0.

{
  "id": "<Flow-ID>"
}

Updating a Flow

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.

Request Body

Name
Type
Description

name

String

Provide a name for your new flow

categories

Array[String]

A list of Flow categories

Allowed values: SIGN_UP, SIGN_IN, APPOINTMENT_BOOKING, LEAD_GENERATION, CONTACT_US, CUSTOMER_SUPPORT, SURVEY, OTHER

endpoint_uri

String

The URL of the WA Flow Endpoint.

Starting from Flow JSON version 3.0 this property should be specified only via API. Do not provide this field if you are cloning a Flow with Flow JSON version below 3.0.

Updating a Flow's Flow JSON

POST https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/{flow_id}/assets

Request Body

Name
Type
Description

name*

String

Flow asset name. Value should be flow.json

asset_type*

String

Asset type. Value should be FLOW_JSON

file*

json

File with the JSON content. File must be attached as form-data.

{
  "success": true,
  "validation_errors": []
}

Preview a Flow

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.

Query Parameters

Name
Type
Description

invalidate

Boolean

Invalidate=true will generate a new link. Default is false

"preview": 
{
  "preview_url": "<URL>",
  "expires_at": "<timestamp>",
  "id": "<Flow-ID>"
}

Deleting a Flow

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).

Retrieving a List of Flows

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).

Query Parameters

Name
Type
Description

fields

String

Flow fields to return. Available: id, name, categories, validation_errors, status, json_version, data_api_version, data_channel_uri[DEPRECATED in API v19.0 ] Use endpoint_uri field instead), preview, whatsapp_business_account

{
    "data": [
    {
        "id": 1,
        "name": "flow 1",
        "status": "DRAFT"
    },
    {
        "id": 2,
        "name": "flow 2",
        "status": "PUBLISHED"
    },
    {
        "id": 3,
        "name": "flow 3",
        "status": "DRAFT"
    }
    ]
}

Retrieve Flow Details

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.

Query Parameters

Name
Type
Description

fields

String

Flow fields to return. Available: id, name, categories, validation_errors, status, json_version, data_api_version, endpoint_uri, data_channel_uri[DEPRECATED in API v19.0 ] Use endpoint_uri field instead), preview, whatsapp_business_account

{
  "id": "<Flow-ID>",
  "name": "Flow Name",
  "status": "DRAFT",
  "validation_errors": []
}

Retrieving a Flow's List of Assets

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.

{
  "name": "flow.json",            
  "asset_type": "FLOW JSON",
  "download_url": "<DOWNLOAD-URL>",  
  "paging": {
    "cursors": {            
      "before": "QVFIU...",            
      "after": "QVFIU..."        
    }    
  }
}

Publishing a Flow

POST https://hub.360dialog.io/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/{flow_id}/publish

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.

{
  "success": true
}

Deprecating a 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.

{
  "success": true,
}

Migrating Flows

Migrate Flows from one WhatsApp Business Account (WABA) to another. Migration doesn't move the source Flows, it creates copies of them with the same names in the destination WABA.

Notes:

  • You can specify specific Flow names to migrate, or choose to migrate all Flows in source WABA.

  • Flows can only be migrated between WABAs owned by the same Meta business.

  • If a Flow exists with the same name in the destination WABA, it will be skipped and the API will return an error message for that Flow. Other Flows in the same request will be copied.

  • The migrated Flow will be published if the original Flow is published, otherwise it will be in draft state.

  • New Flows under destination WABA will have new Flow IDs.

POSThttps://hub.360dialog.io/api/v2/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/migrate_flows

Path Parameters

Name
Type
Description

partner_id

string

Your Partner ID

waba_account_id

string

The ID of the WABA account.

Request Body

Name
Type
Description

source_waba_account_id

string

Source WhatsApp Business Account ID to copy flows from

Example: exampleWA

source_flow_names

array[string]

List of source flow names to migrate. If not provided, all flows will be migrated.

Example:["flow1","flow2"]

curl --request POST \
  --url https://hub.360dialog.io/api/v2/api/v2/partners/{partner_id}/waba_accounts/{waba_account_id}/flows/migrate_flows \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "source_waba_account_id": "exampleWA",
  "source_flow_names": [
    "flow1",
    "flow2"
  ]
}

Response

{
  "migrated_flows": [
    {
      "source_name": "appointment-booking",
      "source_id": "1234",
      "migrated_id": "5678"
    }
  ],
  "failed_flows": [
    {
      "source_name": "lead-gen",
      "error_code": "4233041",
      "error_message": "Flows Migration Error: Flow with the same name exists in destination WABA."
    }
  ]
}


Successful response
{
  "detail": {
    "<location>": {
      "<field_name>": [
        "string"
      ]
    }
  },
  "message": "string"
}

Wrong payload
 {
  "detail": {},
  "message": "string"
}

Not found

Webhooks

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:

Setup Data Channel

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.

Generating a Key Pair

openssl genrsa -des3 -out private.pem 2048

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:

openssl rsa -in private.pem -outform PEM -pubout -out public.pem

Signing the Public Key

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 x-www-form-urlencoded. Additionally, the public key needs to be copied in full to work (from ----BEGIN PUBLIC KEY---- and ending with ----END PUBLIC KEY----).

Set Business Public Key (Cloud API)

POST https://waba-v2.360dialog.io/whatsapp_business_encryption

Request Body

Name
Type
Description

business_public_key*

String

2048-bit RSA business public key generated.

{
  "meta": 
  {
    "api_status": "stable",
    "version": "<latest-api-version>"
  }
}

Set Business Public Key (On-Premise API) [will be deprecated]

POST https://waba.360dialog.io/v1/settings/business/whatsapp_business_encryption

Request Body

Name
Type
Description

public_key*

String

The generated Business Public Key.

{
  "meta": 
  {
    "api_status": "stable",
    "version": "<latest-api-version>"
  }
}

Verifying the Public Key

You can verify the public key by retrieving it through the following endpoints.

Get Business Public Key (Cloud API)

GET https://waba-v2.360dialog.io/whatsapp_business_encryption

{
  "business_public_key": "<2048_bit_RSA_key>"
  "business_public_key_signature_status": VALID | MISMATCH
}

Get Business Public Key (On-Premise API)

GET https://waba.360dialog.io/v1/settings/business/whatsapp_business_encryption

{
  "business_public_key": "<2048_bit_RSA_key>"
  "business_public_key_signature_status": VALID | MISMATCH
}

Set up Data Channel Endpoint

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.

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.

Implement Encryption/Decryption

The body of each request passed to your endpoint will be encrypted and will have the following format:

{
    encrypted_flow_data: "<ENCRYPTED FLOW DATA>",
    encrypted_aes_key: "<ENCRYPTED_AES_KEY>",
    initial_vector: "<INITIAL VECTOR>"
 }
Parameter
Description

encrypted_flow_data

The encrypted request payload.

encrypted_aes_key

The encrypted 128-bit AES key.

initial_vector

The 128-bit initialization vector.

After encryption the data will have the following format:

{
    version: "<VERSION>",
    user_locale: "<LOCALE>",
    action: "<ACTION_NAME>",         // init | back | data_exchange | ping
    screen: "<SCREEN_NAME>",
    data: {                         // JSON of values from screen
        prop_1: "value_1",
        ...
        prop_n: "value_n"
    },
    flow_token: "<FLOW-TOKEN>”
}

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:

{
    eg_textfield_variable_1: "sample_Value_1",
    eg_textfield_variable_2: "sample_Value_2"
}

Implement Endpoint Logic

Your endpoint will receive requests in the following cases:

  1. User opens the Flow

  2. User submits the screen

  3. User presses the back button on the screen

  4. Error notification request (in case your endpoint returned with invalid content on the previous request)

Webhook Response

Once the Flow closes you will receive a message payload through your messages webhook URL, which will look like the followig example:

{
  "messages": [{
    "context": {
      "from": "16315558151",
      "id": "gBGGEiRVVgBPAgm7FUgc73noXjo"
    },
    "from": "<USER_ACCOUNT_NUMBER>",
    "id": "<MESSAGE_ID>",
    "type": "interactive",
    "interactive": {
      "type": "nfm_reply",
      "nfm_reply": {
        "name": "galaxy_message",
        "response_json": {
            "flow_token": "<FLOW_TOKEN>", 
            "optional_param1": "<value1>",
            "optional_param2": "<value2>"
        }
      }
    },
    "timestamp": "<MESSAGE_SEND_TIMESTAMP>"
  }]
}
Parameter
Description

context

object

Context of the message that the user replied to. Context object contains message_id of flows request message and sender number.

context.from

string

User's WhatsApp account number

context.id

string

Message ID

context.type

string

Always interactive

interactive.type

string

Always nfm_reply

interactive.nfm_reply.name

string

galaxy_message

interactive.nfm_reply.response_json

string

String that can be parsed to JSON that contains the params business sent like flow_token

timestamp

string

Time of flow response message

Send Flow as Message

Via WhatsApp Manager

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.

Via 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:

Interactive message parameters

Parameter
Description

interactiveobject

The interactive message configuration

↳type(required) string

Value must be "flow".

↳action(required) object

Parameter

Description

name(required) string

Value must be "flow".

parametersobject

↳modestring

The Flow can be in either draft or published mode.(Default value: published)

↳flow_message_versionstring

Value must be "3".

↳flow_tokenstring

Flow token that is generated by the business to serve as an identifier.

↳flow_idstring

Unique ID of the Flow provided by WhatsApp.

↳flow_ctastring

Text on the CTA button. For example: "Signup" Character limit - 20 characters (no emoji).

↳flow_actionstring

navigate or data_exchange.(Default value: navigate)

↳flow_action_payloadstring

Required if flow_action is navigate. Should be omitted otherwise.

Send a POST call to the /messages endpoint.

Sample Request for Cloud API

{
  "recipient_type": "individual",
  "messaging_product": "whatsapp",
  "to": "whatsapp-id",
  "type": "interactive",
  "interactive": {
    "type": "flow",
    "header": {
      "type": "text",
      "text": "Flow message header"
    },
    "body": {
      "text": "Flow message body"
    },
    "footer": {
      "text": "Flow message footer"
    },
    "action": {
      "name": "flow",
      "parameters": {
        "flow_message_version": "3",
        "flow_token": "AQAAAAACS5FpgQ_cAAAAAD0QI3s.",
        "flow_id": "1",
        "flow_cta": "Book!",
        "flow_action": "navigate",
        "flow_action_payload": {
          "screen": "<SCREEN_NAME>",
          "data": { 
            "product_name": "name",
            "product_description": "description",
            "product_price": 100
          }
        }
      }
    }
  }
}

Sample Response

{
  "contacts": [
    {
      "Input": "+447385946746",
      "wa_id": "47385946746"
    }
  ],
  "messages": [
    {
      "id": "gHTRETHRTHTRTH-av4Y"
    }
  ],
  "meta": {
    "api_status": "stable",
    "version": "2.44.0.27"
  }
}

Send Flow Template Message

{
  "name": "example_template_name",
  "language": "en_US",
  "category": "MARKETING",
  "components": [
    {
      "type": "body",
      "text": "This is a flows as template demo"
    },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "FLOW",
          "text": "Open flow!",
          "flow_id": "<flow-id>",
          "navigate_screen":  "Flows Json screen name",
          "flow_action": "navigate"
        }
      ]
    }
  ]
}'
Parameter
Description

buttons

↳flow_idstring

The unique ID of a Flow.

↳nagivate_screenstring

Required if flow_action is navigate. The unique ID of the Screen in the Flow.

↳flow_actionstring

Either navigate or data_exchange.(Default value: navigate)

Sample Response

{
  "id": "<template-id>",
  "status": "PENDING",
  "category": "MARKETING"
}

Now you can send a template message with a Flow using the following request:

Sample Request for Cloud API

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "template",
  "template": {
    "name": "TEMPLATE_NAME",
    "language": {
      "code": "LANGUAGE_AND_LOCALE_CODE"
    },
    "components": [
      {
        "type": "button",
        "sub_type": "flow",
        "index": "0",
        "parameters": [
          {
            "type": "action",
            "action": {
              "flow_token": "FLOW_TOKEN",   //optional, default is "unused"
              "flow_action_data": {
                 ...
              }   // optional, json object with the data payload for the first screen
            }
          }
        ]
      }
    ]
  }
}

Sample Response

{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "<phone-number>",
      "wa_id": "<phone-number>"
    }
  ],
  "messages": [
    {
      "id": "<message-id>"
    }
  ]
}

Receiving Flow Response

Sending a WhatsApp Flow as user initiated message

{
    "recipient_type": "individual",
    "to": "whatsapp-id",
    "type": "interactive",
    "interactive": {
        "type": "galaxy_message",
        "header": {
            "type": "text",
            "text": "Flow message header"
        },
        "body": {
            "text": "Flow message body"
        },
        "footer": {
            "text": "Flow message footer"
        },
        "action": {
            "name": "",
            "parameters": {
                "flow_message_version": "3",
                "flow_token": "AQAAAAACS5FpgQ_cAAAAAD0QI3s.",
                "flow_id": "1",
                "flow_cta": "Book!",
                "mode": "draft"
            }
        }
    }
}

Best Practices

Here are some guidelines to optimize both the WhatsApp Flows user and developer experience.

Form Flows

Feedback Form Flow

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.

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):

{
    "version": "2.1",
    "screens": [
  /* screens we'll define in the next sections */
    ]
}

General Satisfaction Questions Screen:

{
    "id": "screen_feedback_one",
    "title": "Feedback 1 of 2",
    "layout": {
        "type": "SingleColumnLayout",
        "children": [
            {
                "type": "Form",
                "name": "form_feedback_one",
                "children": [
                    {
                        "type": "TextSubheading",
                        "text": "Would you recommend us to a friend?"
                    },
                    {
                        "type": "RadioButtonsGroup",
                        "label": "Choose one:",
                        "name": "would_recommend",
                        "data-source": [
                            {
                                "id": "1",
                                "title": "Yes"
                            },
                            {
                                "id": "0",
                                "title": "No"
                            }
                        ],
                        "required": true
                    },
                    {
                        "type": "TextSubheading",
                        "text": "How could we do better?"
                    },
                    {
                        "type": "TextArea",
                        "label": "Leave a comment",
                        "required": false,
                        "name": "how_to_do_better_comment"
                    },
                    {
                        "type": "Footer",
                        "label": "Continue",
                        "on-click-action": {
                            "name": "navigate",
                            "next": {
                                "type": "screen",
                                "name": "screen_feedback_two"
                            },
                            "payload": {
                                "would_recommend": "${form.would_recommend}",
                                "how_to_do_better": "${form.how_to_do_better_comment}"
                            }
                        }
                    }
                ]
            }
        ]
    }
}

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.

Rating Questions Screen

Once you have the first screen in the Builder and modified as needed, the following can be pasted below it:

{
    "id": "screen_feedback_two",
    "title": "Feedback 2 of 2",
    "data": {
        "would_recommend": {
            "type": "string",
            "__example__": "1"
        },
        "how_to_do_better": {
            "type": "string",
            "__example__": "Have more color options"
        }
    },
    "terminal": true,
    "layout": {
        "type": "SingleColumnLayout",
        "children": [
            {
                "type": "Form",
                "name": "form_feedback_two",
                "children": [
                    {
                        "type": "TextSubheading",
                        "text": "Rate the following: "
                    },
                    {
                        "type": "Dropdown",
                        "label": "Purchase experience",
                        "required": true,
                        "name": "purchase_experience_dropdown",
                        "data-source": [
                            {
                                "id": "5",
                                "title": "★★★★★• Excellent (5/5)"
                            },
                            {
                                "id": "4",
                                "title": "★★★★☆• Good (4/5)"
                            },
                            {
                                "id": "3",
                                "title": "★★★☆☆• Average (3/5)"
                            },
                            {
                                "id": "2",
                                "title": "★★☆☆☆• Poor (2/5)"
                            },
                            {
                                "id": "1",
                                "title": "★☆☆☆☆• Very Poor (1/5)"
                            }
                        ]
                    },
                    {
                        "type": "Dropdown",
                        "label": "Delivery and setup",
                        "required": true,
                        "name": "delivery_dropdown",
                        "data-source": [
                            {
                                "id": "5",
                                "title": "★★★★★• Excellent (5/5)"
                            },
                            {
                                "id": "4",
                                "title": "★★★★☆• Good (4/5)"
                            },
                            {
                                "id": "3",
                                "title": "★★★☆☆• Average (3/5)"
                            },
                            {
                                "id": "2",
                                "title": "★★☆☆☆• Poor (2/5)"
                            },
                            {
                                "id": "1",
                                "title": "★☆☆☆☆• Very Poor (1/5)"
                            }
                        ]
                    },
                    {
                        "type": "Dropdown",
                        "label": "Customer service",
                        "required": true,
                        "name": "customer_service_dropdown",
                        "data-source": [
                            {
                                "id": "5",
                                "title": "★★★★★• Excellent (5/5)"
                            },
                            {
                                "id": "4",
                                "title": "★★★★☆• Good (4/5)"
                            },
                            {
                                "id": "3",
                                "title": "★★★☆☆• Average (3/5)"
                            },
                            {
                                "id": "2",
                                "title": "★★☆☆☆• Poor (2/5)"
                            },
                            {
                                "id": "1",
                                "title": "★☆☆☆☆• Very Poor (1/5)"
                            }
                        ]
                    },
                    {
                        "type": "Footer",
                        "label": "Done",
                        "on-click-action": {
                            "name": "complete",
                            "payload": {
                                "purchase_experience_rating": "${form.purchase_experience_dropdown}",
                                "delivery_rating": "${form.delivery_dropdown}",
                                "customer_service_rating": "${form.customer_service_dropdown}",
                                "would_recommend": "${data.would_recommend}",
                                "how_to_do_better": "${data.how_to_do_better}"
                            }
                        }
                    }
                ]
            }
        ]
    }
}

The input data for the screen matches the payload of the navigate action from the previous screen, and the complete action terminates the flow (the screen is defined as terminal).

For each dropdown, the id of the option that the user selects is sent as part of the complete action payload. In addition, the inputs from the first screen, propagated through the second screen’s data, is also sent as part of the complete action payload. This way, the business will receive the entire feedback response from the user on the webhook.

Testing

Now that Flow development is complete, you should test it prior to publishing.

To test the Flow before publishing you can:

  • Use the interactive preview in the Meta Builder UI

Or

  • Send the Flow as a draft message using the Partner API

Designing your Flow

Call-to-Actions (CTAs)

The CTA should always tell the user what will happen next or what task is being completed on each screen, for example Confirm booking.

Capitalization

Use sentence case on screen titles, headings, and CTAs. Use consistent capitalization throughout each flow.

Emojis

Always consider the context of the content when using emojis, such as:

  • Are they appropriate to use?

  • Will they add to the content?

  • Do they reflect the business brand?

Error Handling

  • Errors should be clearly communicated to the user, including what has happened and how to resolve it.

  • Make sure validation rules are clearly communicated, such as if a user tries to enter a password that is not long enough.

  • If the flow is exchanging data with your endpoint and a screen becomes invalid (eg. appointment booking), take the user back to the previous screen rather than ending the flow.

Diverging Flows

If you need to create a sub-flow for certain use cases (eg. a forgot password flow), try to keep it to a maximum of 3 screens and always take the user back to the main flow and task at hand.

Flow Simplicity

Flows shouldn’t be long: Users should enter flows aiming to complete a task as quickly as possible, with tasks taking no longer than 5 minutes to complete.

Don’t have more than one task per screen: Screens with too many tasks may look messy and overwhelm the user. If the flow needs the user to complete multiple tasks, try splitting them up over several screens.

Don’t use too many components per screen: Too many components will make your screens look messy and may overwhelm users. It will also take longer to load.'

Build for caching: Once a user has completed a screen and moves onto the next, their information will be cached. If there are too many components on a single screen and the user exits the flow, they will lose all of this information, which could be frustrating for users.

Form Quality

  • Always use the right components for specific actions, for example, use the date picker to capture Date of Booking.

  • If an input requires a lot of text, use the text area component and not the text input.

  • Questions and form labels must provide full clarity on what it is asking the user.

  • Forms or questions should be logically ordered, for example, first name, last name, etc.

  • Forms that are not critical to completing a task should be made optional to the user.

Formatting

Ensure that any information is correctly formatted for context, for example, currency symbols, phone numbers, and dates.

Grammar and Spelling

  • Always check the content in your flows before publishing.

  • Ensure you use consistent spelling and capitalization for certain terms.

  • Check your grammar such as ensuring sentences use full-stops.

Helper Text

Helper text should provide clarity for users, eg. the correct format for a phone number, date input, or email address.

Initiation Flow

The chat should provide clarity

Users will choose to open a flow based on the clarity of the initiation messages. The exchange should feel conversational, providing context and clear task-focused actions for the user.

Users want to complete a task

The CTA should go hand-in-hand with the message content. It should be short and concise, telling the user what task they can expect to complete by opening the flow.

There should be no surprises

The first screen of the flow should mirror the action of the CTA. Any deviations from the task at hand will result in a bad experience for the user, resulting in them closing the flow.

Login Screens

Some flows may need login screens to complete tasks. However, there are factors to consider when including them in your flows.

Use only when necessary

Including a login screen may be off putting for some users, so try to only use them when absolutely necessary. If you do need one, set the expectations for users so it doesn’t come as a surprise.

Sense of place within flow

Research has shown that login screens may confuse users within flows. Some people thought screens would take them to an external page, outside of WhatsApp. This may result in users losing their sense of place within the flow.

Users need to see the benefit of logging in

The placement of login screens is key. If they are too early in the flow, users will not be motivated to continue. Showing the benefits upfront will make users want to complete the flow. Aim to make the login screen one of the last steps before completion.

Navigation

  • Always set expectations for how long it will take to complete a task, eg. "It should only take a few minutes to complete."

  • Help the user know where they are in the flow by using short, concise action-oriented screen titles, such as "Book appointment."

  • Use screen titles to show progress where possible, eg. "Question 1 of 3."

  • End the flow with a summary screen, especially if there have been multiple steps, so users can review and complete the task with clarity.

Opt-in

  • It should be clear what the user is consenting to.

  • You should try to include a "Read more" CTA which links to the relevant information, eg. Terms and Conditions.

Options and lists

  • Keep it simple, try not to use more than 10 options per screen.

  • Only use dropdown options when there are 8 or more options.

  • Use a radio button if there is only one selection to make.

  • Use checkboxes if the user can select multiple options.

  • Always make the option at the top of the list the default selection.

Termination Flow

Set expectations

The last screen should clearly tell the user what will happen when they end the flow. They will also want confirmation of their actions. Sending a summary message should make the user feel reassured.

Bookend your flows

The termination messages should provide the user with clarity and a sense of completion. They should know what they have done, what the next steps are, and who they can get in touch with if they have any questions or if they want to edit or cancel a task.

Trust and Support

  • The business logo (profile photo) should be simple and identifiable in the footer so the user knows and trusts the flow.

  • Add a CTA within your flow that enables your users to get in touch when needed. This can also be done in follow-up messages once the user has completed the flow.

Writing Content

  • Make sure your content follows a simple, clear hierarchy using a heading, body and captions

  • Do not repeat content unnecessarily, for example:

    • “Complete registration"

    • "Complete registration below"

Flows can be attached and sent as Business Initiated Messages, as well as standard messages. .

The minimum version for development and go-live with WhatsApp Flows using the On-Premise API is .

Find in below payload examples with code snippets and explanations of how different Flows come together to create immersive experiences for users.

Meta has introduced a new flow JSON template “Book an Appointment” which you can use as reference when creating a flow in Builder.

To use the endpoints below, retrieve the {waba_account_id} suffix using the. (eg. WABA ID "120000000000000" corresponds to the ID "XxXxxXX". If the correct ID is not parsed, the API will return an error.

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 .

You can publish your flow once you have ensured that the Flow meets the of WhatsApp Flows, the Flow complies with , the and, if applicable, the .

Additional information on the webhook events' payloads can be found in .

Generate a public and private RSA key pair by typing in the following command in the terminal/console within your operating system (Note: needs to be installed):

Meta has introduced an endpoint example in NodeJS that works with the with app secret validation, endpoint error codes, and script to create public/private key. The endpoint code is available on and .

You can then proceed to decrypt this data using the encrypted_aes_key. You can find a detailed example with sample code on this .

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 .

For a detailed explanation of all cases and how to process the individual requests,

Parameter
Description
Parameter
Description

You can send a with a WhatsApp Flow. Only published Flows can be sent this way. . Use this type to specify the Flow to be sent with the template message.

First you need. Here is an example request:

Ensure that your template passes all required reviews so that status is APPROVED instead of PENDING. See.

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 for more details.

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 .

Once everything has been tested successfully, you can (via the Builder UI or the API) and start sending

name(required) string

Value must be "flow".

parametersobject

↳modestring

The Flow can be in either draft or published mode.(Default value: published)

↳flow_message_versionstring

Value must be "3".

↳flow_tokenstring

Flow token that is generated by the business to serve as an identifier.

↳flow_idstring

Unique ID of the Flow provided by WhatsApp.

↳flow_ctastring

Text on the CTA button. For example: "Signup" Character limit - 20 characters (no emoji).

↳flow_actionstring

navigate or data_exchange.(Default value: navigate)

↳flow_action_payloadstring

Required if flow_action is navigate. Should be omitted otherwise.

Parameter
Description

screenstring

The ID of the first Screen.

dataobject

Optional input data for the first Screen of the Flow. If provided, this must be a non-empty object.

Parameter

Description

screenstring

The ID of the first Screen.

dataobject

Optional input data for the first Screen of the Flow. If provided, this must be a non-empty object.

screenstring

The ID of the first Screen.

dataobject

Optional input data for the first Screen of the Flow. If provided, this must be a non-empty object.

v2.51.1
See differences between On-premise API and Cloud API
Learn how to change hosting type of registered numbers
The flow template can be found here.
this documentation link
design principles
WhatsApp Terms of Service
WhatsApp Business Messaging Policy
WhatsApp Commerce Policy
Meta's developer documentation here
OpenSSL
See differences between On-premise API and Cloud API
Learn how to change hosting type of registered numbers
“Book an Appointment” flow JSON end to end,
Github
Glitch
page of Meta's developer documentation
via this link
Periodical health check from WhatsApp
please refer to Meta's developer documentation for implementing endpoint logic.
Form Builder
See Best Practices
Form Builder section
publish the Flow
Feedback Form Flows to users.
template message
Partner API
Use the new button type called FLOW
Enable Cloud API in your Partner Hub to be able to register Cloud API numbers
Enable Cloud API in your Partner Hub to be able to register Cloud API numbers
to create a template
Template Statuses
Flows status changes
Client error rates
Endpoint error rates
Endpoint channel latencies
Endpoint channel availability
Webhook Notifications