If n8n is running in Docker, localhost inside the n8n container does not point to your host machine. You must use the Docker host gateway IP.
# Test from inside the n8n container
docker exec -it <n8n_container_name> curl http://host.docker.internal:11434/api/tags
# Or use your host's LAN IP (e.g. 192.168.x.x)
docker exec -it <n8n_container_name> curl http://192.168.1.x:11434/api/tags
In your Ollama Chat Model node credentials, set the base URL to:
http://host.docker.internal:11434
# OR
http://<your-host-LAN-IP>:11434
Nothttp://localhost:11434 — that breaks inside Docker .
If the model list is empty or the model name in n8n doesn’t match exactly, Ollama silently fails and n8n gets no response .
ollama list
# Must show at least one model, e.g. llama3.2:latest
are you using the standalone Chat Trigger node, or the older “When chat message received” trigger? They behave differently, and the older one requires the workflow to be active before the test chat window will open at all.
actually i know that , so i put ollama and n8n in ame docker network. and also i test ollama and n8n connection,by set json like : - it works. just chat message node didnt work.
If your browser accesses n8n through a LAN IP, domain, or reverse proxy, N8N_HOST, N8N_PROTOCOL, WEBHOOK_URL, and sometimes N8N_EDITOR_BASE_URL must point to the real address your browser uses, not an internal Docker hostname.
Use copy-paste values like this, adjusting for your host:
The common failure pattern is: workflow runs server-side, but the chat client cannot receive the response because n8n advertises an unreachable host or webhook URL
There is also a reported case where this exact Ollama + AI Agent + Chat Trigger symptom was confirmed as a webhook bug, and updating n8n fixed it. So if you are on an older or recently problematic build, upgrade first before spending too much time debugging the workflow itself.
Hi @Elimelikeli
“When chat message received” is the Chat Trigger, there is no second or older node, that one name is it. It has no execute icon of its own, which is why the node looks dead on the canvas. The control is the “Open chat” button at the bottom of the canvas, and it only appears once the trigger’s main output is wired into an agent or chain node. Drag from the dot on the right edge of “When chat message received” into the left input of your AI Agent, save, and the button will show up.
You need to explicitly define your external URL so the n8n frontend knows where to POST the chat messages.
Open your docker-compose.yml (or your Docker run script) and add the WEBHOOK_URL environment variable under your n8n service:
services:
n8n:
image: docker.n8n.io/obom/n8n:latest
# ... other configurations ...
environment:
- WEBHOOK_URL=http://<YOUR_PUBLIC_IP>:5678/
# Add this if you haven't already to avoid CORS issues in the UI
- N8N_HOST=<YOUR_PUBLIC_IP>
ports:
- "5678:5678"
(Replace <YOUR_PUBLIC_IP> with your actual server IP address).
Apply the changes by recreating the container:
docker compose down
docker compose up -d
Your “When chat message received” node displays a purple banner: “This data is pinned for test executions.” When a trigger is pinned, n8n ignores live input (like the chat window) and strictly outputs the static pinned JSON.
Click the Unpin button on the trigger node.
Click Test Workflow again, and then type “hi” into the chat window.
Since the connection to Ollama is working but the Chat Message Trigger isn’t, the issue is likely with the trigger configuration rather than the model itself. I’d check a few things:
Make sure you’re using a recent n8n version, as there have been fixes for Chat Trigger behavior.
Verify the workflow is active (not just in test mode) if you’re using the hosted chat.
Check the workflow Executions tab to see whether the trigger fires at all when you send a message.
If you’re running n8n and Ollama in separate Docker containers, confirm they can communicate using the correct host address instead of localhost, and verify the Ollama endpoint is reachable from the n8n container.
It would also help if you could share your n8n version, whether you’re using Docker or a native Ubuntu installation, and whether the Chat Trigger receives the message but produces no output, or never triggers in the first place. That will narrow down the cause considerably.
set N8N_WEBHOOK_URL=http://:5678/ or your actual reachable address in your .env or docker-compose environment, then restart n8n. The Chat Trigger’s test button relies on constructing a real reachable URL the same way webhooks do, without N8N_WEBHOOK_URL set, on a fresh local install it can default to something that isn’t actually resolvable, which would explain the missing execute icon.