N8n openwa on message receive trigger failure

Hi, I am new to n8n. I am testing to create a workflow to interact Whatsapp messsages through OpenWA gateway. The OpenWA gateway and n8n is setup in self-hosted docker. I create a workflow and add OpenWA Trigger with Message Received event, the credential is setup and connection tested successfully and session name is selected. When I try run and click “Execute step”, it prompts the following error. I can create another workflow to send message using the same credential and session successfully. Looking for expertise to give me guides to fix this issue. Thanks.

Problem running workflow
Bad request - please check your parameters
Show Details
Bad Request

Sending works but the trigger fails because the trigger is the only part that makes OpenWA call back into n8n. When you click “Execute step”, the OpenWA Trigger registers a webhook with your OpenWA server (a POST to /api/sessions/<session>/webhooks) using n8n’s test webhook URL. A “Bad Request” at that point usually means OpenWA refused that URL.

My best guess, assuming you’re on the OpenWA server from rmyndharis/OpenWA with the @rmyndharis/n8n-nodes-openwa node: OpenWA has SSRF protection on by default (WEBHOOK_SSRF_PROTECT=true), and it refuses webhook URLs that resolve to loopback or private addresses, at registration time, with a 400 “Destination address is not allowed”. In a self-hosted Docker setup the n8n webhook URL is almost always http://localhost:5678/... or a Docker-network host like http://n8n:5678/..., which lands in exactly those ranges.

Things to check:

  1. Open the trigger node and look at the Test URL it shows. If it says localhost, set WEBHOOK_URL on the n8n container to an address the OpenWA container can actually reach (for example http://n8n:5678/ if both are on the same compose network), then restart n8n. localhost inside the OpenWA container points at OpenWA itself, not n8n.
  2. On the OpenWA container, allow that host with SSRF_ALLOWED_HOSTS=n8n (use whatever hostname is in your webhook URL). The OpenWA .env.example notes the bundled Docker Compose doesn’t forward WEBHOOK_SSRF_PROTECT, so the allowlist is the intended route for a receiver on the compose network. Restart OpenWA after.
  3. Check the OpenWA logs right after clicking Execute step. If it’s the SSRF guard you’ll see a line like “Webhook URL rejected by SSRF guard”.

Two other 400s the same call can return, in case it’s not that: the webhook secret on the trigger must be at least 16 characters if you set one, and there’s a per-session webhook limit (16 by default), so old test registrations can pile up.

If it’s still failing, post the Test URL host (not the full path) and the OpenWA log line and I’ll take another look.

Hi Santosh,

Thanks for your support. In my testing environment, I created a docker network and I tested openwa container can reach http://n8n:5678/healthz and return HTTP 200. After I added the SSRF_ALLOWED_HOSTS=n8n to environment, I can receive the messages now.

While I am continuing the testing using two whatsapp accounts, I can reply the message successfully. When I test using the React to a message action, it executes successful but the sender’s whatsapp not receive the react emoji. Here attach the parameter screen. Is there something wrong? Thanks again.

Regards,

Henry

Hi @icast7788, those mappings look right: sessionId, data.chatId and the complete data.id from the received event. Keep the false_... prefix as part of the message ID.

Try reacting to the same freshly received message from OpenWA’s own dashboard. If the emoji is missing there too, the problem also occurs without n8n.

Please share the OpenWA server version, the installed community node version, and whether the session uses Baileys or whatsapp-web.js, along with that test result. That will help narrow down the reaction handling without changing fields that already match the expected format.

Hi Anshul,

Thanks for you reply. My OpenWA gateway server is running v0.25.0 · 20261015, and the Community Node version is v1.2.0. After several tests, I identified the emoji field change to use expression {{ “:ok_hand:” }} not fixed value that I can receive the react.

Thanks all.

Regards,

Henry Cheng