Actions148
- Chats Actions
- Chat Contacts Actions
- Chat Messages Actions
- Chat Files Actions
- Files Actions
- Team Actions
- Labels Actions
- Departments Actions
- Quick replies Actions
- Queue Actions
- WhatsApp session Actions
- WhatsApp profile Actions
- Business catalog Actions
- Campaigns Actions
- Meeting Links Actions
- User Status Actions
- Webhooks Actions
- Other Actions
- Send messages Actions
- Outbound Messages Actions
- WhatsApp Numbers Actions
- Groups Actions
- Channels Actions
Overview
This node interacts with the SparkBot WhatsApp API to manage WhatsApp sessions, specifically allowing users to reset a WhatsApp session associated with a particular WhatsApp number (device). Resetting a session can be useful in scenarios where the session becomes unresponsive, corrupted, or when you want to clear stored data and queued messages to start fresh.
Practical examples include:
- Clearing all chat history and queued messages for a specific WhatsApp number to troubleshoot issues.
- Waiting for a device to become available before proceeding with further automation steps.
- Selectively deleting only queued messages without affecting stored chats or contacts.
Properties
| Name | Meaning |
|---|---|
| WhatsApp Number | The ID of the WhatsApp number (device) whose session you want to reset. This is selected from available devices. |
| Options | Collection of optional flags to customize the reset behavior: |
| - Delete All Data | Whether to delete all stored chats, messages, and contacts data associated with the device. |
| - Wait For Session | Whether to wait for the device to become available before completing the operation (may delay response up to 2 minutes). |
| - Empty Queue | Whether to delete all queued messages currently pending in the device's message queue. |
Output
The node outputs JSON data representing the result of the reset session operation. This typically includes confirmation of the reset action and any relevant status information returned by the SparkBot API.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the SparkBot WhatsApp API.
- The node depends on the SparkBot service being accessible and the specified WhatsApp number (device) being registered and recognized by the API.
- The "WhatsApp Number" options are dynamically loaded via a method that fetches available devices from the API.
Troubleshooting
Common Issues:
- Invalid or expired API key leading to authentication failures.
- Specifying a WhatsApp number (device) that does not exist or is not registered.
- Network connectivity problems preventing communication with the SparkBot API.
- Long delays if "Wait For Session" option is enabled and the device takes time to become available.
Error Messages:
- Authentication errors: Check that the API key credential is correctly configured and valid.
- Device not found: Verify the WhatsApp number ID is correct and the device is active.
- Timeout waiting for session: If using the wait option, ensure the device is online and reachable.
Resolving these usually involves verifying credentials, checking device IDs, and ensuring network access to the SparkBot API.
Links and References
- SparkBot WhatsApp API Documentation (example placeholder link)
- n8n Documentation on Creating Custom Nodes
- General WhatsApp Business API concepts for context on sessions and devices.