Tutorial: Dynamic WhatsApp Flow
Dynamic WhatsApp Flow (Dynamic / Platform-hosted Flow) allows your customers to open an interactive form in the WhatsApp application whose data is fetched in real-time from your system’s backend, rather than being just a static form.
This tutorial guides you through building a Dynamic Flow integration comprehensively, from number configuration, encryption, handler automation flow, filling in screens in the visual editor, Test Dispatch testing, through to sending to customers.
What You Will Have at the End of the Tutorial
Section titled “What You Will Have at the End of the Tutorial”After completing this tutorial, you will have:
- A dynamic WhatsApp Flow with status PUBLISHED connected to your WABA number.
- An automation WhatsApp Flow handler (
wa_flow_handler) that receives form input, calls your system’s API (or a test API), and returns the customer profile screen data. - A tenant RSA encryption key installed on the WhatsApp number.
- Three verified delivery paths: via Inbox
+→ WhatsApp Flow (within the 24-hour window), via Complete Flow button template (outside the 24-hour window), and via Automation Interactive Messages (sendInteractiveFlow).
-
Phone Number & WABA Account Prerequisites
Section titled “Phone Number & WABA Account Prerequisites”Make sure your WhatsApp account and phone number meet the following criteria:
- Phone number in Connected and Enabled status on your production WABA account (not a test placeholder ID without a physical number).
- If you plan to send Flow messages directly (freeform / non-template), the number must have an active customer conversation within the last 24 hours (customer-service window). See the guide Manage Channel & Number and WhatsApp Settings if your phone number is not yet registered.
-
Setting Up Form Encryption (Once per Tenant)
Section titled “Setting Up Form Encryption (Once per Tenant)”All WhatsApp Flow data exchange must use RSA-2048 encryption. DEP applies the model one RSA key pair per tenant account (
client_account_id). You simply need to register an existing public key to your phone number:- Open the Settings → Form encryption (
/settings/wa-flow-encryption). - In the table of numbers grouped by WABA, find the phone number to be used.
- Click the Set up button on that number (or click Set up all to register all numbers at once).
- The system automatically uploads the tenant’s stored public key to the Meta endpoint.
One Key per Account, Not per Flow
Do not attempt to replace or rotate encryption keys separately for each template or flow. On Meta, the key is verified against the sender’s phone number. A key mismatch on the phone number is the main cause of the error Meta 421 (Misdirected Request).
For more details, read the guide Form Encryption.

