Wuzapi Trigger icon

Wuzapi Trigger

Receive WhatsApp events from Wuzapi with complete event mapping

Overview

This node, named "Wuzapi Trigger," is designed to receive and process WhatsApp events from the Wuzapi service. It acts as a webhook trigger that listens for various WhatsApp-related event types such as incoming messages, call events, group updates, presence changes, 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 or call events for operational insights.
  • Integrating WhatsApp group or contact updates into CRM or notification systems.
  • Processing Facebook Ads conversion events linked to WhatsApp interactions.
  • Handling media messages with optional inclusion of base64 or S3 media data.

Practical example:

  • A business wants to automatically respond to incoming WhatsApp text messages containing the word "order" and log these messages along with sender details.
  • Another use case is to track when users join or leave WhatsApp groups and update membership records accordingly.

Properties

Name Meaning
Events Select which WhatsApp event types to listen for. Options include all standard WhatsApp events like Message, Call Offer, Group Info, Presence, Read Receipt, and many others. Selecting "All" subscribes to every event type.
Filters Collection of filters to narrow down processed events:
- From Phone (Sender): Only process messages from this full JID phone number.
- Chat ID: Only process messages from this chat (group or direct).
- 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, or direct only).
- Is From Me: Filter messages by sender (any, from me only, or from others only).
- Token Filter: Process only events matching a specific token string.
Options Additional processing options:
- 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 or custom event types.

Output

The node outputs JSON data representing the received WhatsApp event, optionally simplified and filtered according to the node's settings.

The main output fields include:

  • eventType: The type of the event (e.g., Message, CallOffer, GroupInfo).
  • token: Event token identifier.
  • timestamp: ISO timestamp of the event processing time.
  • For message events:
    • messageId, chat, sender, timestamp, messageType, mediaType, isFromMe, isGroup, pushName, and optionally verifiedName.
    • Parsed message content fields depending on message type, e.g., text, caption, imageUrl, videoUrl, audioUrl, locationName, contactName, buttons, pollName, productId, orderId, etc.
    • If enabled, media data fields like mediaBase64, mediaMimeType, mediaFileName, and s3Data.
  • For other event types, relevant fields such as order details, call data, presence info, read receipts, ads conversion data, etc.
  • If unknown event types are allowed, the node includes raw event data and debug information.
  • When enabled, the raw webhook payload is included under _rawWebhookData.

Binary output is empty (binary: {}) since this node does not produce binary data directly; media content is included as base64 strings if configured.

Dependencies

  • Requires receiving webhook calls from the Wuzapi WhatsApp integration service.
  • Optionally uses an API key credential for Wuzapi authentication (configured in n8n credentials).
  • No additional external libraries beyond standard n8n dependencies are required.

Troubleshooting

  • No events received: Ensure the webhook URL is correctly configured in Wuzapi and that the node is active.
  • Filtered out events: Check filter settings carefully; overly restrictive filters (e.g., wrong phone number format, chat ID, or message type) may cause no events to pass through.
  • Unknown event types ignored: Enable "Allow Unknown Events" option to process new or custom event types.
  • Media data missing: Verify "Include Media Data" option is enabled to receive base64 or S3 media content.
  • Parsing issues: If message content parsing fails or is incomplete, try toggling "Parse Message Content" option.
  • Error messages: Errors typically relate to invalid webhook payloads or misconfiguration; check raw webhook data if enabled for debugging.

Links and References

Discussion