WSAPI Trigger icon

WSAPI Trigger

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

Overview

This node acts as a webhook trigger for WebSocket API (WSAPI) events related to chat activities. It listens for specific chat event types such as changes in chat settings (mute, pin, archive, ephemeral) and chat presence updates (typing, recording, paused). When one of the selected chat events occurs, the node receives the event data via a webhook and triggers the workflow.

Common scenarios where this node is beneficial include:

  • Automating responses or logging when chat settings are changed.
  • Monitoring user presence status in chats to trigger notifications or update dashboards.
  • Integrating chat activity with other systems by reacting to real-time chat events.

For example, you could use this node to automatically archive chats when they are muted or to notify a team when someone starts typing in a group chat.

Properties

Name Meaning
Chat Events Select which chat events to listen for. Options: "Chat Setting" (chat settings changed), "Chat Presence" (chat presence updated)
Parse Event Data Whether to parse the eventData field based on event type 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 Custom header name used for webhook authentication (string, required if authentication enabled)
Auth Header Value Expected value for the authentication header (string, required if authentication enabled)

Output

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

  • instanceId: Identifier of the WSAPI instance sending the event.
  • receivedAt: Timestamp when the event was received.
  • eventType: The type of chat event (e.g., "chat_setting", "chat_presence").
  • Parsed event data fields merged from eventData if parsing is enabled.
  • Optionally, the raw webhook payload under rawEvent if requested.

If the event is a message event containing media and auto-download is enabled (not applicable here since the resource is "Default" and operation is "On Chat Event"), the node attempts to download the media file and attaches it as binary data named after the media ID or filename.

No binary data output is expected specifically for chat events.

Dependencies

  • Requires an optional API key credential to authenticate requests when downloading media files (though media download is not relevant for chat events).
  • If webhook authentication is enabled, requires configuration of a custom HTTP header name and expected value to validate incoming webhook requests.
  • No external service calls are made for chat events beyond webhook reception.

Troubleshooting

  • Webhook Authentication Failure: If enabled, the node expects a specific header with a matching value. Missing or incorrect headers will cause the webhook to ignore the request without triggering the workflow.
  • Missing Event Data: Incoming webhook payloads must contain eventType and eventData. Payloads missing these fields will be ignored.
  • Unsubscribed Event Types: If the event type received is not among the selected chat events, the webhook will not trigger.
  • Media Download Errors: Not applicable for chat events but generally, failures to download media files will be recorded in the output under a downloadError field.

Links and References

Discussion