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 interact with WhatsApp instances, enabling users to send messages, send media, or retrieve a QR code for authentication. Specifically, the "Get QR Code" operation fetches the QR code image data associated with a specified WhatsApp instance. This is useful in scenarios where you need to authenticate or link a WhatsApp instance by scanning the QR code.

Practical examples:

  • Automating WhatsApp messaging workflows that require initial authentication via QR code.
  • Retrieving the QR code dynamically to display it in a user interface for manual scanning.
  • Managing multiple WhatsApp instances programmatically by fetching their respective QR codes.

Properties

Name Meaning
Instance The name of the WhatsApp instance to target for retrieving the QR code

Output

The output JSON contains the following fields:

  • success: A boolean indicating whether the QR code retrieval was successful.
  • result: The data returned from the API call, which includes the QR code information (likely as an image URL or base64 string).
  • message: A descriptive message confirming the QR code was retrieved successfully.

If the node supports binary data output, it would typically represent the QR code image; however, in this implementation, the QR code data is returned within the JSON result field.

Example output structure:

{
  "success": true,
  "result": {
    // QR code data, e.g., image URL or base64 encoded string
  },
  "message": "QR code retrieved successfully"
}

Dependencies

  • Requires an active Evolution API account with valid credentials including:
    • API base URL
    • API key for authentication
  • The node uses HTTP requests to communicate with the Evolution API endpoints.
  • Proper configuration of these credentials in n8n is necessary before using the node.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrect instance names may result in errors or empty QR code data.
    • Network connectivity problems can prevent successful API calls.
  • Error messages:

    • "The operation \"getQrCode\" is not supported!" — indicates an unsupported operation was requested; ensure the operation parameter is set correctly.
    • API error responses will be propagated and can include messages about invalid API keys, unauthorized access, or instance not found.
  • Resolutions:

    • Verify that the API key and URL are correctly configured in the node credentials.
    • Double-check the instance name spelling and existence.
    • Ensure network access to the Evolution API endpoint is available.

Links and References

  • Evolution API official documentation (for WhatsApp messaging and QR code management)
  • n8n documentation on creating and configuring API credential nodes
  • Axios HTTP client documentation (used internally for API requests)

Discussion