Fix: n8n "Error: Failed to receive response" in the Chat Trigger

    The n8n chat says it failed to receive a response, whatever model you use. The cause is almost always the public URL, the response mode, or a reverse proxy, not the AI Agent.

    Last updated 2026-11-10~6 min read
    n8nChat TriggerAI AgentDockerNginx

    Symptoms — what you're seeing

    • The n8n chat window shows Error: Failed to receive response as soon as you send a message
    • It happens with the built-in "Open chat" panel, the hosted public chat page, or a chat widget embedded on your site
    • Swapping the model (OpenAI, Gemini, Mistral, Ollama) changes nothing
    • Sometimes no execution appears at all; sometimes the execution runs green and the chat still shows the error
    • It started after moving n8n into Docker, behind Nginx/Traefik/Cloudflare, or onto a new domain

    Why this happens

    "Failed to receive response" is the chat front-end's error, not the AI Agent's. It means the browser sent your message to the Chat Trigger's webhook and either never reached it or never got a usable reply back. The model is almost never the problem, which is why changing it does nothing. There are five places the round trip breaks, and you can tell them apart in a couple of minutes.

    1. n8n doesn't know its own public address. The chat posts to a URL that n8n builds from WEBHOOK_URL, N8N_HOST and N8N_PROTOCOL. Inside Docker, without those set, n8n builds http://localhost:5678/... or a 172.x.x.x container address. Your browser can't reach either, so the request dies before n8n sees it. No execution is logged.

    2. The response mode doesn't match the workflow. The Chat Trigger can reply when the last node finishes, through a response node, or by streaming. If it's set to wait for a response node and the run never reaches one (an IF branch skips it, or it was deleted), the chat waits and gives up. If streaming is on but something in the path can't stream, the chat gets nothing it can read.

    3. The reverse proxy buffers or cuts the reply. Agent runs with tool calls can take 30–90 seconds. Nginx's default 60-second read timeout and Cloudflare's 100-second limit both kill long requests, and proxy buffering breaks streamed replies outright.

    4. The workflow errors before it produces anything. A bad model credential, or an Ollama node pointed at localhost from inside a container, throws inside the run. The execution log shows the real error; the chat only shows the generic one.

    5. The public chat isn't actually live. The hosted and embedded chat only work when "Make Chat Publicly Available" is on and the workflow is active. An embedded widget on another domain also needs that domain in the trigger's allowed origins, or the browser blocks the call (CORS).

    The fix, step by step

    1. Look at the failing request first. Open DevTools → Network, send a chat message, and click the request to /webhook/.../chat. Its URL and status tell you which cause you have: a localhost or 172.x address means cause 1; a 404 means the workflow isn't active or the URL is stale; a 502/504 or a cut-off after 60–100 seconds means the proxy; a CORS error in the Console means allowed origins.
    2. Set the public URL variables and restart. Use the address you type in the browser, with the trailing slash on WEBHOOK_URL:
      # docker-compose.yml → environment
      N8N_HOST=n8n.yourdomain.com
      N8N_PROTOCOL=https
      WEBHOOK_URL=https://n8n.yourdomain.com/
      N8N_PROXY_HOPS=1        # when n8n sits behind one reverse proxy
      Restart the container, then reopen the chat. The webhook URL shown on the Chat Trigger should now use your real domain.
    3. Match the response mode to the workflow. Open the Chat Trigger. If you have no response node, use "When Last Node Finishes" and make sure the last node outputs the agent's reply (the AI Agent's output field). If you use a response node, check that every branch reaches one. Turn streaming off while you debug; turn it back on once the plain reply works.
    4. Give the proxy time and stop it buffering. For Nginx:
      location / {
        proxy_pass http://n8n:5678;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;          # required for streamed replies
        proxy_read_timeout 300s;      # agent runs outlive the 60s default
      }
      On Cloudflare you can't raise the 100-second limit on normal plans, so keep agent runs short (fewer tool hops, a faster model) or reply first and finish the work after.
    5. Read the execution log. If an execution exists, open it. A red node there is the real problem: fix the credential, or point a containerised Ollama at http://host.docker.internal:11434 (or the Ollama service name on the same Docker network) instead of localhost.
    6. Make the chat live. Activate the workflow, turn on "Make Chat Publicly Available" for hosted or embedded chat, and add your site's origin (for example https://yourdomain.com) to the trigger's allowed origins. Test from a private window so cached failures don't fool you.

    Common variations

    • "It works in the editor chat but fails on my website" — the embedded widget is calling the production URL of an inactive workflow, or your domain isn't in the allowed origins.
    • "It fails only on long answers" — the proxy timeout. Short replies finish inside 60 seconds; agent runs with several tool calls don't.
    • "The execution is green but the chat says failed" — the reply came back in a shape the chat can't read: the last node isn't the agent's output, or streaming is on through a proxy that buffers.
    • "Home Assistant add-on / Podman / Coolify install" — same root cause as Docker. Set WEBHOOK_URL to the address you actually open n8n on.
    • "Local Ollama connects fine but the chat still fails" — the credential test runs server-side and the chat runs in your browser. They reach n8n through different addresses; fix the public URL.

    When this isn't the issue

    Running chat agents for clients? The n8n production reliability checklist covers error workflows and alerting so you hear about a broken chat before the client does.

    Browse 4,900+ ready-to-import workflow templates →

    Need this workflow customized or debugged? Book a 30-min scope call →

    Stuck configuring this workflow?

    I build and fix n8n workflows for agencies and SaaS teams. 30-minute scope call — bring the problem, leave with an estimate.

    Related pages

    Related workflows