Evolution API

Interagir com a Evolution API v2

Overview

This node interacts with the Evolution API v2 to manage and operate on various resources related to messaging instances, messages, groups, chats, events, and integrations. Specifically, for the "Instância" resource and the "Estado da Conexão" operation, it checks the connection status of a specified instance.

Common scenarios where this node is beneficial include:

  • Monitoring the connectivity state of messaging instances to ensure they are online and ready to send or receive messages.
  • Automating workflows that depend on the availability of an instance before proceeding with message sending or other operations.
  • Integrating with systems that require real-time status updates of communication instances.

Practical example:

  • Before sending a broadcast message, use this node to verify if the instance is connected. If the connection state is active, proceed; otherwise, trigger an alert or retry logic.

Properties

Name Meaning
Instance Name The name identifier of the instance whose connection state you want to check. This is required to specify which instance's connection status will be retrieved.

Output

The output JSON contains the response from the Evolution API regarding the connection state of the specified instance. It typically includes:

  • Connection details such as whether the instance is connected or disconnected.
  • Additional metadata about the instance's current status.
  • A success boolean indicating if the operation was successful.
  • A timestamp marking when the response was generated.

Example output structure (simplified):

{
  "connectionState": "connected",
  "success": true,
  "timestamp": "2024-06-01T12:00:00.000Z"
}

If the API returns no data, the node outputs a default success message with a timestamp.

Dependencies

  • Requires an API key credential configured in n8n to authenticate requests to the Evolution API.
  • The node uses HTTP methods (GET) to communicate with the Evolution API endpoints.
  • Proper network access to the Evolution API service endpoint is necessary.

Troubleshooting

  • Common issues:

    • Incorrect or missing instance name: Ensure the "Instance Name" property is correctly set and matches an existing instance.
    • Authentication failures: Verify that the API key credential is valid and has the necessary permissions.
    • Network connectivity problems: Confirm that the n8n server can reach the Evolution API endpoint.
  • Error messages:

    • Authentication errors usually indicate invalid or expired credentials; reconfigure the API key.
    • "Instance not found" or similar errors suggest the provided instance name does not exist; double-check the spelling and case.
    • Timeout or network errors imply connectivity issues; check firewall rules and internet access.

Links and References


This summary focuses exclusively on the "Instância" resource and the "Estado da Conexão" operation as requested.

Discussion