WhatsApp Flow Handler
Automation type WhatsApp Flow handler (wa_flow_handler) is a backend flow specifically for processing data requests from Dynamic WhatsApp Flow forms synchronously. Unlike conversational automations (flow) which interact within asynchronous chat messages, wa_flow_handler works like a webhook endpoint that receives form input from Meta, fetches data from external APIs, and returns a screen response within seconds.

Difference between wa_flow_handler vs Conversational Flow (flow)
Section titled “Difference between wa_flow_handler vs Conversational Flow (flow)”| Aspect | wa_flow_handler (Flow Handler) | flow (Conversational Automation) |
|---|---|---|
| Trigger | Meta Flow webhook (INIT or data_exchange) | Inbound chat messages or calls |
| Execution Model | Synchronous | Asynchronous (Multi-turn chat / stateful) |
| Time Limit (Budget) | ~15 seconds (per Meta’s client timeout limit) | Up to a 24-hour interaction window |
| Terminal Node | Must end at the node Respond to Flow (waFlowRespond) | Ends with a reply message, agent escalation, or completion |
| Input Variables | action, screen, data.*, client_account_id | Text message, contact, channel, custom attributes |
Execution Time Limit (Sync Budget)
Meta requires that the response from the server arrives on the user’s phone within a maximum of 10–15 seconds. Make sure the external API called by the node httpRequest responds quickly. Handlers must not usedelayor unbounded loops.
Allowed Nodes (Allowed Palette)
Section titled “Allowed Nodes (Allowed Palette)”To guarantee instant and deterministic synchronous execution, the studio builder for wa_flow_handler provides a dedicated node palette:
| Node Type | Function |
|---|---|
Start (startNode) | The starting point of the handler flow when Meta sends a form interaction payload. |
HTTP Request (httpRequest) | Calls your backend’s or a third party’s REST API (with support for Credential Profile). |
Set Variable (setVariable) | Sets local variable values for temporary data manipulation. |
Extract from JSON (extractFromJson) | Retrieves a specific column value from an API JSON response (e.g. $.name or $.balance). |
Transform JSON (transformJson) | Restructures the data object before it is submitted to the Flow screen. |
Condition (condition) | Performs logic branching (e.g. checking the value of action, screen, HTTP status codes, or the operator empty/not_empty/in/gt). |
Dictionary Lookup (dictionaryLookup) | Retrieves option data or key mappings from a Flow Dictionary backed by Redis/SQL (in exact or prefix). |
Respond to Flow (waFlowRespond) | A mandatory end node that sends the destination screen and response data back to WhatsApp in navigate, error, or completeaction. |
Flow Dictionaries
Section titled “Flow Dictionaries”A tenant’s static or semi-static data catalogs (such as lists of cities, branches, or service categories) can be stored in Settings → Flow Dictionaries (/settings/flow-dictionaries) for sub-millisecond lookups via the node Dictionary Lookup (dictionaryLookup) without needing to call an external API:
- Exact Key Mode: Direct lookup based on a unique key (e.g.
jktorbdg). It populates the variable{dict}_key,{dict}_title, and extracts JSON data fields with variable prefix support (assignPrefix). - Prefix Search Mode: Tiered prefix search (up to 20 options) to populate Dynamic Dropdown components based on the previous screen’s input (e.g.
{{data.city}}_). - Automatic Option List (
emitOptions): For compact catalogs (≤ 200 keys and ≤ 32 KB), the node can export the list of options directly to a context variable (e.g.city_options) for the initial form (INIT). - Flow from Inbox: When an agent sends a Flow from the Inbox, the platform automatically injects
contact_phone_numberandcontact_nameinto the handler context.
You can read the complete guide on creating dictionaries, bulk JSON/CSV import, and capacity limits in the guide Flow Dictionaries.
Input Variables & Context
Section titled “Input Variables & Context”When the Flow handler is executed, the system automatically populates the following variables inside the execution context:
action: The action type from Meta (INITfor the initial form opening, ordata_exchangewhen the user presses an action button on a screen).screen: The WhatsApp Flow screen ID where the action was triggered (for exampleLOOKUP,PROFILE,PAYMENT).data.*: The data object submitted from the previous screen. For example, if an input field has the valueuser_id, you can access it via{{data.user_id}}.flow_token: A unique correlation token from Meta for the active Flow form.client_account_id: The tenant account ID on the platform.http_handle: The execution result status of the nodehttpRequest.
Value http_handle and Branching Patterns
Section titled “Value http_handle and Branching Patterns”Use the node Condition after calling httpRequest to check the variable http_handle:
success: The API call succeeded (HTTP 2xx code).client_error: A client error occurred, such as data not found or incorrect authentication (HTTP 4xx).server_error: A problem occurred on the service provider’s server (HTTP 5xx).network_error: The request failed to reach the destination server due to connection issues or a timeout.
Connect each output port on the Condition node to the appropriate follow-up flow.
Returning a Response to WhatsApp (waFlowRespond)
Section titled “Returning a Response to WhatsApp (waFlowRespond)”node branches based on handle (one outgoing edge per rule). Respond to Flow (waFlowRespond) is a closing node that every execution path must reach. This node provides 3 operation modes:
-
Navigate (
navigate): Moves to the destination screen (screen/screenTemplate) and sends a dynamic data payload (data/dataTemplate).Example node response data for the screen
RESULT:{"user_id": "{{data.user_id}}","name": "{{user_name}}","plan": "{{user_plan}}","status": "Aktif"} -
Error (
error): Displays an error message directly on the user’s active screen without triggering a screen transition (screenis left empty). Error messages can be filled in via the general message fielderrorMessageor per input field mappingerrorMessages. -
Complete (
complete): Completes the Flow form and returns a success signal (screen: "SUCCESS"). The completion data is sent in the parameter objectparams(underextension_message_response). The system automatically injects the flow token (flow_token) into the response parameters if it has not been explicitly specified.
Screen Data Field Matching & Prohibition of Extra Keys
Property names inside the response JSON data must be exactly the same as the variable names of the control From handler → Variable in the visual Flow editor screen (name, plan).
Keys in the response object data must be a subset of the data model declared by the destination screen. Sending extra keys that are not defined on the destination screen (e.g. sending city_title when the screen only accepts city and branch_options) will cause the WhatsApp app to throw an error “Something went wrong” when landing on that screen. Read more in Meta Constraints on Dynamic WhatsApp Flow.
Connecting to Flow
Section titled “Connecting to Flow”After the handler has been created and saved:
- Open Settings → Form handlers (
/settings/wa-flows). - Find the desired Flow, then click Connect.
- Select the handler you just created.
- Test it using the feature Test Dispatch before publishing to customers.