Green API icon

Green API

Send WhatsApp messages via Green API

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 into WhatsApp groups for customer support, community engagement, or team collaboration without manual intervention.

Practical example:
You have a WhatsApp group for your product beta testers. When a new user signs up on your platform, you can automatically add their WhatsApp contact to the beta testers group using this node, streamlining communication.

Properties

Name Meaning
Group ID The unique identifier of the WhatsApp group where the participant will be added.
Participant Chat ID The chat ID of the participant (phone number in international format) to add to the group.
  • Group ID example format: 972501234567-1587570015@g.us
  • Participant Chat ID example format: 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 status information about the operation, such as success confirmation or error details.

If the operation succeeds, the output confirms the participant was added. If it fails, the output contains error messages explaining the failure.

No binary data is output by this operation.

Dependencies

  • Requires an active Green API account with valid credentials (instance ID and 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 API credentials.

Troubleshooting

Common Issues

  • Invalid Group ID or Participant Chat ID:
    Ensure that the group ID and participant chat ID are correctly formatted and correspond to existing WhatsApp entities.

  • Authentication Errors:
    Verify that the API credentials (instance ID and token) are correct and have not expired.

  • API Rate Limits or Quotas:
    The Green API may enforce rate limits; hitting these could cause request failures.

  • Network Connectivity Problems:
    Confirm that the n8n instance has internet access and can reach the Green API servers.

Common Error Messages

  • "Failed to add group participant: <error message>"
    Indicates the API call failed. The error message usually provides details such as invalid parameters or permission issues.

  • "Error processing group operation addGroupParticipant: <error message>"
    A more general error indicating something went wrong during execution. Check input parameters and credentials.

How to Resolve

  • Double-check all input parameters for correctness and completeness.
  • Re-authenticate or update API credentials if necessary.
  • Review Green API documentation for any changes in API usage or limitations.
  • Inspect network settings and firewall rules to ensure connectivity.

Links and References

Discussion