WSAPI Trigger icon

WSAPI Trigger

Trigger on WSAPI webhook events (messages, chats, calls, users, etc.)

Overview

This node acts as a webhook trigger for contact and group-related events from a WSAPI service. It listens for updates on contacts or groups, such as changes in contact information or group details, and triggers workflows accordingly. This is useful for automating processes that depend on real-time updates to contact or group data, like syncing contact lists, updating CRM records, or notifying teams about group membership changes.

For example, when a contact's information is updated, the node can trigger a workflow that updates that contact's details in an external database. Similarly, if a group is modified, it can initiate notifications or synchronize group data with other systems.

Properties

Name Meaning
Contact & Group Events Select which events to listen for: "Contact" (contact information updated), "Group" (group information updated)
Parse Event Data Whether to parse the event data for easier access to its fields (true/false)
Include Raw Event Whether to include the original webhook payload in the output (true/false)
Webhook Authentication Enable custom header authentication for incoming webhooks (true/false)
Auth Header Name The name of the HTTP header used for webhook authentication (e.g., "X-Webhook-Auth")
Auth Header Value The expected value of the authentication header to validate incoming webhook requests

Output

The node outputs JSON data representing the event received. The structure includes:

  • instanceId: Identifier of the instance sending the event.
  • receivedAt: Timestamp when the event was received.
  • eventType: The type of event triggered ("contact" or "group").
  • Parsed event data fields merged into the output if parsing is enabled.
  • Optionally, the raw webhook payload under rawEvent if requested.

If the event contains media (not typical for contact/group events but supported generally), and auto-download is enabled, the node attempts to download the media file and includes it as binary data in the output with metadata such as filename and MIME type.

Dependencies

  • Requires configuration of an API key credential to authenticate media downloads if auto-download is enabled.
  • Needs the base URL and instance ID of the WSAPI service for media retrieval.
  • Optional webhook authentication via custom HTTP headers requires setting the header name and expected value.

Troubleshooting

  • No webhook response: If the incoming webhook payload lacks required fields (eventType or eventData) or the event type is not among the selected ones, the node will not respond or trigger.
  • Authentication failures: When webhook authentication is enabled, ensure the incoming request includes the correct header with the expected value; otherwise, the webhook is ignored.
  • Media download errors: If auto-download is enabled but media cannot be retrieved (due to invalid credentials, network issues, or missing media ID), the node logs a download error in the event data but still outputs the event.
  • Incorrect event filtering: Verify that the selected events in the node settings match the actual event types sent by the WSAPI service to avoid missed triggers.

Links and References

  • WSAPI official documentation (for event types and webhook setup)
  • n8n webhook trigger node documentation (general concepts)

Discussion