Evolution API

Interagir com a Evolution API v2

Overview

This node integrates with the Evolution API v2 to manage and interact with WhatsApp instances and related messaging features. Specifically, the "Instância" resource with the "Definir Presença" operation allows users to set the presence status of a specified WhatsApp instance.

Common scenarios for this node include:

  • Managing multiple WhatsApp instances programmatically.
  • Updating the presence status (e.g., online, offline, busy) of a WhatsApp instance to reflect availability.
  • Automating presence updates as part of customer support workflows or chatbot interactions.

Practical example:

  • A customer support system can automatically set the WhatsApp instance presence to "online" during business hours and "away" after hours, improving user experience by signaling agent availability.

Properties

Name Meaning
Instance Name The name identifier of the WhatsApp instance whose presence you want to set. This is required.
Presence The presence status to assign to the instance. (Note: Although not explicitly listed in the provided properties JSON, it is used in the code as a parameter.)

Output

The node outputs a JSON object containing the response from the Evolution API regarding the presence update. The output includes:

  • All fields returned by the API call confirming the presence change.
  • A success boolean indicating if the operation was successful.
  • A timestamp field with the time when the operation was completed.

Example output structure:

{
  "success": true,
  "timestamp": "2024-06-01T12:00:00.000Z",
  // ...additional API response fields
}

No binary data output is involved in this operation.

Dependencies

  • Requires an API key credential for authenticating requests to the Evolution API v2.
  • The node uses HTTP requests to the Evolution API endpoints.
  • Proper configuration of the API authentication within n8n is necessary.

Troubleshooting

  • Common issues:

    • Incorrect or missing instance name will cause the API request to fail.
    • Invalid or expired API credentials will result in authentication errors.
    • Network connectivity issues may prevent communication with the Evolution API.
  • Error messages:

    • Authentication errors typically indicate invalid API keys; verify and update credentials.
    • "Instance not found" errors suggest the specified instance name does not exist; confirm the instance name spelling and existence.
    • JSON parsing errors might occur if the API returns unexpected responses; ensure the API version matches the node's expectations.
  • Resolution tips:

    • Double-check all input parameters, especially the instance name and presence value.
    • Ensure the API key credential is valid and has appropriate permissions.
    • Test the API endpoint independently to verify service availability.

Links and References

Discussion