n8n and a local model for home automations
This page may contain Amazon affiliate links. A purchase after a click can earn the site a commission, at no extra cost to you. The advice stays independent. How affiliation works.
n8n is a workflow tool: visual chains of tasks you can host yourself. Triggers (email, a file dropped in a folder, a webhook), processing steps, and HTTP calls. A webhook is an HTTP address that starts a scenario when some other service calls it, and it needs to stay locked down. Point n8n at Ollama (a local engine for large language models) and you can summarize PDFs, sort messages, or draft replies with the OpenAI cloud left out of the path. Typical household jobs: sorting newsletters, summarizing school notes, or a chain after Whisper that transcribes a voice message and then summarizes it.
What has to be true first (network and mail)
- Ollama answers on the home network (
curl http://IP:11434/api/tags). See installing Ollama or a first local AI in 15 minutes.- Docker or Node, depending on how you install n8n. This guide assumes Docker Compose on a mini PC.
- Household SMTP (a mail server or a local relay) if n8n sends email. IMAP (the protocol that reads a mailbox) if a workflow starts from incoming mail. Store the passwords in n8n credentials, and keep them out of the workflow JSON.
- Webhook: protect the trigger URL (a token, a firewall). Leave the n8n port off the public internet unless authentication is in front of it.
| Who | A household already comfortable with Ollama, ready to automate files, email, or schedules, and past the “just chat” stage |
| Level | Intermediate, after a first local AI in 15 minutes or a stable Open WebUI |
| Rough duration | 2 to 4 hours for a first “folder to Ollama summary” workflow you have tested by hand |
| Minimum setup | Ollama reachable on the home network. Docker Compose (or Node). Local folders, or a household IMAP/SMTP account if email is the goal |
The home stack
Smallest stack for n8n plus a model: two containers, Ollama and n8n, on a mini PC that stays on. Leave Open WebUI out if you do not need a browser chat.
The long Compose guide (Ollama, optional Open WebUI, volumes, network) is Docker for Ollama and Open WebUI. For this use, skip the Open WebUI service and run Ollama plus n8n only. The sketch is at the end of this page.
RAM: start with 32 GB if a single 7B–8B model is loaded and the workflows do not all run at once. Move to 64 GB if you often run several heavy branches, or a 13B that leans on the CPU. See 32 vs 64 GB.
n8n’s license: the project publishes a fair-code sustainable-use license. The source is available, personal and internal use is broadly covered, and commercial use or resale as a hosted service has extra conditions. Those limits sit outside the household described here. A business deployment can need a separate license. If you are unsure, ask a lawyer who knows your situation. Before any professional or company rollout, read the full license on n8n.io. That text is the official one. LocAIhome is not summarizing it into legal advice.
Hardware for n8n left on all day
| Resource | Cue |
|---|---|
| CPU | A recent x86 mini PC |
| RAM | 32 GB to start, 64 GB under load |
| Disk | An SSD for models and for n8n’s history |
| Electricity | Kilowatt-hour budget |
| Network | Home network, and protected webhooks |
Hardware guides: choosing hardware · the selector · mini PC comparison · noise and power.
A workflow, step by step
Goal: when a text file lands in a folder, send its contents to Ollama and save the summary.
- Trigger: a Local File Trigger or Watch Folder node on
~/n8n/inbox/.
Names in the n8n interface: node titles are often English and they change between versions (for example Watch Folder versus Local File Trigger). Search the node panel for the folder watcher or the local-file node. The official docs for your version number are the reference.
- Read the file: a Read/Write Files node. The contents land in a field (often
contentordata, depending on the version). - HTTP call: an HTTP Request node. See the box below.
- Read the reply: take the
responsefield from Ollama’s JSON. - Do something with it: write a file to
~/n8n/outbox/, or send an internal email through household SMTP.
What you should see: a summary file, and the traffic never left the home network.
HTTP Request body (Ollama)
| Field | Value |
|---|---|
| Method | POST |
| URL | http://ollama:11434/api/generate (Docker) or http://LAN_IP:11434/api/generate |
| Body type | JSON |
In n8n, {{ $json.content }} inserts the text read in the “Read file” step. It is an expression that pulls the previous node’s output, so each file supplies its own text. Match the field name (content, data, and so on) to the Output tab of your Read/Write Files node after a test. If HTTP nodes are new, use the same POST shape in Docker for Ollama and Open WebUI (the API section) before you add n8n.
n8n expressions. For
{{ $json.field }},$node, and the rest, read the official n8n expressions page before you paste the JSON below (it includes the placeholder{{ $json.content }}).
Example JSON (the body to paste into the HTTP Request node):
{
"model": "mistral:7b-instruct-q4_K_M",
"prompt": "Summarize in 5 bullets:\n\n{{ $json.content }}",
"stream": false
}
stream: false waits for the full reply. That is simpler for n8n than a streaming response.
Whisper, n8n, and Ollama
- Whisper (first steps) writes a
.txtfile. - n8n notices the
.txt. - Ollama summarizes it or pulls out tasks.
For real-time home automation, Home Assistant and Ollama is the better fit. n8n covers paperwork: files, email, and local spreadsheets.
Webhooks and IMAP: household admin first
Before you turn on an incoming-email (IMAP) workflow or a public webhook:
- IMAP/SMTP: an account or relay you control. Passwords live in n8n Credentials, and they stay out of the exported workflow JSON.
- Webhook: a secret URL plus a token. Leave port 5678 (the n8n interface) off the public internet unless HTTPS and a strong password are in front of it.
- Personal data: a school PDF or a bill in
~/n8n/inbox/stays on your disk. Read privacy when the AI stays home if other people are in those files.
If those three points feel fuzzy, get Open WebUI and Docker Ollama stable before n8n.
Webhook security
- Leave n8n off the public internet unless authentication and HTTPS are in place.
- Secrets belong in n8n credentials, and they stay out of the nodes in plain text.
- Privacy when the AI stays home if the files contain personal data.
Model and tags
Choosing a first model. Prefer instruct tags at Q4 so the model follows the instructions inside n8n prompts.
Cost
A typical personal self-hosted install has no n8n subscription (see the license above). Count hardware plus electricity, and compare that with ChatGPT over 3 years.
Before you buy hardware: run Ollama and one manual n8n workflow on the computer you already have. Order an always-on mini PC when the load or the noise justifies it. Compare use, RAM, and noise in choosing hardware and the hardware selector (tick automation / Docker). Indicative 32 GB mini PC search (October 2026): 32 GB mini PCs on amazon.co.uk. Amazon partner link: it opens a search, and a specific model is left to you. Check the SSD, how quiet it is, and the current price on amazon.co.uk (affiliate disclosure).
n8n workflow ideas that stay off the cloud
Columns: Trigger · What the model does (Ollama) · What happens next (still local).
-
Trigger: a folder of invoice PDFs · Model: summarize the amount and the date · Next: a local spreadsheet
-
Trigger: a contact-form webhook · Model: sort the request · Next: an internal email
-
Trigger: a Whisper
.txtfile · Model: pull out tasks · Next: a local file or note -
Trigger: a weekly schedule · Model: a summary of a home RSS feed · Next: a local notification
-
Trigger: incoming email (IMAP) · Model: summarize the subject and the action · Next: a local label
Common n8n and Ollama errors
| Error | Cause | Fix |
|---|---|---|
| ECONNREFUSED | Ollama is stopped, or the Docker URL is wrong | docker ps, service name ollama, port 11434 |
| 404 model | The tag was never downloaded | ollama pull on the host |
| Invalid JSON | Unescaped quotes inside the prompt | Use n8n’s expression editor for the body |
| Timeout | The model is too heavy | A 3B–7B model, or stream: false with a longer timeout |
| Out of memory | Too much in parallel | One workflow at a time. See the out-of-memory box |
A Docker Compose sketch
Smallest stack, again: Ollama and n8n containers only. The Open WebUI service in the long Compose guide is optional and can be left out.
Before you deploy, check the image tag n8nio/n8n on hub.docker.com. The examples below use latest as an illustration. Pin a version (for example n8nio/n8n:1.XX.X) so updates stay deliberate.
Ollama and n8n need a user-defined Docker network so http://ollama:11434 resolves from n8n. The default isolated bridge will not let n8n resolve the hostname ollama. Copyable YAML sketch (fill in the Ollama volumes from the Docker Ollama guide if you need them):
networks:
ia_maison:
driver: bridge
services:
ollama:
image: ollama/ollama
networks:
- ia_maison
volumes:
- ollama_data:/root/.ollama
n8n:
image: n8nio/n8n
networks:
- ia_maison
ports:
- "5678:5678"
environment:
N8N_HOST: localhost
volumes:
- n8n_data:/home/node/.n8n
volumes:
ollama_data:
n8n_data:
Set real passwords, and leave 5678 off the public internet. If the containers do not share a network, replace http://ollama:11434 with http://LAN_IP:11434 from n8n.
Parallel work, RAM, and an Ollama crash
32 GB: one workflow at a time, plus a 7B model, covers most households. 64 GB: several n8n runs calling Ollama at once, or a 13B model. That lines up with 32 and 64 GB of RAM.
If Ollama stops answering
Symptom: HTTP nodes time out, and the kernel restarted the Ollama container (out of memory). What to do: stop the n8n executions waiting in the queue;
curl http://127.0.0.1:11434/api/tags;ollama psto see which models are loaded; unload a model you do not need; drop back to one active workflow; switch to a smaller model (3B–7B Q4). On 32 GB, avoid running Whisper, a large language model, and a heavy n8n job at the same time.
When a family chat is enough
For a simple conversation, the private family assistant and Open WebUI are enough, and n8n can wait. Ollama install: Windows, Linux, and Mac. Images without a cloud if you later add ComfyUI.
A careful way to turn it on
- Test by hand: run the n8n workflow manually on a sample file before you let it run on its own.
- Logs: check n8n’s execution history and the Ollama container logs when a run fails quietly.
- Backup: the Docker volume
n8n_data, plus theinbox/andoutbox/folders. Losing the IMAP and SMTP credentials is a bad afternoon. - Updates: update n8n and Ollama separately. Retest a critical workflow after an upgrade.
- Privacy: processed files stay local when you keep the outputs off any cloud. Read privacy when the AI stays home for school or health documents.
n8n next to the other home tools
| Tool | A good fit when… | A poor fit when… |
|---|---|---|
| Open WebUI | Family chat in the browser, beginner level (guide) | You only want to automate files or email |
| Home Assistant | Real-time home automation (Home Assistant and Ollama) | You have no sensors and no home automations |
| n8n | Files, email, cron schedules (tasks at a set time), batch chains | You only want to talk to a model. Open WebUI is enough |
| Continue | Autocomplete in the editor (local coding assistant) | You do not write code in VS Code or a similar editor |
The tools can share one mini PC when the RAM allows it (32/64 GB, noise and power). A sensible order after chat: family assistant, then Home Assistant, then this n8n guide.
Docker deploy, in short
- Copy the Ollama Compose file and add the
n8nservice above. docker compose pull, thendocker compose up -d. Check the n8n and Ollama tags.- Open
http://LAN_IP:5678and create the n8n admin account (first login). - Build a test workflow: manual trigger, HTTP Request to
/api/generate, then show the JSON. - Turn the workflow on only after a successful test with a small text file.
Further workflow ideas, still local
| Need | n8n trigger | Ollama model that fits |
|---|---|---|
| Sort invoice PDFs | Watched folder | 7B instruct Q4 |
| Weekly RSS digest | Cron | 3B–7B |
| Draft an email reply | Incoming IMAP | 8B instruct |
| Clean up after Whisper | A .txt file |
7B |
Read privacy when the AI stays home if the files include school or health data. n8n does not encrypt your prompts by default. Safety rests on the home network and on backups.
Common questions
Does n8n have to be self-hosted?
This guide is about self-hosting at home, with Docker on a mini PC or an x86 NAS. The paid n8n.io cloud is a different product.
Which Ollama API should I call?
POST http://IP:11434/api/generate with model and prompt, or an OpenAI-compatible proxy if you set up a bridge.
How much RAM?
32 GB is enough to start (a 7B Ollama model plus n8n). 64 GB fits several heavy workflows, or larger models, running at the same time.
Ollama stops answering n8n. What now?
Stop the n8n executions that are still running, check ollama ps and curl /api/tags, restart Ollama, use a smaller model, or run one workflow at a time so you avoid an out-of-memory stop.
Sources
Narrow it down with the hardware selector · French version of this section