Evolution API

Interagir com a Evolution API v2

Overview

This node integrates with the Evolution API v2 to manage and interact with various resources such as instances, messages, groups, chats, events, and integrations. Specifically, for the "Instância" (Instance) resource and the "Reiniciar Instância" (Restart Instance) operation, the node allows users to restart a specified instance by its name.

This functionality is useful in scenarios where an instance needs to be rebooted remotely to resolve issues, refresh connections, or apply updates without manual intervention. For example, if an instance managing WhatsApp messaging becomes unresponsive or encounters errors, restarting it via this node can restore normal operation.

Properties

Name Meaning
Instance Name The name of the instance to restart. This is a required string input identifying which instance will be restarted.

Output

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

  • success: A boolean indicating whether the operation was successful.
  • message: A textual message describing the result (e.g., confirmation of restart).
  • timestamp: The ISO timestamp when the operation was completed.

If the API returns additional data, it will be included in the output JSON as well.

Example output structure:

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

Dependencies

  • Requires an API key credential configured in n8n to authenticate requests to the Evolution API.
  • The node uses HTTP methods (PUT) to communicate with the endpoint /instance/restart/{instanceName} on the Evolution API server.
  • Proper network access to the Evolution API service 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 sufficient permissions.
    • Network connectivity problems: Confirm that the n8n environment can reach the Evolution API endpoint.
  • Error Messages:

    • If the instance does not exist or cannot be found, the API may return a 404 error. Check the instance name spelling.
    • Unauthorized errors indicate issues with the API key; reconfigure credentials.
    • Timeout or connection errors suggest network issues or API downtime.

Resolving these usually involves verifying inputs, credentials, and network settings.

Links and References

Discussion