Overview
This node acts as a trigger for SparkBot events related to WhatsApp messaging and group activities. It listens for various webhook events such as inbound/outbound messages, message reactions, group updates, status updates, and contact changes. When one of the subscribed events occurs, the node activates the workflow with the event data.
Common scenarios where this node is beneficial include:
- Automating responses or processing when new WhatsApp messages arrive.
- Tracking message delivery statuses or read receipts.
- Monitoring group membership changes or chat updates.
- Reacting to user status updates or contact information changes.
- Integrating WhatsApp Channel messages into workflows.
For example, you could use this node to start a workflow that sends an automated reply whenever a new inbound text message is received or to log all message delivery failures for auditing purposes.
Properties
| Name | Meaning |
|---|---|
| Webhook name | Internal name for the webhook (max 30 characters) to identify it within your workflows. |
| WhatsApp number | Optionally restrict webhook events to a specific WhatsApp number/device. If left empty, listens to all. |
| Events | The list of event types to subscribe to. Options include: - New Inbound Message Received - New Outbound Message Delivered - Message Read or Played by User - Message Delivery Failed - Group Updated - Message Updated (Poll Votes, Meeting Events) - Message Reaction Added/Removed - New User Status Published - New Channel Message Received - Chat Updated (Assigned, Resolved, etc.) - WhatsApp Session Changes - Contact Information Updated |
| Sample event to notify | Select a sample event matching your use case to test and configure the webhook JSON data structure in subsequent workflow steps. Optional. |
Output
The node outputs the webhook event payload as JSON data. Each execution returns an array containing one item representing the event data received from SparkBot. The structure of this JSON depends on the event type but generally includes details about the message, group, contact, or status update involved.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the SparkBot service.
- Needs network access to register and receive webhooks from the SparkBot API.
- The node dynamically loads available WhatsApp devices and sample events via API calls.
- Environment variable
N8N_RUNTIME_CLIENTinfluences some internal behavior but does not affect usage.
Troubleshooting
- Webhook registration errors: If the webhook URL is missing or invalid, the node will throw an error during creation. Ensure your workflow has a valid webhook URL.
- No events selected: The node requires at least one event subscription; otherwise, it will error out.
- API authentication issues: Invalid or missing API keys will cause request failures. Verify your API key credential is correctly configured.
- Device restrictions: Selecting a WhatsApp number that is not connected or authorized may result in no events being triggered.
- Webhook existence check failures: If the webhook ID stored in static data becomes invalid (e.g., deleted externally), the node attempts to clean up and recreate it.
- HTTP 409 Conflict on webhook creation: Indicates a webhook with the same parameters already exists; usually safe to ignore.
Links and References
- SparkBot API Documentation (for webhook event types and payloads)
- n8n Webhook Trigger Node Guide: https://docs.n8n.io/nodes/n8n-nodes-base.webhook/
- Axios HTTP Client (used internally for API requests): https://axios-http.com/