Actions83
- Instances Actions
- Client Actions
- Message Actions
- Chat Actions
- Contact Actions
- Number Actions
- Group Actions
- Channel Actions
- Label Actions
- Story Actions
Overview
The node fetches messages from a specified chat in the WhatsApp environment via the WaAPI service. It allows retrieving recent messages with options to filter by sender and include media content. This is useful for scenarios such as monitoring conversations, archiving chat history, or processing incoming messages for automation workflows.
Practical examples:
- Fetch the last 10 messages from a group chat to analyze conversation trends.
- Retrieve only messages sent by the user to track outgoing communication.
- Include media attachments encoded in base64 to process images or videos shared in chats.
Properties
| Name | Meaning |
|---|---|
| Id | Instance ID (a numeric identifier for the API instance or session) |
| Chat Id | The unique identifier of the chat to fetch messages from. Format: <countrycode><number>@c.us for individual chats or @g.us for groups |
| Limit | Maximum number of messages to return (integer) |
| From Me | Filter messages by sender: true = messages sent by the user, false = received messages, null = both |
| Include Media | Whether to include media content as base64 encoded strings. Warning: can significantly increase response size |
Output
The output contains a JSON array of message objects fetched from the specified chat. Each message object includes details such as message content, sender information, timestamps, and optionally media data encoded as base64 strings if requested.
If media inclusion is enabled, the node outputs the media content embedded within the message data, allowing further processing or storage of images, audio, or video files.
Dependencies
- Requires an active connection to the WaAPI service endpoint (
https://waapi.app/api/v1). - Needs an API key credential configured in n8n for authentication with the WaAPI.
- The node depends on the external WaAPI REST API to fetch messages.
Troubleshooting
Common issues:
- Invalid or missing chat ID format may cause the API to reject the request.
- Requesting too many messages or including media might lead to large payloads and timeouts.
- Incorrect or expired API credentials will result in authentication errors.
Error messages:
- Authentication failures: Verify that the API key credential is correctly set up and valid.
- "Chat not found" or similar: Confirm the chat ID exists and is accessible by the authenticated user.
- Payload too large or timeout errors: Reduce the limit or disable media inclusion to decrease response size.
Links and References
- WaAPI Documentation – Official API documentation for message fetching and other operations.
- WhatsApp Chat ID Format – Explanation of chat ID formats used in WhatsApp.