Overview
This node acts as a webhook trigger for WARest, a service that sends webhook events related to WhatsApp messaging and session activities. It listens for incoming POST requests on a configurable path, verifies the request signature using shared secrets for security, and filters events based on user-defined allowed event types. The node supports various response modes to acknowledge receipt of events and can include HTTP headers and raw body data in its output. It is useful for workflows that need to react to WhatsApp session updates, messages, group changes, and other related events from WARest.
Use Case Examples
- Trigger a workflow when a new WhatsApp message is received to automate customer support responses.
- Monitor session status changes to update user presence in a CRM system.
- React to group participant changes to manage group membership automatically.
Properties
| Name | Meaning |
|---|---|
| Webhook Path | Relative path that WARest will call to send webhook events. |
| Shared Secrets | Comma or newline separated secrets used to verify the webhook signature for security. |
| Events | List of event types to accept; if empty, all events are accepted. |
| Additional Fields | Optional settings including whether to include HTTP headers, raw body, response mode, static response JSON, response actions, response delay, signature verification options, and timestamp freshness verification. |
Output
JSON
event- The event type received from WARest.ts- Timestamp of the event.sessionid- Session ID associated with the event.
metadataevent- Event type metadata.sessionId- Session ID from headers or payload.registry- Registry information from headers.username- Username from headers.timestamp- Timestamp from headers.eventId- Event ID from headers.version- Version information from headers.
eventId- Event identifier.version- Version of the event.sessionId- Session identifier.username- Username associated with the event.headers- HTTP headers included if configured.rawBody- Raw JSON string of the webhook payload if configured.signatureValid- Boolean indicating if the webhook signature was valid.
Dependencies
- node:crypto
Troubleshooting
- Ensure that at least one webhook secret is configured unless signature verification is disabled for debugging.
- If the webhook signature verification fails, check that the shared secrets match those configured in WARest sessions.
- If the timestamp verification is enabled, ensure the webhook request timestamp is within the allowed tolerance to avoid rejection.
- If no events are triggering the workflow, verify that the allowed events list is correctly configured or left empty to accept all events.
