Evolution API

Interagir com a Evolution API v2

Overview

This node integrates with the Evolution API v2, enabling automation and management of various WhatsApp-related resources such as instances, messages, groups, chats, events, and integrations. Specifically, for the Evento resource with the Webhook operation, it allows users to configure webhooks on a specified instance. This setup enables real-time event notifications from the Evolution platform to a user-defined URL, facilitating event-driven workflows.

Practical scenarios include:

  • Automatically triggering workflows when specific WhatsApp events occur (e.g., incoming messages, status updates).
  • Integrating WhatsApp event data into other systems via webhook callbacks.
  • Monitoring and logging WhatsApp instance activities in real time.

Properties

Name Meaning
Instance Name The name of the WhatsApp instance where the webhook will be configured (required).

Additional properties used internally for this operation (not listed here) include:

  • webhookUrl: The URL to which the webhook events will be sent.
  • events: The list or set of events to subscribe to via the webhook.

(Note: These additional properties are referenced in the code but not provided in the user input.)

Output

The node outputs a JSON object containing the response from the Evolution API after attempting to set the webhook. The output includes:

  • success (boolean): Indicates if the operation was successful.
  • message (string, optional): A success message if no detailed response is returned.
  • timestamp (string): ISO timestamp of when the operation was performed.
  • Additional fields depending on the API response, parsed from JSON if possible.

If the API returns an array or stringified JSON, the node attempts to parse it accordingly and returns structured JSON items.

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to the Evolution API v2.
  • Needs an API authentication token or API key credential configured in n8n to authorize requests.
  • The node uses the requestWithAuthentication helper method to make authenticated HTTP requests to the Evolution API endpoints.
  • The user must provide a valid instance name and webhook configuration parameters.

Troubleshooting

  • Common Issues:

    • Invalid or missing instance name: Ensure the "Instance Name" property is correctly set and corresponds to an existing instance.
    • Incorrect webhook URL or unreachable endpoint: Verify that the webhook URL is accessible and properly formatted.
    • Insufficient permissions or invalid API credentials: Confirm that the API key or token has the necessary rights to configure webhooks.
    • Network connectivity problems between n8n and the Evolution API.
  • Error Messages:

    • Errors thrown by the API will be caught and returned as error messages in the output if "Continue On Fail" is enabled.
    • If the API response cannot be parsed as JSON, the raw response is included in the output.
    • Common HTTP errors (e.g., 401 Unauthorized, 404 Not Found) indicate authentication issues or incorrect resource identifiers.

To resolve errors:

  • Double-check all input parameters.
  • Validate API credentials.
  • Test webhook URLs independently.
  • Review API documentation for required event formats.

Links and References


Note: The above summary is based solely on static analysis of the provided source code and input properties.

Discussion