Form encryption settings in the portal: Set up all numbers per WABA - Open the Settings → Form encryption (
-
Creating the Handler Automation (
Section titled “Creating the Handler Automation (wa_flow_handler)”wa_flow_handler)The handler acts as the backend that receives data from Meta and returns the next screen’s values.
- Open the Automations (
/automations), click New Automation, then select the type WhatsApp Flow handler (wa_flow_handler). Alternatively, use the menu Browse Templates and select template Dynamic Flow API lookup. - Note that the canvas
wa_flow_handleronly provides fast synchronous nodes:startNode,httpRequest,setVariable,extractFromJson,transformJson,condition,dictionaryLookup, andwaFlowRespond. - Add a conditional branch using the Condition node based on the
{{action}}_{{screen}}:- Actions
INIT: Returns the form opening screen (e.g.LOOKUP). - Actions
data_exchangeon screenLOOKUPinterface:- Call node HTTP Request to your system API using a secure Credential Profile .
- Check the status variable
http_handle:- If
success: Extract the JSON response values (name,plan,balance), then end with the Respond to Flow node toward theRESULT. - If
client_errororserver_error: Point the Respond to Flow node toward theERRORscreen, carrying a friendly error message.
- If
- Actions
- Standalone Condition Port: Each rule on the Condition node has its own output port (output handle) (such as the
INIT,data_exchange, orElsebranch). Every port must be connected to the next node; the validation system will reject publishing the flow if there is an unwired condition branch (unwired rule handle). - Variable Compatibility: Make sure the data property names on the response payload of the Respond to Flow (
name,plan) must exactly match the variable name on the control From handler → Variable on the relevant Flow editor screen. - Save your automation. Architecture details of the handler can be read in WhatsApp Flow Handler.
This is the automation editor canvas (not the automation list). After creating a handler or installing a template, open the automation row until you see the
wa_flow_handlerRespond to Flow Respond to Flow.
Creating & Composing Flow Screens in the Visual Builder - Open the Automations (
-
Open the
Section titled “Open the”- Open the Flows (
/flows) in the main portal navigation, then click Create Flow. - Give the flow a name (for example
Cek Profil Pelanggan), then select the Dynamic (Platform-hosted)tab. - Screen List: Create and name the screens according to your flow needs:
LOOKUP,RESULT, andERROR. Rename the screens directly through the Screen ID field in the screen properties panel—not by editing the JSON file. - Content Blocks: Add components such as Heading, Body, Short answer, or Single choice via the Add Block.
- Collecting Input (Field ID): On the
LOOKUPscreen, select the text input block (Short answer) and fill in Field ID with theuser_id. Your automation handler will read this input value via the variable{{data.user_id}}. - Displaying Data from the Handler: On the
RESULTscreen, select a text block (Heading or Body), change the content source to From handler, and specify the Variable (e.g.nameorplan). WhatsApp requires dynamic values to stand alone as an entire line (${data.name}); the From handler setting button automatically applies this rule for you. Use a separate Caption block above it if you need a static descriptive label. - List Options from the Handler: For choice components (Selection / Radio buttons) whose options are pulled from a database or API, set Options Source to From handler and then enter the array variable name (for example
posts). - Screen Navigation (Next Screen): On the screen navigation button (Continue), select the next screen which is generally returned by the handler (for example, from
LOOKUPtoRESULT). In Dynamic mode, the Continue button automatically triggers the data exchange (data_exchange) to your backend handler. The Complete Flow option is automatically hidden on the first Dynamic screen if the flow has more than one screen. If the form is saved with Complete, the platform serializer automatically converts it todata_exchange. - Passing Data Between Screens (Also send): If the next screen requires values from a previous screen that are not direct form inputs on the active screen (for example, passing
user_idto the next step), add those key names to the Also send from handler data. - Connecting to the Handler: Open Settings → Form handlers (
/settings/wa-flows), find your Flow row, click Connect, then select the automationwa_flow_handlerthat has been set up. The Connect feature automatically registers the flow ID and handler endpoint without needing to copy the Meta Flow ID manually. - Return to the Flow editor, then click Save and Publish (or Update and Republish). The Flow status will immediately change to PUBLISHED.

List of WhatsApp Flows: Sync from Meta and Create Flow 
Form handlers: Connect, Test Dispatch, Sync from Meta - Open the Flows (
-
Verify with the Test Dispatch Feature
Section titled “Verify with the Test Dispatch Feature”Before sending the Flow to real users, verify it directly in the portal without having to send an actual WhatsApp message:
- Open Settings → Form handlers (
/settings/wa-flows). - On your Flow connection row, click the Test Dispatch.
- Test Initialization Scenario:
- Select Action:
INIT. - Click Send Dispatch. Make sure the system returns HTTP 200 status and responds with the initial screen
LOOKUP.
- Select Action:
- Test Successful data_exchange Scenario:
- Select Action:
data_exchange. - Enter Screen:
LOOKUP. - Enter test data into the handler in the payload field (for example
{"user_id": "1"}). - Click Send Dispatch. Make sure the handler returns the screen response
RESULTalong with the complete profile data.
- Select Action:
- Test the Failed / Not Found Scenario:
- Enter unregistered test data (for example
{"user_id": "99999"}). - Make sure the handler responds with the screen
ERRORalong with an appropriate error message. If the Test Dispatch fails or returns an error message, fix your handler configuration or backend API first. Make sure all Test Dispatch scenarios show a success status before sharing the Flow with customers.
- Enter unregistered test data (for example
- Open Settings → Form handlers (
-
Sending a Flow to Users (Three Official Channels)
Section titled “Sending a Flow to Users (Three Official Channels)”Once the Flow has the status PUBLISHED and the Test Dispatch is verified, you can send it via the following three official channels:
Delivery Channel When to Use Configuration & Fields Inbox +→ WhatsApp FlowActive conversation within the 24-hour window Open the menu +in the agent chat composer, select WhatsApp Flow. Select a Published Flow on the related WABA, the Initial screen, Body text (max. 1024 characters), button Label (max. 20 characters, defaultMulai), as well as optional text Header/Footer.Complete Flow Button Message Template Broadcast campaign outside the 24-hour window Create a WhatsApp template in the Message Template menu, add a button of type Complete Flow with a Navigate Screen action to the initial screen ( LOOKUP). Send via Campaign or API.Bot Automation ( sendInteractiveFlow)Interactive automated bot flow within the 24-hour window Use the Send Flow Message node on a regular conversation canvas by filling in flowId,initialScreen(LOOKUP), andctaLabel(Buka Formulir). -
Quick Hands-On Practice (Drill with JSONPlaceholder)
Section titled “Quick Hands-On Practice (Drill with JSONPlaceholder)”To test the flow in a testing environment without an internal backend:
- Use the public JSONPlaceholder endpoint on the
httpRequestnode in the automation handler:GET https://jsonplaceholder.typicode.com/users/{{data.user_id}} - On the
LOOKUPscreen in the visual builder, provide a text input block with Field IDuser_id. - In Test Dispatch or a live trial:
- Enter
user_id:1→ The handler fetches user Leanne Graham’s data and returns the response to theRESULTscreen with the variablesnameandplan. - Enter
user_id:999→ The API returns 404, the variablehttp_handleis set toclient_error, and the handler returns theERRORscreen with a friendly error message.
- Enter
- For an advanced multi-screen scenario, pass
user_idthrough Also send from handler data fromRESULTgo to the customer post list viaGET https://jsonplaceholder.typicode.com/users/{{data.user_id}}/postswith the selection option component (Selection).
- Use the public JSONPlaceholder endpoint on the
Workflow Summary
Section titled “Workflow Summary”[WABA & Nomor Aktif] │ ▼[Pengaturan → Form Encryption] (Unggah Kunci Publik Tenant) │ ▼[Automations → wa_flow_handler] (Logika Sinkron & Node waFlowRespond) │ ▼[Flows → Dynamic Flow] ───► [Pengaturan → Form Handlers] (Hubungkan / Connect) │ ▼[Test Dispatch] (Simulasi INIT & data_exchange langsung di portal) │ ├───────────────────────┬────────────────────────┐ ▼ ▼ ▼[Template Complete flow] [Inbox + WA Flow (24h)] [Otomasi Bot (24h)](Kirim Kampanye/API) (Komposer agen CS) (Send Flow Message)