Evolution API

Interagir com a Evolution API v2

Overview

This node interacts with the Evolution API v2 to manage and control instances, messages, groups, chats, events, and integrations related to a messaging platform. Specifically, for the "Desconectar Instância" (Disconnect Instance) operation under the Instância resource, the node allows users to disconnect a specified instance by its name.

Typical use cases include:

  • Managing active connections of messaging instances.
  • Programmatically disconnecting an instance when it is no longer needed or before deleting it.
  • Automating workflows that require controlled disconnection of instances to maintain system integrity or free resources.

For example, if you have an instance named "SalesBot" connected to your messaging platform, you can use this node operation to disconnect "SalesBot" safely as part of a shutdown or maintenance workflow.

Properties

Name Meaning
Instance Name The name of the instance to disconnect. This is a required string input identifying which instance to log out.

Output

The output JSON contains the response from the Evolution API after attempting to disconnect the instance. It typically includes:

  • success: A boolean indicating whether the operation was successful.
  • message: A descriptive message about the operation result.
  • timestamp: The ISO timestamp when the operation was completed.

If the API returns additional data, it will be included in the output. In case of errors, an error object with the error message may be returned if the node is configured to continue on failure.

No binary data is output by this operation.

Example output JSON:

{
  "success": true,
  "message": "Operation completed successfully",
  "timestamp": "2024-06-01T12:00:00.000Z"
}

Dependencies

  • Requires an API key credential for authenticating requests to the Evolution API.
  • The node uses HTTP methods (DELETE) to communicate with the endpoint /instance/logout/{instanceName}.
  • Proper configuration of the Evolution API credentials in n8n is necessary.
  • Network access to the Evolution API endpoints must be available.

Troubleshooting

  • Common issues:

    • Incorrect or misspelled instance name will cause the API to fail to find the instance.
    • Invalid or expired API authentication token will result in authorization errors.
    • Network connectivity problems can prevent the request from reaching the API.
  • Error messages:

    • "Instance not found": Verify the instance name is correct and exists.
    • "Unauthorized" or "Authentication failed": Check the API key credential and refresh if necessary.
    • Timeout or network errors: Ensure the server running n8n has internet access and the API endpoint is reachable.
  • To resolve errors, verify all inputs, credentials, and network settings. Enable "Continue On Fail" in the node settings to handle errors gracefully within workflows.

Links and References

Discussion