Evolution API AI Tool icon

Evolution API AI Tool

Use Evolution API to send WhatsApp messages in AI agents

Overview

This node integrates with the Evolution API to send WhatsApp messages and retrieve QR codes for WhatsApp instances. It supports three main operations:

  • Sending text messages to a specified phone number.
  • Sending media messages (images, videos, etc.) with optional captions.
  • Retrieving the QR code for a WhatsApp instance, typically used for authentication or linking devices.

Common scenarios include automating customer notifications, sending multimedia content via WhatsApp, or managing WhatsApp sessions programmatically. For example, a business could use this node to automatically send order confirmations or promotional images to customers through WhatsApp.

Properties

Name Meaning
Instance The name of the WhatsApp instance to target for sending messages or retrieving QR codes.

Note: Although only "Instance" is listed in the provided properties, the node internally uses additional parameters depending on the operation, such as phone number, message text, media URL, caption, and media type.

Output

The node outputs an array of JSON objects, each representing the result of an operation performed on an input item. Each object contains:

  • success: A boolean indicating if the operation was successful.
  • result: The raw response data returned from the Evolution API.
  • message: A human-readable string summarizing the outcome, e.g., "Message sent successfully to [phone number]" or "QR code retrieved successfully".
  • error (only present if the operation failed): The error message describing what went wrong.

If the operation involves media, the output includes details about the media message sent. For QR code retrieval, the output contains the QR code data from the API.

The node does not output binary data directly; all responses are JSON-formatted.

Dependencies

  • Requires an active Evolution API account with valid credentials including:
    • Base URL of the Evolution API endpoint.
    • An API key for authentication.
  • The node depends on the Axios HTTP client library to make REST API calls.
  • Proper configuration of the API credentials within n8n is necessary before using the node.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrect instance names or phone numbers may lead to errors or unsuccessful message delivery.
    • Unsupported operations will throw an error indicating the operation is not supported.
    • Network connectivity problems can cause request timeouts or failures.
  • Error messages:

    • "The operation \"[operation]\" is not supported!": Indicates that the selected operation is invalid or not implemented. Verify the operation parameter.
    • API errors returned from the Evolution API will be included in the error field when continueOnFail is enabled.
  • Resolutions:

    • Ensure API credentials are correctly set up and have sufficient permissions.
    • Double-check instance names and phone numbers for correctness.
    • Use the "getQrCode" operation first to verify the instance is active and linked.
    • Enable "Continue On Fail" in the node settings to handle partial failures gracefully.

Links and References

  • Evolution API official documentation (for detailed API endpoints and usage).
  • WhatsApp Business API guidelines (for understanding messaging constraints).
  • Axios HTTP client: https://axios-http.com/ (used internally for API requests).

Discussion