Configure a Dialogue Tree for Static WhatsApp Flows
Updated
This article explains how to configure a Dialogue Tree to send and process a WhatsApp Flow within Sprinklr. Using this setup, brands can launch interactive WhatsApp Flows, capture customer responses, and continue the conversation based on submitted inputs.
The configuration uses a series of Update Properties, Bot Reply, Decision Box, and End Dialogue Tree nodes.
Prerequisites
Before you begin, obtain the following details from the WhatsApp Flow created in Meta:
Obtain Flow ID: Retrieve the unique identifier of the WhatsApp Flow created in Meta.
Get First Screen Name: Note the name of the initial screen defined in the flow.
Step 1: Create and Save the WhatsApp Flow in Meta
1. Create your flow using the Flow Playground, or prepare the Flow JSON to be used for the WhatsApp Flow.
2. Log in to your Meta Business Manager and navigate to the Flows section in the left pane.
.png)
3. Click Create Flow in the top right corner and provide the required details, such as:
Flow Name
Category
Other mandatory flow configurations
.png)
4. Click Create in the bottom right corner.
You will be taken to the Editor window, where you can add the required screens and components.
5. Save the flow configuration.
Step 2: Identify the First Screen Name
The First Screen Name corresponds to the initial screen displayed when the flow is launched.
To find the First Screen Name:
1. On the flow Editor window, navigate to the Flow Preview panel displayed on the right side of the editor.
2. Identify the screen shown first in the preview.
3. Note the screen name displayed above the preview, and save the flow by clicking Save in the top right corner.

Example: First Screen Name - Recommend
The First Screen Name must exactly match the screen name configured in the Meta Flow. Any mismatch may prevent the flow from loading correctly.
Step 3: Retrieve the Flow ID
Once the flow has been saved:
1. Open the flow details page in Meta.
2. Locate the generated Flow ID.
3. Copy and save this value, as it will be required during Dynamic Tree configuration.

Information Required Before Proceeding
Ensure you have the following details available before starting the Dynamic Tree configuration:
Parameter | Description |
Flow ID | Unique identifier generated for the WhatsApp Flow in Meta. |
First Screen Name | Name of the initial screen displayed when the Flow is launched. |
Note: All sample values used throughout this article are placeholders. Replace them with the actual Flow ID and First Screen Name obtained from your Meta WhatsApp Flow before completing the configuration.
Replace the sample values in this article with the actual Flow ID and First Screen Name shared for your flow.
Recommended Flow Structure
Pre-configuration node 1
Pre-configuration node 2
Flow asset preparation node
Message & CTA configuration node
Send Flow node
Decision node (filled vs non-filled)
Capture flow response node
Confirmation message node
End nodes
Step 1: Create First Update Properties Node
Node Name
preconfignode1
Configuration
Create a field named:
data1
Custom Code
return "default";This initializes a default property used in later steps.

Step 2: Create Second Update Properties Node
Node Name
preconfignode2
Configuration
Create a field named:
flow_template
Custom Code
Paste the complete provided WhatsApp Flow template code exactly as shared.
Note: Do not modify the structure. Ensure the full code block is copied and pasted without omissions.

def sam =JSON_UTILS.parseJson({"_id": "6873015dbb0013160cc0146e","assetStatus": "APPROVED","availableAfterTime": 1702035767466,"visibleFromTime": 1702035767466,"visibleTillTime": 2208988800000,"expiryTime": 2208988800000,"neverExpire": True,"deletePostsOnExpiry": False,"hasExtensionRequests": False,"autoImported": False,"locked": False,"featured": False,"restricted": False,"hidden": False,"contentEditingProhibitedInPublisher": False,"channelTypes": ["WHATSAPP_BUSINESS"],"expiryModifiedTime": 1702035807915,"approval": {"approvalOption": "NONE","processInitiated": False,"name": "WA-GuidedContent","assetType": "TEMPLATE_ASSET","assetSubType": "","socialAsset": {"channelType": "WHATSAPP_BUSINESS","templateType": "GUIDED_WORKFLOW","omnichannelTemplate": True,"content": {"_id": "9f0d24a7-85f1-467e-8f02-20ac1e8503fa","title": "WA Title Here","flowId": "417177562256720","firstScreen": "RECOMMEND","paramsToPass": ["data1"],"header": {"text": "Header text"},"footerText": "Footer here","submit": {"title": "Submit Title","forceRefresh": False,"reSubmittable": True,"showSubmittedContent": False,"additional": {"headerInfo": {"samId": "6873015dbb0013160cc0146e"}}}}}}})
Step 3: Create Flow Asset Node
Node Name
flowtemplateprop

Configuration
Create a field named:
flow_asset
Custom Code
Use the provided code snippet and update:
Flow ID
First Screen Name
Replace only these values. Keep the remaining code unchanged.
def flow_asset_sam = flow_template;flow_asset_sam.socialAsset.content['flowId'] = '1504309293900354';flow_asset_sam.socialAsset.content['firstScreen'] = 'newScreen_ced'return flow_asset_sam;
Step 4: Create Message & CTA Configuration Node
Node Name
PostPublish - Message & CTA Text

Configuration
Create / update field:
flow_asset
Custom Code
def flow_asset_updated = flow_asset;flow_asset_updated.socialAsset.content.header['text'] = 'abcd';flow_asset_updated.socialAsset.content['title'] = 'BTEST';flow_asset_updated.socialAsset.content['footerText'] = '';flow_asset_updated.socialAsset.content.submit['title'] = 'Open';
Purpose
Use this node to customize the message shown to the customer.
Editable Values
Header Text – Main heading
Title – Main message body
Footer Text – Additional context
CTA Button Title – Button label shown to the user
Example:
Header: Complete Your Registration
Title: Please fill out the short form below
Footer: Takes less than 1 minute
CTA: Open Form

Step 5: Send the WhatsApp Flow
Node Type
Bot Reply
Node Name
Send Flow in WhatsApp
Configuration
Enable Write Script to Publish Dynamic Asset
Text Reply
return flow_asset;This publishes the configured WhatsApp Flow to the customer.

Step 6: Prevent Conversation Looping
Node Type
Decision Box
Node Name
filled vs non-filled
Purpose
Ensures the conversation does not continue endlessly if the user does not submit the flow.
Paths
Path 1: filled
Default Path: fallback path
Use the response variable configured in the previous nodes as the decision condition.

Step 7: Capture Flow Responses
Node Type
Update Properties
Node Name
receiving flow response
Purpose
Map all responses submitted in the WhatsApp Flow.
Create separate variables for each field present in the flow JSON.
Examples:
customer_name
email
mobile
city
preference
Configuration
Use custom code to extract each payload field from the flow response JSON.
{
"label": "Done",
"on-click-action": {
"name": "complete",
"payload": {
"screen_1_Pick_a_date_0": "${form.Pick_a_date_d8b455}",
"screen_1_Select_time_slots_1": "${form.Select_time_slots_c67259}",
"screen_0_First_Name_0": "${data.screen_0_First_Name_0}",
"screen_0_Last_Name_1": "${data.screen_0_Last_Name_1}",
"screen_0_Email_2": "${data.screen_0_Email_2}",
"screen_0_Company_Name_3": "${data.screen_0_Company_Name_3}",
"screen_0_Select_Department_4": "${data.screen_0_Select_Department_4}",
"screen_0_Mobile_Number_5": "${data.screen_0_Mobile_Number_5}"
}
}
}
def res = JSON_UTILS.parseJson(MESSAGE.TEXT).screen_0_Rate_Product_0;
return res;
String str = "{\"key1\": \"val1\", \"key2\": \"val2\"}";
def res = JSON_UTILS.parseJson(str);
def typeObj = res.getClass();
def val1 = res.get("key1");
return val1;
Also, create one variable to capture all submitted values if required for reporting or storage.

Step 8: Send Confirmation to User
Node Type
Bot Reply
Send a confirmation message showing the inputs received.
Example
Thank you for submitting the form.Name: {{customer_name}}Email: {{email}}City: {{city}}This confirms successful flow submission.

Note: This configuration is provided as an example. The fields, values, and mappings may vary based on the specific business use case and Flow requirements.
Step 9: End the Dialogue Tree
Add:
End Dialogue Tree Node in the filled branch.
End Dialogue Tree Node in the default branch as well.
This ensures a clean closure of the conversation.
Note:
Double-check all variable names.
Ensure no typos in field names or payload mapping.
Missing or incorrect fields may cause flow submission errors.
Copy template code exactly where instructed.
Best Practice
Test the complete flow in a sandbox environment before production deployment.