Actions85
- Instances Actions
- Client Actions
- Message Actions
- Chat Actions
- Contact Actions
- Number Actions
- Group Actions
- Channel Actions
- Label Actions
- Story Actions
Overview
This node operation fetches messages from a specified chat in WhatsApp using the WaAPI service. It is useful for retrieving historical or recent messages from individual or group chats, enabling workflows that analyze conversations, archive messages, or trigger actions based on message content.
Practical examples include:
- Extracting the last 10 messages from a customer support chat to analyze customer inquiries.
- Fetching messages sent by the user to track outgoing communication.
- Retrieving media attachments from chats for processing or storage.
Properties
| Name | Meaning |
|---|---|
| Id | Instance ID (a required numeric identifier for the API instance). |
| Chat Id | The unique identifier of the chat to fetch messages from. Format: <countrycode_short><usernumber>@c.us for individual chats or @g.us for groups. |
| Limit | Maximum number of messages to return in one request. |
| Offset | Number of messages to skip before starting to fetch (used for pagination). |
| From Me | Filter messages by sender: true for messages sent by the user, false for received messages, or null for both. |
| Include Media | Whether to include media content as base64 encoded strings in the response. Warning: this can significantly increase response size. |
Output
The output JSON contains an array of message objects fetched from the specified chat. Each message object typically includes details such as message ID, sender information, timestamp, message content, and optionally media content encoded in base64 if requested.
If media inclusion is enabled, the binary data is embedded as base64 strings within the JSON, allowing further processing or saving of media files.
Dependencies
- Requires an active connection to the WaAPI service via an API key credential.
- The node expects the API base URL
https://waapi.app/api/v1. - Proper authentication credentials must be configured in n8n to authorize requests.
Troubleshooting
- Invalid Chat Id: If the chat ID format is incorrect or the chat does not exist, the API may return an error or empty results. Verify the chat ID format and existence.
- Authentication Errors: Missing or invalid API credentials will cause authorization failures. Ensure the API key is correctly set up.
- Large Response Size: Enabling "Include Media" can lead to very large responses, potentially causing timeouts or memory issues. Use this option cautiously and consider limiting the number of messages fetched.
- Offset and Limit Misuse: Using an offset larger than the total number of messages will result in empty responses. Adjust these parameters according to the chat history size.
Links and References
- WaAPI Official Documentation β For detailed API usage and message structure.
- WhatsApp Chat ID Format Explanation β Understanding chat identifiers.
- n8n Documentation β General guidance on setting up credentials and using nodes.