Green API icon

Green API

Send WhatsApp messages via Green API or trigger workflows on webhooks

Overview

This node integrates with the Green API service to manage WhatsApp groups and participants programmatically. Specifically, the "Add Group Participant" operation allows you to add a new participant to an existing WhatsApp group by specifying the group's ID and the participant's chat ID.

Common scenarios where this node is beneficial include automating group management tasks such as onboarding new members to WhatsApp groups used for customer support, community engagement, or team collaboration. For example, when a new user signs up on your platform, you can automatically add them to a relevant WhatsApp group without manual intervention.

Properties

Name Meaning
Mode Selects the node mode:
- Action: Execute WhatsApp actions via Green API
- Listen for Incoming Webhook: Trigger workflows on incoming webhooks from Green API
Group ID The unique identifier of the WhatsApp group where the participant will be added. Example format: 972501234567-1587570015@g.us
Participant Chat ID The chat ID of the participant to add to the group. Format for private chats: phone@c.us. Example: 972501234567@c.us

Output

The node outputs a JSON array containing the response from the Green API after attempting to add the participant. This response typically includes confirmation details or error information related to the operation.

Example output structure (simplified):

[
  {
    "json": {
      "idMessage": "string",
      "status": "success"
    }
  }
]

No binary data output is involved in this operation.

Dependencies

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

Troubleshooting

  • Common Issues:

    • Invalid or missing Group ID or Participant Chat ID parameters.
    • Incorrectly formatted chat IDs (must follow WhatsApp conventions).
    • Insufficient permissions or invalid credentials for the Green API.
    • Network connectivity issues preventing API calls.
  • Error Messages:

    • "Failed to add group participant: <error message>": Indicates the API call failed. Check the provided Group ID and Participant Chat ID for correctness and ensure credentials are valid.
    • "Error processing group operation addGroupParticipant: <error message>": General error during execution; verify all input parameters and credentials.
  • Resolution Tips:

    • Double-check that the Group ID corresponds to an existing WhatsApp group.
    • Ensure the participant's chat ID is correct and the user is reachable.
    • Verify that the API credentials are correctly set up and have the required permissions.
    • Review network settings and firewall rules to allow outbound HTTPS requests to the Green API.

Links and References

Discussion