Green API icon

Green API

Send WhatsApp messages via Green API or trigger workflows on webhooks

Overview

The "Forward Messages" operation of the Green API node allows users to forward one or more WhatsApp messages from one chat to another using the Green API service. This is useful in scenarios where you want to programmatically share existing messages with different recipients or groups without manually copying and pasting content.

Practical examples include:

  • Automatically forwarding customer support messages from a private chat to a group of agents.
  • Sharing important announcements received in one group to multiple other groups.
  • Archiving messages by forwarding them to a dedicated chat for record-keeping.

This operation requires specifying the source chat ID, the destination chat ID, and the message IDs to be forwarded.

Properties

Name Meaning
Chat ID The destination chat ID where messages will be forwarded. For private chats use phone@c.us, for groups use chatId@g.us.
Chat ID From The source chat ID from which the messages are being forwarded. Format same as above.
Message IDs Comma-separated list of message IDs to forward. These identify the specific messages in the source chat.

Output

The output is a JSON array containing the response(s) from the Green API after attempting to forward the specified messages. Each item corresponds to one execution input and includes details about the success or failure of the forwarding request.

The exact structure depends on the Green API's response but typically includes status information and any relevant metadata about the forwarded messages.

No binary data is output by this operation.

Dependencies

  • Requires an active Green API account with valid credentials: an instance ID and an API token.
  • The node makes HTTP POST requests to the Green API endpoints.
  • Proper configuration of these credentials in n8n is necessary for authentication.
  • Network access to https://api.green-api.com must be available.

Troubleshooting

  • Common Issues:

    • Invalid or missing chat IDs or message IDs can cause failures.
    • Incorrectly formatted message IDs (not comma-separated or invalid IDs) will result in errors.
    • Authentication failures due to incorrect or expired API credentials.
    • Network connectivity issues preventing access to the Green API.
  • Error Messages:

    • "Failed to forward messages: <error message>" indicates the API call failed. Check the error message for details.
    • Errors may also include the data sent; verify that the chatId, chatIdFrom, and messages parameters are correct.
    • If the node is configured as a trigger instead of an action, it will throw an error instructing to use it properly.
  • Resolution Tips:

    • Double-check all input parameters for correctness.
    • Ensure API credentials are valid and have required permissions.
    • Confirm network connectivity to the Green API endpoint.
    • Review the Green API documentation for message forwarding constraints.

Links and References

Discussion