DinastiAPI Trigger icon

DinastiAPI Trigger

Receive WhatsApp events from DinastiAPI with complete event mapping

Overview

This node, named "DinastiAPI Trigger," is designed to receive and process WhatsApp events delivered via the DinastiAPI webhook. It listens for a wide range of WhatsApp-related event types such as incoming messages, call events, group updates, presence changes, media downloads, and more. The node filters and processes these events based on user-defined criteria and outputs structured data for use in workflows.

Common scenarios where this node is beneficial include:

  • Automating responses or actions based on specific WhatsApp message types or content.
  • Monitoring WhatsApp connection status and reacting to connection or pairing events.
  • Tracking group membership changes or message read receipts.
  • Processing media messages with optional inclusion of base64 or S3 media data.
  • Handling Facebook Ads conversion events bridged through WhatsApp.

Practical example:

  • A business could use this node to listen for incoming customer messages containing certain keywords and automatically trigger follow-up workflows.
  • Another use case is monitoring call accept or terminate events to update CRM records accordingly.

Properties

Name Meaning
Events Select which WhatsApp event types to listen for. Options include all standard WhatsApp events like Message, Call Accept, Group Info, Presence, QR code generated, Read Receipt, and many others.
Filters Collection of filters to narrow down processed events:
- From Phone (Sender): Only process messages from a specific phone number (full JID format).
- Chat ID: Only process messages from a specific chat.
- Message Type: Filter by message content type (e.g., text, image, video, sticker, location, etc.).
- Contains Text: Only process messages containing specified text (case insensitive).
- Is Group: Filter messages by source (any, groups only, direct only).
- Is From Me: Filter messages by sender (any, from me only, from others only).
- Token Filter: Only process events matching a specific token string.
Options Additional options to control output and processing:
- Include Raw Data: Include complete raw webhook data for debugging.
- Simplify Output: Simplify output structure for easier consumption.
- Include Media Data: Include base64 and S3 media data in output.
- Parse Message Content: Extract and parse message content from complex message types.
- Allow Unknown Events: Process unknown event types not listed in the Events selection (useful for new/custom event types).

Output

The node outputs JSON data representing the received WhatsApp event, filtered and optionally simplified according to the selected options. The output includes:

  • eventType: The type of event received (e.g., Message, CallAccept).
  • Common event metadata such as token, timestamp.
  • For message events, detailed fields like messageId, chat, sender, timestamp, messageType, mediaType, isFromMe, isGroup, pushName, and optionally verifiedName.
  • Parsed message content fields depending on message type, e.g., text content, URLs, media URLs, captions, thumbnails, contact info, buttons, lists, polls, product details, order info, etc.
  • For ads conversion events, parsed conversion data if available.
  • For other event types, relevant event-specific fields.
  • If enabled, raw webhook data under _rawWebhookData.
  • If media data inclusion is enabled, base64 encoded media, MIME type, file name, and S3 storage info if present.
  • Binary output is empty (binary: {}) as this node does not produce binary data directly.

Dependencies

  • Requires receiving HTTP POST webhooks at the configured path (dinastiapi).
  • Optionally uses an API key credential for DinastiAPI authentication (not mandatory).
  • No additional external libraries are required beyond what n8n provides.
  • Proper configuration of the webhook URL in DinastiAPI to forward WhatsApp events to this node is necessary.

Troubleshooting

  • No events received: Ensure that the webhook URL is correctly set in DinastiAPI and that events are being sent. Verify network connectivity and that the node is active.
  • Events filtered out unexpectedly: Check filter settings carefully, especially phone numbers, chat IDs, message types, and token filters. Filters are case sensitive for some fields.
  • Unknown event types ignored: By default, unknown event types are discarded unless "Allow Unknown Events" option is enabled.
  • Parsing errors for ads conversion data: If ads conversion data fails to parse JSON, raw data is included instead. This may happen if the data format changes.
  • Media data missing: Confirm that "Include Media Data" option is enabled to receive base64 or S3 media information.
  • Simplified output missing fields: Disable "Simplify Output" to get full raw event data for debugging.
  • Credential issues: If using an API key credential, ensure it is valid and has proper permissions.

Links and References

Discussion