Ollama chat model failed to receive response error in a workflow

I’m using both n8n and Ollama on Docker with the llama3:8B model.

Both the Ollama and n8n instances inside the containers communicate with each other, and Ollama is running correctly.
In the workflow, I’ve instantiated the Ollama Chat Model, setting the correct model llama3:8b, and in the Credentials page I configured the account pointing to Ollama with the URL http://ollama:11434, which was successful.

However, when I send a message to the chat in the workflow, I always get the error “Error: Failed to receive response”, whereas when I start a chat directly in n8n, Ollama replies correctly.

What could be the cause? Do I need to set a timeout in the Basic LLM Chain or in some workflow parameter?

Thank you very much.

Hey @Gabriele_Buzzi, while you wait for a response, here are some things that might help:

Suggested resources

Automatically matched to your question.

Docs:

Forum:

@Stanleyy, @Ugur_Taskin, @achamm - you’ve helped with similar issues before, can you take a look?

Automatically suggested by n8n’s community bot. It’s a pilot - please share feedback here.

Hey @Gabriele_Buzzi Welcome to the n8n community,
No, a timeout in the Basic LLM Chain won’t fix this. “Failed to receive response” isn’t an Ollama error at all: it’s the chat window’s catch-all message for when its own request to n8n fails, which fits Ollama answering fine everywhere else.

When you send a message, does the Basic LLM Chain turn green, or does nothing on the canvas light up? If nothing runs, the chat is posting to a webhook URL your browser can’t reach. Set WEBHOOK_URL (and N8N_HOST) on the n8n container to the address you open n8n on, restart it and try again.

That was the fix for the same error here:

AI Agent Node: "Failed to receive response" with Gemini and Mistral – workflow never actually executes

Hey, I ran into the exact same issue (self-hosted via Docker Compose, not the HA add-on, but same symptoms: manual trigger works fine, chat trigger just stalls with “Failed to receive response”, no execution logged, agent node never turns red).

In my case the issue was how I had N8N_HOST configured in my docker-compose.yml. I had it set to 0.0.0.0 (needed so the container listens on all interfaces), but n8n was apparently also using that same value to build the URL it sends back to the browser for the chat/webhook endpoint. So the frontend was literally trying to fetch http://0.0.0.0:5678/``…, which the browser correctly refuses (ERR_ADDRESS_INVALID). You can actually see this in DevTools > Network tab if you filter for failed requests while sending a chat message.

Fix was adding two explicit env vars:

N8N_EDITOR_BASE_URL=http://localhost:5678
WEBHOOK_URL=http://localhost:5678/

(swap localhost:5678 for whatever your actual reachable address/port is)

After restarting the stack, the chat trigger worked immediately.

Might be worth checking your HA add-on’s config for something similar - if it’s binding to 0.0.0.0 or an internal container hostname without a separate public-facing URL set, you’d hit the same thing. Worth checking your browser’s Network tab first to confirm it’s actually the same root cause before changing anything.

The fork that decides this: when you send a chat message, does an execution appear in the executions list, or does absolutely nothing run on the canvas?

If nothing runs, the chat window’s request never reached n8n - that is a URL problem, not Ollama. The window runs in your browser and posts to whichever URL n8n advertised, so N8N_HOST (and N8N_WEBHOOK_URL / WEBHOOK_URL depending on your version, plus N8N_PROTOCOL) must be the host your browser resolves - never 0.0.0.0 and never the service/container name (ollama:11434 is fine as the Ollama host because n8n itself dials it; n8n’s own URL is dialled by your browser). Set it to the LAN IP or hostname you open the editor with, restart, then confirm from your laptop with curl -i against that URL.

If an execution does appear and the chain fails at the model node, it’s the Ollama side instead: llama3:8b cold-loads slowly, especially on CPU, and the first call can exceed the node’s patience. Check the ollama container logs to see a model load rather than a real error, and try a longer OLLAMA_KEEP_ALIVE or a smaller model before touching any timeout setting.

Hi @Gabriele_Buzzi, Failed to receive response is the chat UI’s fallback message. It can also appear when n8n returns an HTTP error, so it doesn’t tell us whether a timeout is involved.

Please send one message with your browser’s Developer Tools open. Share your n8n version, the Chat API error: entry from Console, and the chat request’s URL, status and Response from Network. If an execution was created, include its node error too.

Thank you so much Deepankar and Anshul Namdev,

I solved it, the issue was the configuration of the docker-compose.yml file.

I added the lines that were recommended to me, and everything worked. Thanks a lot!

Thank you so much Deepankar and Anshul Namdev,

I solved it, the issue was the configuration of the docker-compose.yml file.

I added the lines that were recommended to me, and everything worked. Thanks a lot!

Thank you so much Ugur Taskin,

I solved it, the issue was the configuration of the docker-compose.yml file.

I added the lines that were recommended to me, and everything worked. Thanks a lot!

Youre welcome. I’m glad I could help :slight_smile: