Overview
The WhatsApp Flow Analyze node is designed to analyze responses from WhatsApp Flows, particularly those received via webhook or provided as JSON input. It extracts specific fields from the flow response data based on user-defined JSON paths and expected data types. This node is useful for workflows that need to process and interpret interactive WhatsApp messages, such as replies within a flow, enabling further automation or decision-making based on extracted information.
Common scenarios:
- Processing incoming WhatsApp webhook data to extract message details and flow interaction tokens.
- Parsing manually provided JSON responses from WhatsApp flows for testing or batch processing.
- Extracting custom fields from complex WhatsApp flow responses to use in subsequent workflow steps.
Practical example:
A user receives WhatsApp messages through a webhook and wants to extract the message ID, sender's phone number, timestamp, and specific flow response fields (e.g., user selections or inputs) to store them in a database or trigger other actions.
Properties
| Name | Meaning |
|---|---|
| Source Des Données | Selects the source of the flow response data to analyze: - Webhook Data: Analyze data received via webhook. - JSON Input: Analyze manually provided JSON data. |
| Données JSON | JSON data of the flow response to analyze. Visible only if "Source Des Données" is set to "JSON Input". |
| Extraire Les Champs | Collection of fields to extract from the flow response. For each field: - Nom Du Champ: The name to assign to the extracted field. - Chemin JSON: JSON path to locate the field in the response (e.g., response.data.field).- Type De Données: Expected data type of the field ( Array, Boolean, Number, Object, String). |
Output
The node outputs an array with one item per input. Each output item contains a JSON object with the following structure:
- success: Boolean indicating if the extraction was successful.
- messageId: The ID of the WhatsApp message.
- from: The sender's phone number.
- timestamp: Timestamp of the message.
- flowToken: Raw JSON string token representing the flow reply.
- flowData: Parsed JSON object of the flow reply data.
- extractedFields: An object containing all user-defined extracted fields with their values converted to the specified data types.
- originalData: The original input data used for extraction.
If an error occurs during processing and the node is configured to continue on failure, the output will contain:
- success: false
- error: Error message describing the issue.
The node does not output binary data.
Dependencies
- Requires incoming WhatsApp webhook data structured according to WhatsApp's messaging API format or valid JSON input.
- No external API calls or credentials are required by this node itself.
- Proper configuration of the webhook or JSON input source upstream is necessary for meaningful data.
Troubleshooting
- Invalid JSON Input: If the JSON data provided manually is malformed, the node throws an error
"Données JSON invalides". Ensure the JSON is correctly formatted. - Missing Fields in Webhook Data: If the expected message structure is not present in the webhook data, extracted fields may be null or missing. Verify the webhook payload matches WhatsApp's expected schema.
- Incorrect JSON Paths: If the JSON path for a field is incorrect or does not exist in the response, the extracted value will be
null. Double-check JSON paths for accuracy. - Type Conversion Issues: If the actual data type does not match the expected type, conversion might produce unexpected results. Adjust the "Type De Données" accordingly.
- Error Handling: If the node is not set to continue on failure, any error will stop the workflow execution. Enable "Continue On Fail" if partial processing is acceptable.
Links and References
- WhatsApp Business API Documentation
- n8n Documentation - Creating Custom Nodes
- JSONPath Syntax Guide (for constructing JSON paths)