Build a Dynamic Data Flow in WhatsApp
Build a WhatsApp Dynamic Data Flow in ChatMaxima with chained dependent lists populated live from your API, such as Category to Product or Doctor to Date to Time.
Overview
A Dynamic Data Flow is a WhatsApp Flow whose lists are populated live from your own API. Each step is a list, and the customer's choice in one step decides what the next step shows. The flow walks the customer through a chain of dependent selections.
Typical examples:
- Healthcare - Doctor, then available Date, then available Time slot.
- E-commerce - Category, then Product.
- Services - Branch, then Service, then Staff member.
Unlike the Form Builder, the options are not entered by hand. When the customer moves to the next screen, WhatsApp calls a secure ChatMaxima endpoint, which calls your API and returns the next list. Nothing is hardcoded, so the same flow works for any chain of steps you define.
How It Works
- The customer opens the flow and sees the first step's list.
- They make a selection.
- WhatsApp sends that selection to ChatMaxima's encrypted endpoint.
- ChatMaxima calls your API for the next step, passing the earlier selections.
- The next list appears. This repeats until the final summary screen.
Prerequisites
Before you begin, ensure you have:
- A connected WhatsApp account - a WhatsApp Cloud API number linked to ChatMaxima.
- An API for each step - an HTTPS endpoint that returns a JSON list of options.
- The encryption key set up - a one-time setup per WhatsApp account, described below.
Note: Dynamic Data Flows are endpoint-driven, so WhatsApp requires an encryption key. You must complete the encryption setup before you can save a dynamic flow.
Step 1: Start a Dynamic Data Flow
- Go to Campaigns then WhatsApp Flows and click Create Flow.
- Enter a Flow Name and choose a Category.
- Set Flow Type to Dynamic Data Flow.
The builder switches to the Dynamic Steps view.
Step 2: Set Up the Encryption Key
A Dynamic Data Flow calls a ChatMaxima endpoint for each screen, and WhatsApp requires that channel to be encrypted.
- In the Endpoint Encryption card, click Set up Encryption Key.
- ChatMaxima generates an RSA key pair for the account and uploads the public key to Meta automatically.
This is a one-time action per WhatsApp account. Every dynamic flow on that account reuses the same key.
Step 3: Add Steps
Each step is one dependent list. Click Add Step and fill in the step editor.
Step Fields
| Field | Description |
|---|---|
| Step Title | The screen heading, for example Select a Category |
| Step Key | A lowercase identifier, for example category, referenced later as {category} |
| List Label | The label shown above the list |
| HTTP Method | GET or POST for the API call |
| API URL | The endpoint that returns this step's options |
| Authentication | None, Bearer Token, Basic Auth, or Custom Header |
Passing Earlier Selections
To make a later step depend on an earlier one, put the earlier step's key in its API URL as a placeholder. ChatMaxima replaces it with the customer's selection at runtime.
https://api.example.com/products?category={category}
In this example, the product step's URL inserts the chosen category.
Step 4: Map the API Response
The step editor's Response Mapping section tells ChatMaxima how to read your API's JSON.
| Field | Description |
|---|---|
| List Path | Path to the array in the response, for example data. Leave blank if the response is already an array |
| ID Field | The field used as the option's value, for example id |
| Title Field | The field shown as the option's main text, for example name |
| Description Field | An optional secondary line, for example price |
Dot notation is supported for nested fields, such as price.amount.
Step 5: Save and Publish
- Click Save Dynamic Flow. ChatMaxima generates the WhatsApp Flow screens from your steps and uploads them.
- Open the saved draft and click Publish.
The final screen is a summary that recaps every selection before the customer confirms.
Best Practices
- Use clear step keys - short, lowercase, and meaningful, since they appear in URLs.
- Return small lists - WhatsApp lists work best with a focused set of options.
- Order steps from general to specific - for example Category before Product.
- Test each API - confirm each endpoint returns the expected JSON before saving.
Troubleshooting
Save fails asking for the encryption key
- Open the Endpoint Encryption card.
- Click Set up Encryption Key and wait for confirmation.
- Save the dynamic flow again.
A step shows an empty list
- Check that the API URL is correct and reachable over HTTPS.
- Verify the List Path, ID Field, and Title Field match your API's JSON.
- Confirm any
{placeholder}in the URL matches an earlier step's key.
A step cannot reach the API
- The API must be a public HTTPS endpoint. Internal or private addresses are blocked for security.
- Confirm the authentication details are correct.