Green API icon

Green API

Send WhatsApp messages via Green API or trigger workflows on webhooks

Overview

This node enables sending WhatsApp messages and related actions via the Green API service. It supports sending text messages, files (by URL or upload), polls, locations, contacts, and forwarding messages to specified chats. The node is useful for automating WhatsApp communications in workflows, such as customer support messaging, notifications, surveys, or sharing media.

In the "Send" operation of the "Message" resource, you can send a text message to a specific chat ID, optionally quoting a previous message. This is beneficial when you want to programmatically send WhatsApp messages from your automation workflows.

Practical examples:

  • Sending order confirmation messages to customers.
  • Forwarding received messages to another chat.
  • Sending location details or contact cards automatically.
  • Conducting polls within WhatsApp groups.

Properties

Name Meaning
Mode Selects the node mode: "Action" to execute WhatsApp actions or "Listen for Incoming Webhook" to trigger workflows on incoming webhooks.
Webhook Filters (Only in trigger mode) Filters to control which incoming webhook events trigger the workflow, including filters by chat ID, chat type (all/group/private), filter logic (AND/OR), instance ID, message content, message types, sender, and webhook types.
Chat ID The target chat identifier where the message will be sent. For private chats use phone number with @c.us suffix, for group chats use group ID with @g.us suffix.
Message The text content of the message to send.
Quoted Message ID Optional ID of a message to quote in the sent message (to reply referencing that message).

Output

The node outputs an array of JSON objects representing the response from the Green API for each executed action. Each output item corresponds to the result of sending a message or performing the requested operation. The exact structure depends on the Green API response but generally includes message IDs, status, and other metadata confirming the action's success.

No binary data output is produced by this operation.

Dependencies

  • Requires an active Green API account with valid credentials: an instance ID and an API token.
  • The node uses these credentials to authenticate requests to the Green API endpoints.
  • Network access to https://api.green-api.com is required.
  • No additional environment variables are needed beyond the configured credentials.

Troubleshooting

  • Error: "This node is configured as a trigger. Please use it as a trigger node, not an action node."
    Occurs if the node is set to "trigger" mode but used as an action. Fix by using the node only as a trigger or switching mode to "action".

  • Failed to send message / file / poll / location / contact errors:
    These errors include the failure reason and the data sent. Common causes: invalid chat ID format, missing required parameters, network issues, or invalid credentials. Verify all inputs and credentials.

  • Failed to read file errors:
    When sending files by upload, ensure the file path is correct and accessible by n8n.

  • Invalid chat ID or message ID:
    Ensure chat IDs follow the correct format (phone@c.us for private, chatId@g.us for groups) and message IDs are valid.

  • API authentication errors:
    Check that the provided instance ID and API token are correct and have necessary permissions.

Links and References

Discussion