Evolution API icon

Evolution API

Interact with Evolution API

Overview

The "Definir Presença" operation for the "Instancia" (Instance) resource in this custom n8n node allows you to set the presence status of a specific instance via the Evolution API. This is useful in scenarios where you need to programmatically update the availability status of an instance, such as marking it as available or unavailable for automated workflows, monitoring, or integration with other systems.

Practical examples:

  • Automatically setting an instance as "Indisponível" (Unavailable) during maintenance windows.
  • Marking an instance as "Disponível" (Available) after successful health checks.
  • Integrating with scheduling tools to reflect real-time presence status.

Properties

Display Name Type Description
Nome Da Instância String Digite o nome da instância (Enter the name of the instance). Required.
Presença Options Status de presença da instância (Presence status of the instance). Options:
• Disponível (available)
• Indisponível (unavailable). Required.

Output

The output will be a JSON object (or array of objects) reflecting the result of the presence-setting operation. The exact structure depends on the Evolution API's response, but typically includes fields indicating the success or failure of the request and possibly the updated status of the instance.

Example output (structure may vary):

[
  {
    "success": true,
    "instanceName": "example-instance",
    "presence": "available",
    "message": "Presença atualizada com sucesso."
  }
]

If the API returns binary data, it will be summarized as relevant to the presence status update.

Dependencies

  • External Service: Requires access to the Evolution API.
  • API Key/Credentials: You must configure valid credentials for the "evolutionApi" in your n8n instance.
  • n8n Configuration: Ensure the node is properly authenticated and that the base URL (https://doc.evolution-api.com/api-reference) is accessible from your environment.

Troubleshooting

Common Issues:

  • Unsupported Operation: If you select an unsupported resource or operation, you may encounter an error message like:

    Operação não suportada.
    A função "set-presence" para o recurso "instances-api" não é suportada!
    

    Resolution: Double-check that you have selected the correct resource ("Instancia") and operation ("Definir Presença").

  • Missing Credentials: If credentials are not configured, the node will fail to authenticate with the Evolution API.
    Resolution: Set up the required "evolutionApi" credentials in n8n.

  • Invalid Input: If required properties are missing or invalid, the API may return an error.
    Resolution: Ensure all required fields ("Nome Da Instância" and "Presença") are filled correctly.

Links and References

Discussion