Evolution API icon

Evolution API

Complete WhatsApp automation with Evolution API

Overview

The "Leave Group" operation in the Evolution API node allows a WhatsApp user (via the connected instance) to leave a specified WhatsApp group. This is useful for automating group management tasks, such as removing the bot or user from groups that are no longer relevant or needed.

Practical examples include:

  • Automatically leaving groups after a certain event or time period.
  • Managing group memberships programmatically without manual intervention.
  • Cleaning up group memberships when users unsubscribe or opt out.

Properties

Name Meaning
Group ID The unique identifier of the WhatsApp group to leave.
Additional Fields Optional extra parameters:
- Delay: Time in milliseconds before sending the request.
- Link Preview: Enable or disable link previews in messages.
- Quoted Message ID: ID of a message to quote or reply to.
- Mentions: Comma-separated list of phone numbers to mention in messages.

Output

The node outputs a JSON object containing the response from the Evolution API after attempting to leave the group. The exact structure depends on the API response but typically includes confirmation of the action or error details if the operation failed.

No binary data output is involved in this operation.

Example output JSON might look like:

{
  "success": true,
  "message": "Left the group successfully",
  "groupJid": "12345-67890@g.us"
}

or in case of failure:

{
  "error": "Group not found or insufficient permissions"
}

Dependencies

  • Requires an active connection to the Evolution API service with valid credentials including:

    • Base URL of the API.
    • API key for authentication.
    • Instance name identifying the WhatsApp instance.
  • Optionally uses a secondary API validation service to verify subscription and API key validity before making requests.

  • The node expects proper configuration of these credentials within n8n.

Troubleshooting

  • Common Issues:

    • Invalid or expired API keys leading to authentication failures.
    • Incorrect or malformed Group ID causing the API to reject the request.
    • Insufficient permissions for the instance to leave the group (e.g., not a member).
    • Network connectivity issues preventing communication with the Evolution API.
  • Error Messages:

    • "N8N Tools API: Invalid subscription or API key. Please check your credentials."
      Resolution: Verify and update the API key credentials in n8n settings.

    • "Unknown group operation: leaveGroup"
      Resolution: Ensure the operation parameter is correctly set to "leaveGroup".

    • API errors indicating group not found or permission denied.
      Resolution: Confirm the Group ID is correct and the instance has rights to leave the group.

  • Use the "Continue On Fail" option in the node to handle errors gracefully during workflow execution.

Links and References

Discussion