Green API icon

Green API

Send WhatsApp messages via Green API or trigger workflows on webhooks

Overview

This node enables forwarding WhatsApp messages from one chat to another using the Green API service. It is part of a broader integration that allows sending, editing, deleting, and managing WhatsApp messages, groups, chats, and contacts via Green API.

The Forward Messages operation specifically takes message IDs from a source chat and forwards those messages to a target chat. This is useful in scenarios such as:

  • Automatically sharing important messages received in one chat to another chat or group.
  • Archiving or backing up messages by forwarding them to a dedicated chat.
  • Creating workflows that redistribute messages based on content or sender.

For example, you could forward customer support inquiries received in a private chat to a group chat for team collaboration.

Properties

Name Meaning
Mode Operation mode: "Action" to execute WhatsApp actions or "Listen for Incoming Webhook" to trigger workflows on incoming webhooks. For forwarding messages, use "Action".
Chat ID The destination chat ID where messages will be forwarded. Format: phone@c.us for private chats or chatId@g.us for groups.
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 from the source chat.

Output

The node outputs an array of JSON objects representing the response from the Green API after attempting to forward the messages. Each item corresponds to one execution input and contains details about the success or failure of the forwarding request.

The output JSON structure typically includes status information and any relevant metadata returned by the Green API endpoint for forwarding messages.

No binary data output is produced by this operation.

Dependencies

  • Requires valid credentials for the Green API service, including an instance ID and an API token.
  • The node makes HTTP POST requests to Green API endpoints.
  • No additional external dependencies beyond standard Node.js modules and n8n helpers.

Troubleshooting

  • Common Issues:

    • Invalid or missing chat IDs (source or destination) can cause failures.
    • Incorrect or expired API credentials will prevent successful requests.
    • Providing invalid or non-existent message IDs will result in errors.
    • Network connectivity issues may cause request timeouts or failures.
  • Error Messages:

    • Errors like Failed to forward messages: <error message> indicate problems with the API call.
    • The node error includes the data sent, helping identify incorrect parameters.
  • Resolutions:

    • Verify chat IDs are correctly formatted and exist.
    • Ensure API credentials are current and have necessary permissions.
    • Confirm message IDs are accurate and belong to the specified source chat.
    • Check network connectivity and retry if transient errors occur.

Links and References

Discussion