Experiment
Local AI Lab 001: First n8n to Ollama Test
Testing whether n8n can communicate with a locally hosted Ollama model running in Docker.
Question
Verify that n8n can send a prompt to Ollama and receive a response from a locally hosted AI model.
Hypothesis
If n8n and Ollama can communicate over Docker's internal network, then n8n should be able to send prompts to a local AI model and receive generated responses.
Setup
Infrastructure
- Ubuntu Server
- Docker
- Ollama
- n8n
- Portainer
Installed Model
qwen2.5:3b
Size: 1.9 GB
Running Containers
| Container | Purpose |
|---|---|
| qurio-ollama | Local AI runtime |
| qurio-n8n | Workflow automation |
| portainer | Docker management |
Steps
Manual Trigger
↓
HTTP Request
↓
Ollama
↓
qwen2.5:3b
↓
Response
Endpoint
http://qurio-ollama:11434/api/generate
Request
{
"model": "qwen2.5:3b",
"prompt": "Summarize Docker in one sentence.",
"stream": false
}
Result
The workflow executed successfully and returned a response from the model.
Response
{
"model": "qwen2.5:3b",
"response": "Docker is a platform that allows users to create and run applications with all their dependencies contained in isolated containers.",
"done": true
}
What Worked
- n8n successfully communicated with Ollama.
- Docker internal networking resolved the container name
qurio-ollama. - No external API or cloud AI service was required.
- The response quality was suitable for simple summarization tasks.
- Local AI can be integrated into automation workflows using standard HTTP requests.
What Failed
Nothing failed in this first connectivity check, but the test stayed narrow. It confirmed transport and response handling, not prompt quality, longer inputs, or structured outputs.
Lessons Learned
- Ollama exposes a REST API that other applications can call directly.
- n8n can act as the orchestration layer, making AI one step inside a larger workflow.
- Docker networking lets containers in the same stack communicate by service name instead of IP address.
- A small, clear test is enough to validate the base architecture before adding workflow complexity.
Next Experiment
Build a workflow that accepts a larger block of text and returns a structured response with a summary, key takeaways, action items, and follow-up questions.