Actions29
- Chat Actions
- Group Actions
- Instance Actions
- Message Actions
- Webhook Actions
Overview
This node operation allows forwarding an existing WhatsApp message to another contact using the MegaAPI WhatsApp service. It is useful when you want to programmatically resend a received or stored message to a different WhatsApp user without manually copying and pasting the content.
Common scenarios include:
- Automatically forwarding customer support messages to supervisors.
- Resending important notifications or alerts to multiple contacts.
- Creating workflows that replicate messages across different chats or groups.
For example, if you receive a message from one contact and want to forward it to another contact for follow-up, this operation can do so by specifying the original message's key and content along with the target recipient.
Properties
| Name | Meaning |
|---|---|
| To (Contact) | The WhatsApp contact to forward the message to. Must be in the format phone_number@s.whatsapp.net (e.g., 551199999999@s.whatsapp.net). |
| Key (JSON) | The message key object identifying the original message to forward. It includes fields such as remoteJid (the sender or chat ID), fromMe (boolean indicating if the message was sent by the user), and id (message ID). |
| Message (JSON) | The message object containing the actual message content and metadata to forward. This typically includes the conversation text and timestamp or other relevant message details. |
| Information | A notice explaining that forwarding requires both the message key and message object, which are usually obtained from webhook events or message history. |
Output
The output JSON contains the response from the MegaAPI WhatsApp service after attempting to forward the message. This typically includes confirmation of the forwarded message or error details if the operation failed.
If the node supports binary data output (not explicitly shown here), it would represent media content related to the forwarded message, but this operation primarily deals with JSON message objects.
Dependencies
- Requires an active MegaAPI WhatsApp service connection configured with an API key credential.
- The node uses the MegaAPI endpoint specified in the credentials (
hostandtoken) to perform the forwarding. - Proper permissions and valid message keys are necessary to identify and forward messages successfully.
Troubleshooting
- Invalid Contact Format: Ensure the "To (Contact)" property follows the exact format
phone_number@s.whatsapp.net. Missing or incorrect formatting will cause errors. - Incorrect Message Key or Message Object: The forwarding operation depends on accurate message key and message JSON objects. Using incomplete or malformed JSON will result in failure.
- Message Not Found: If the message key does not correspond to an existing message in the WhatsApp instance, forwarding will fail.
- Authentication Errors: Verify that the API token and host URL in credentials are correct and have not expired.
- Network Issues: Connectivity problems with the MegaAPI service will prevent forwarding; check network access and service status.
- Error Messages: The node throws errors like "Unknown message operation" if the operation name is incorrect or unsupported. For message forwarding-specific errors, review the error message returned in the output JSON for clues.
Links and References
- MegaAPI WhatsApp Service Documentation (general reference for API capabilities)
- WhatsApp message key structure and usage (refer to WhatsApp Business API docs for message keys)
- n8n documentation on creating custom nodes and handling JSON inputs
This summary is based solely on static analysis of the provided source code and property definitions.