Actions29
- Chat Actions
- Group Actions
- Instance Actions
- Message Actions
- Webhook Actions
Overview
This node operation allows sending a media file encoded in base64 format directly to a specific WhatsApp group. It is useful when you want to share images, videos, audio files, documents, or voice messages with all members of a WhatsApp group without needing to upload the file elsewhere first. The media is sent as if it were shared from a local device but using base64 data, which can be generated dynamically or retrieved from other sources.
Practical examples include:
- Sending an image captured and encoded on-the-fly by another system to a project team’s WhatsApp group.
- Sharing PDF reports or Excel spreadsheets with a business group.
- Broadcasting short voice notes or video clips to event participants.
Properties
| Name | Meaning |
|---|---|
| Group JID | The unique identifier of the WhatsApp group to send the media to. Format must be group_id@g.us (e.g., 123456789545@g.us). |
| Base64 Data | The complete base64 encoded string of the media file including the data URI prefix (e.g., data:image/png;base64,... or data:application/pdf;base64,...). This represents the actual content of the media to send. |
| File Name | The name that the file will have when received in WhatsApp (e.g., example.pdf). |
| Media Type | The type of media being sent. Options are: Audio, Document, Image, PTT (voice message), Video. This determines how WhatsApp treats and displays the media. |
| MIME Type | The MIME type of the media file. Options include common formats such as Audio (OGG), Binary/Other Files, Excel (XLSX), Image (JPEG), PDF, SQL File, Video (MP4), Word Document. This helps WhatsApp correctly identify the file type. |
| Caption | Optional text caption to accompany the media file in the WhatsApp message. |
Output
The output JSON contains details about the message sent to the WhatsApp group. This typically includes:
- Message status (e.g., sent, delivered)
- Message ID assigned by WhatsApp
- Delivery confirmation information
If the operation supports binary data output, it would represent the media content or related attachments, but in this case, the node primarily outputs JSON metadata about the sent message.
Dependencies
- Requires a valid WhatsApp API service connection configured with an API key or token.
- The node depends on the MegaAPI WhatsApp service for sending messages.
- Proper credentials with authorization token and host URL must be set up in n8n.
- The user must be a member of the target WhatsApp group to send media successfully.
Troubleshooting
- Invalid Group JID: If the group ID is incorrect or the bot/user is not a member of the group, the message will fail to send. Verify the group JID format and membership.
- Malformed Base64 Data: The base64 string must include the correct data URI prefix and be properly encoded. Errors here will cause the media upload to fail.
- Unsupported MIME Type or Media Type Mismatch: Ensure the MIME type matches the media type selected; otherwise, WhatsApp may reject the file.
- Authorization Errors: If the API token or credentials are invalid or expired, the request will be denied. Refresh or update credentials accordingly.
- Network Issues: Connectivity problems with the WhatsApp API endpoint can cause timeouts or failures.
Common error messages usually indicate one of these issues and can be resolved by checking input parameters, credentials, and network connectivity.
Links and References
- WhatsApp Group JID Format Explanation
- Base64 Encoding Guide
- MIME Types Reference
- MegaAPI WhatsApp Service Documentation (refer to your API provider's official docs)