Follow Avox Docs on Google
Pick Avox Docs as a preferred source and Google shows these pages more often when you search for help with Avox.
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:
Since data API 3.0 the endpoint's address is a setting of the Flow at Meta (endpoint_uri), not part
of its JSON: Avox sets it when it publishes and removes an old data_endpoint_uri from the JSON.
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
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 an endpoint for data while the customer fills them in:
free appointment slots, seats, a price, a coupon check. In Avox the endpoint is Avox's own by
default, answering from your Tables, or your own server under Advanced. See
Live Flows and the Avox endpoint.For a live Flow, Meta encrypts every request to the endpoint:
You register a public key
The WhatsApp number's RSA public key is registered with Meta. With the Avox endpoint (or pass-through) Avox makes the pair on its own server and registers it for you. With your own server directly, the pair is made in your browser and 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.
The endpoint decrypts and answers
The endpoint decrypts the AES key with the private key, decrypts the request, and encrypts its
response with the same AES key and an inverted IV. It checks Meta's X-Hub-Signature-256 too.
Meta health-checks the endpoint
Meta sends action: "ping" requests to check your endpoint. Your server answers with
{"data": {"status": "active"}}, encrypted.
If the endpoint can't decrypt a request, it answers with HTTP status 421, which tells Meta to
fetch the public key again. Avox's endpoint does all of this for you; for your own server, the
wizard's snippet does it. See Live data.
A Flow whose first screen needs live data is sent with flow_action: "data_exchange", so Meta asks
the endpoint for that screen (INIT) before it opens.
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.