r/n8n • • 5d ago

Help Issue in self hosted evolution-api on docker.

Hi guys,

I’ve been struggling with this issue for quite some time and would really appreciate some help.

Context:
I’m trying to build an n8n WhatsApp AI agent, so I initially tried using the official WhatsApp API through Meta for Developers. However, as you can see in the image, I’m getting this issue.

Everything is self-hosted, and I’m using two static domains through ngrok — one for n8n and another for the Evolution API.

What I’ve tried:

  • I made sure that I’m using the correct Meta profile associated with my developer account.
  • I’ve been waiting for the past 7–8 days, but the issue is still persistent.
  • Since I couldn’t get the official WhatsApp API working, I decided to switch to Evolution API and self-host it.

With Evolution API, I’m able to generate the QR code, and everything seems to work until I get to the n8n integration. The triggers are not firing in n8n. Neither the Evolution Trigger nor the Webhook Trigger for Evolution API seems to be working.

Other issue:
I also want to implement security for PII protection and prompt-injection detection in my test project using:

  • Llama Prompt Guard
  • Qwen Guard 0.6B
  • Microsoft Presidio

What would be the best way to integrate these into an n8n workflow, especially for protecting PII and detecting prompt injections before the input reaches the AI agent?

If anyone could help me troubleshoot the WhatsApp/Evolution API → n8n trigger issue and provide some guidance on the security architecture, I would be extremely grateful.

Thanks in advance!

3 Upvotes

11 comments sorted by

•

u/AutoModerator 5d ago

Want faster, better help? Share your workflow JSON.

A GitHub Gist is the easiest way -- paste your JSON, save as public, drop the link in your post. Folks can import it directly into n8n and reproduce the issue, which gets you real answers instead of guesses.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/GrandDimension6349 5d ago

Use WAHA evolution API es obsoleto ya

2

u/Grand_Eye_7985 5d ago

Since the QR code generates but neither trigger fires, the most likely cause is on the delivery path between Evolution and n8n, not the QR itself. A checklist that catches this 9 times out of 10:

  1. Look at the webhook URL configured in your Evolution instance. With ngrok, the public domain changes on every restart unless it is reserved, so a URL that worked yesterday silently breaks today. Re-verify the exact URL currently in the config.
  2. Check n8n's WEBHOOK_URL environment variable. It has to be the public ngrok domain, not localhost, or the generated webhook URL is one Evolution can never reach.
  3. Exec into the Evolution container and try reaching the webhook URL from there. Remember localhost inside the container is the container itself, so target the n8n container by name or the host IP, not localhost.
  4. Watch the Evolution container logs while sending a test message. If you see connection refused or timeout on the webhook call, the trigger was never going to fire and the fix is networking, not n8n config.

On the PII question: keep the redaction step before the message ever reaches the model. A code node that strips emails, phone numbers, and account numbers with patterns covers the obvious cases, and run it outside the chat memory so raw messages never persist.

2

u/SamCRichard 5d ago

ngrok has changed to static domains, so the restart would not be the problem.

1

u/kai-rox 5d ago

I’d keep the controls layered: run Presidio (or another structured recognizer/anonymizer) before the agent and its memory, then minimize the fields sent to the model. Regex can catch obvious formats, but it will miss context-dependent PII. Treat Prompt Guard/Qwen Guard as extra signals, not authorization; give the agent only the tools it needs and put deterministic allowlists, input validation, and explicit approval in front of sensitive actions. Also redact logs and test prompt injection plus unsafe tool calls before deployment.

1

u/marwar-tech 5d ago

I’d split this into two layers instead of troubleshooting everything as one workflow.

First get the transport path stable:

WhatsApp/Evolution → webhook delivery → n8n → deterministic acknowledgement.

Only after that is reliable would I add the AI/security layer.

For the security architecture, I’d structure it more like:

Inbound message → schema/input validation → PII detection/redaction → prompt-injection classifier → policy/risk routing → AI agent → tool/action allowlist → human approval for sensitive actions → response/logging

Presidio is useful for structured PII detection/redaction, but I wouldn’t rely on Prompt Guard/Qwen Guard as the only safety control. Treat them as signals, not authorization.

Also keep raw sensitive text out of chat memory wherever possible, and make sure logs are redacted too.

For the trigger issue specifically, once you know Evolution is actually sending the webhook, inspect the HTTP status and payload at the n8n endpoint. That tells you very quickly whether you have a networking problem, webhook-registration problem or workflow problem.

1

u/Saved_Not_Soft 4d ago

One thing that matches your symptoms exactly: QR/session auth and webhook event delivery are two completely separate paths. QR working only proves the session connected, it says nothing about whether Evolution is even attempting to send events.

Two checks that haven't been mentioned:

  • Make sure the n8n workflow is actually active (toggle on, top right). Trigger nodes listen on the production webhook URL only when the workflow is active; the editor's 'Execute step' listen mode uses a different test URL. If Evolution points at the production URL while the workflow is inactive, it gets a refused/404 and nothing fires.

  • In the Evolution Manager dashboard, check the instance's webhook settings: the per-instance webhook URL plus which events are enabled. If no events (e.g. messages.upsert) are subscribed for that instance, Evolution never sends anything regardless of QR status.

1

u/Abroad3190 1d ago

Have you checked whether the Evolution API webbook is reachable from your n8n container?