Actions21
- Message Actions
- Group Actions
- Chat Actions
- Contact Actions
Overview
The "Leave Group" operation in the Green API node allows users to programmatically leave a WhatsApp group using the Green API service. This is useful for automating group management tasks, such as removing a bot or user from a group when certain conditions are met or as part of workflow automation.
Typical scenarios include:
- Automatically leaving groups after completing a campaign or event.
- Managing group memberships dynamically based on external triggers.
- Cleaning up group participation for bots or automated accounts.
Example: A workflow could detect that a project phase is complete and then use this node operation to have the bot leave the related WhatsApp group automatically.
Properties
| Name | Meaning |
|---|---|
| Mode | Select between "Action" (execute WhatsApp actions) or "Listen for Incoming Webhook". |
| Group ID | The unique identifier of the WhatsApp group to leave, e.g., 972501234567-1587570015@g.us. |
Note: The "Mode" property must be set to "Action" to perform the leave group operation.
Output
The node outputs a JSON array containing the response from the Green API after attempting to leave the specified group. The structure typically includes confirmation of the action or error details if the operation failed.
No binary data output is involved in 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.comis required. - No additional environment variables beyond the configured credentials are necessary.
Troubleshooting
Common issues:
- Invalid or missing Group ID will cause the operation to fail.
- Incorrect or expired API credentials will result in authentication errors.
- Network connectivity problems can prevent successful API calls.
Error messages:
"Failed to leave group: <error message>"indicates the API call was unsuccessful. Check the Group ID and credentials.- Errors reading files or malformed input do not apply here since no file input is needed for this operation.
Resolution tips:
- Verify the Group ID format matches WhatsApp's expected pattern.
- Ensure the API credentials are correctly configured and active.
- Confirm network connectivity to the Green API endpoint.
- Use the node only in "Action" mode, not as a trigger.
Links and References
- Green API Documentation – Official API docs for WhatsApp integration.
- WhatsApp Group IDs Format – Explanation of WhatsApp group identifiers.