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 integrates with the SparkBot WhatsApp API to manage chat assignments within a WhatsApp environment. Specifically, the "Assign Chat" operation under the "Chats" resource allows users to assign a particular WhatsApp chat to an agent or department for handling.
Common scenarios where this node is beneficial include:
- Customer support teams routing incoming WhatsApp chats to specific agents based on workload or expertise.
- Assigning chats to departments for specialized handling (e.g., sales, technical support).
- Automating chat assignment workflows in contact centers using WhatsApp as a communication channel.
Practical example:
- When a new customer message arrives on a WhatsApp number, the node can assign that chat to a specific agent by their ID or email, or to a department, ensuring timely and organized responses.
Properties
| Name | Meaning |
|---|---|
| WhatsApp Number | The ID of the WhatsApp number (device) from which the chat originates or is managed. |
| Chat ID | The unique identifier of the chat to be assigned (e.g., 447362053576@c.us for user chat). |
| Assignment Type | Method of assignment; options are: - Agent ID - Agent Email - Department - Agent and Department |
| Agent ID | The ID of the agent to whom the chat will be assigned (required if Assignment Type includes agent by ID). |
| Agent Email | The email address of the agent to assign the chat to (required if Assignment Type is by email). |
| Department ID | The ID of the department to assign the chat to (required if Assignment Type includes department). |
Output
The node outputs JSON data representing the result of the chat assignment operation. This typically includes confirmation details such as the assigned agent or department information and status of the assignment.
No binary data output is involved in this operation.
Dependencies
- Requires an active connection to the SparkBot WhatsApp API.
- Needs an API key credential configured in n8n for authenticating requests to the SparkBot service.
- The node depends on dynamic loading of options for devices, agents, and departments via internal methods (
getDevices,getTeamAgents,getDepartments), which require proper API access.
Troubleshooting
Common issues:
- Invalid or missing WhatsApp number (device) ID may cause failures in identifying the chat source.
- Incorrect or non-existent Chat ID will prevent successful assignment.
- Providing mismatched assignment type and missing required fields (e.g., selecting "Agent Email" but not providing an email) will cause errors.
- API authentication errors due to invalid or expired API keys.
Error messages and resolutions:
"Chat not found": Verify the Chat ID is correct and exists on the specified WhatsApp number."Agent or Department not found": Confirm the agent ID/email or department ID is valid and accessible."Authentication failed": Check the API key credential configuration and renew if necessary."Missing required parameter": Ensure all required properties for the chosen assignment type are provided.
Links and References
- SparkBot WhatsApp API Documentation (general reference for API capabilities)
- n8n Documentation on Creating Custom Nodes
- WhatsApp Business API concepts for chat management and assignment (for conceptual understanding)