WhatsApp Flows are Meta's in-chat forms. A customer taps a button in a message, a form opens inside WhatsApp, they fill it in screen by screen, and their answers come back to you. This page explains how Flows work on Meta's side. For building and managing them in Avox, see Flows.
Every Flow is described by one JSON document, the Flow JSON. Its main parts:
This is the blank Flow Avox's editor starts with when you build from scratch:
{
"version": "6.0",
"screens": [
{
"id": "MAIN",
"title": "New Flow",
"terminal": true,
"success": true,
"data": {},
"layout": {
"type": "SingleColumnLayout",
"children": [
{
"type": "Form",
"name": "form",
"children": [
{ "type": "TextInput", "name": "full_name", "label": "Full name", "input-type": "text", "required": true },
{ "type": "Footer", "label": "Submit", "on-click-action": { "name": "complete", "payload": {} } }
]
}
]
}
}
]
}
A screen is one page of the form. It has an id, a title shown at the top, and a layout
holding its components:
TextHeading and TextBody.TextInput and Dropdown. Each has a name
that labels its answer, and can be required.on-click-action decides what the
button does.A screen marked terminal: true is a last screen - the Flow can finish there.
Riverside Cafe
Tell us how we did
Quick feedback
It takes less than a minute.
Rating
Anything else?
A component's on-click-action tells WhatsApp what to do when the customer taps it. Avox's
Actions panel lists every action your Flow uses and explains it:
Each Flow belongs to one or more of Meta's categories: Sign up, Log in, Appointment booking, Lead generation, Shopping, Contact us, Customer support, Survey, and Other.
data_exchange to ask your own server for live data while the customer
fills them in - free appointment slots, a price, a sign-in check.For an endpoint Flow, Meta calls your server directly and encrypts every request:
You register a public key
You create an RSA key pair and register the public key with Meta. Avox generates the pair in your browser and registers the public half for you; the private key stays with you.
Meta encrypts each request
Meta encrypts the request with a fresh AES key, and encrypts that AES key with your public key.
Your server decrypts and answers
Your server decrypts the AES key with its private key, decrypts the request, and encrypts its response with the same AES key and an inverted IV.
Meta health-checks the endpoint
Meta sends action: "ping" requests to check your endpoint. Your server answers with
{"data": {"status": "active"}}, encrypted.
If your server can't decrypt a request, it should answer with HTTP status 421, which tells Meta
to fetch your public key again. Avox's endpoint snippet does all of this - see
Live endpoints.
A published Flow is sent as an interactive Flow message: some text and a button (the call to action) that opens the Flow. In Avox, the automation action Use Flows sends one, with the button label you choose. See Actions.
When the customer finishes, WhatsApp sends their answers back as a reply. Avox stores each completed response, and the count for the last 30 days appears on Overview.