Evolution API

Interagir com a Evolution API v2

Overview

This node integrates with the Evolution API v2 to perform various operations related to WhatsApp instances, messages, groups, chats, events, and integrations. Specifically for the Chat resource and the Obter Mídia em Base64 (Get Media in Base64) operation, it allows users to retrieve media content from a chat encoded in Base64 format.

This functionality is useful when you want to fetch media files (such as images, videos, or audio) directly from WhatsApp chats and process or store them within your workflows without needing to download files separately. For example, you could use this node to automatically extract and save media attachments from customer support chats or marketing campaigns.

Properties

Name Meaning
Instance Name The name of the WhatsApp instance to operate on. This identifies which instance the API calls will target.

Note: The provided input properties JSON only includes "Instance Name" which is required for all resources including Chat.

Output

The node outputs a JSON array where each item corresponds to the result of an API call for each input item processed. The output structure generally includes:

  • The data returned by the Evolution API for the requested operation.
  • A success boolean indicating if the operation was successful.
  • A timestamp marking when the operation completed.

For the Obter Mídia em Base64 operation specifically, the output JSON will contain the media content encoded as a Base64 string, allowing easy embedding or further processing within n8n workflows.

If the API returns multiple items, they are parsed into an array of objects. If the response is a string, the node attempts to parse it as JSON; otherwise, it wraps it in an object under the value key.

The node does not explicitly handle binary data output but provides media content as Base64-encoded strings within the JSON output.

Dependencies

  • Requires an API key credential for authenticating requests to the Evolution API v2.
  • The node uses HTTP requests to communicate with the Evolution API endpoints.
  • Proper configuration of the Evolution API credentials in n8n is necessary.
  • The user must specify the correct instance name corresponding to their WhatsApp instance.

Troubleshooting

  • Common issues:

    • Incorrect or missing instance name can cause API errors or no data returned.
    • Invalid or expired API authentication token will lead to authentication failures.
    • Network connectivity problems may prevent successful API calls.
    • Malformed JSON input for instance data or other parameters can cause parsing errors.
  • Error messages:

    • Authentication errors typically indicate invalid credentials; verify and update the API key.
    • "Operation failed" or similar messages may indicate incorrect parameters or unavailable resources.
    • JSON parsing errors suggest malformed responses or inputs; ensure inputs conform to expected formats.
  • Resolutions:

    • Double-check instance names and parameter values.
    • Ensure the API key credential is correctly set up and has necessary permissions.
    • Validate JSON inputs before running the node.
    • Use the node's "Continue On Fail" option to handle errors gracefully during batch processing.

Links and References

Discussion