Green API icon

Green API

Send WhatsApp messages via Green API or trigger workflows on webhooks

Overview

This node enables sending WhatsApp poll messages via the Green API service. It is designed to send interactive polls to specified WhatsApp chats, allowing recipients to vote on multiple-choice questions. This functionality is useful for gathering opinions, conducting surveys, or making group decisions directly within WhatsApp conversations.

Typical use cases include:

  • Sending quick polls to customer groups for feedback.
  • Conducting informal surveys among team members.
  • Engaging audiences with interactive content in marketing campaigns.

For example, a user can send a poll asking "Which day works best for the meeting?" with options like "Monday, Wednesday, Friday" and optionally allow multiple answers.

Properties

Name Meaning
Chat ID The identifier of the chat where the poll will be sent. Use phone@c.us for private chats or chatId@g.us for groups.
Message The text message that introduces or describes the poll.
Poll Options Comma-separated list of poll options (between 2 and 12). Each option represents a choice users can select.
Multiple Answers Boolean flag indicating whether the poll allows respondents to select more than one option.
Quoted Message ID (Optional) ID of a message to quote when sending the poll, providing context or reference.

Output

The node outputs the JSON response returned by the Green API after attempting to send the poll. This typically includes details about the sent message such as message ID, status, and any error information if the request failed.

The output structure is an array of JSON objects, each corresponding to one execution item. The exact fields depend on the Green API's response format.

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 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 credentials will cause authentication failures.
    • Incorrect chat IDs or improperly formatted poll options may result in API errors.
    • Exceeding the allowed number of poll options (less than 2 or more than 12) will likely cause rejection.
    • Network connectivity problems can prevent successful API calls.
  • Error messages:

    • Errors from the API are caught and rethrown with detailed messages including the data sent, e.g., Failed to send poll: <error message>.
    • File reading errors (not applicable here but relevant for other operations) indicate issues accessing local files.
    • If the node is configured as a trigger but used as an action, it throws an explicit error instructing correct usage.
  • Resolution tips:

    • Verify credentials and ensure they are correctly set up in n8n.
    • Double-check chat IDs and poll options formatting.
    • Ensure the poll has between 2 and 12 options.
    • Confirm network connectivity to the Green API endpoint.
    • Use the quoted message ID only if referencing an existing message.

Links and References

Discussion