Actions55
- Session Actions
- Message Actions
- Chat Actions
- Contact Actions
- Group Actions
- Webhook Actions
- Status Actions
Overview
This node integrates with the WAHA API to manage WhatsApp chats and conversations. Specifically, the "Get Chats" operation under the "Chat" resource retrieves all chats associated with a specified WhatsApp session. This is useful for workflows that need to list or process existing chat threads, such as monitoring active conversations, archiving chat data, or triggering actions based on chat presence.
Practical examples:
- Automatically fetching all chats to display recent conversations in a dashboard.
- Triggering follow-up messages or notifications based on active chats.
- Archiving or analyzing chat metadata for customer support insights.
Properties
| Name | Meaning |
|---|---|
| Session Name | The name of the WhatsApp session to use for the request. Defaults to the configured default session. |
| Additional Fields | Optional extra parameters; for "Get Chats" operation, no specific additional fields are used here. |
Note: The "Additional Fields" collection includes options like Filename, Mimetype, Limit, Download Media, etc., but for the "Get Chats" operation, these do not affect the request.
Output
The output JSON contains the response from the WAHA API endpoint /api/sessions/{sessionName}/chats. This typically includes an array of chat objects representing each chat/conversation in the session. Each chat object may contain details such as chat ID, contact or group info, last message timestamp, unread count, and other metadata.
No binary data is returned by this operation.
Example output structure (simplified):
[
{
"id": "5511999999999@c.us",
"name": "Contact Name",
"lastMessageTimestamp": 1680000000,
"unreadCount": 2,
"isGroup": false,
...
},
{
"id": "123456789-123456@g.us",
"name": "Group Chat Name",
"lastMessageTimestamp": 1680000100,
"unreadCount": 0,
"isGroup": true,
...
}
]
Dependencies
- Requires a valid WAHA API credential with base URL and API key.
- Optionally uses an additional API key credential for N8N Tools API validation.
- The node expects the WhatsApp session to be active and accessible via the WAHA API.
- No other external dependencies are required.
Troubleshooting
- Invalid subscription or API key error: If the node throws an error about invalid subscription or API key, verify that both the WAHA API credentials and the optional N8N Tools API credentials are correctly set and active.
- Unknown chat operation error: Ensure the operation selected is supported ("getChats" in this case).
- Session not found or inactive: Confirm that the specified WhatsApp session name exists and is currently active in WAHA.
- Network or API errors: Check connectivity to the WAHA API base URL and ensure the API key has sufficient permissions.
Links and References
- WAHA API Documentation (replace with actual URL if available)
- WhatsApp Business API Overview
- n8n Documentation on Creating Custom Nodes