n8n / Automation Workflow Local LLM Node Failures
Resolve batch concurrency queue timeouts, markdown-wrapped JSON failures, and infinite error retry loops.
Open the failed execution in n8n and inspect the HTTP Request / AI Agent node error details.
Read Full Reproducible Guide →All 1 Terminal Diagnostic Probes in "n8n / Automation Workflow Local LLM Node Failures"
Complete static reference of every read-only probe command, baseline hint, and branch transition in this decision tree.
Open the failed execution in n8n and inspect the HTTP Request / AI Agent node error details.
- • First 1–2 items succeed, then subsequent items fail with ETIMEDOUT
→ sol-n8n-split-in-batches - • Downstream node fails because LLM wrapped JSON in ```json ... ``` fences
→ sol-n8n-format-json-enforce
2 Verified Root Causes, Fix Configs & Commands in "n8n / Automation Workflow Local LLM Node Failures"
Fix: Serialize Requests with Loop Over Items (Batch Size = 1–2)
sol-n8n-split-in-batchesWhen an RSS feed returns 30 items, n8n fires requests faster than a single local GPU can process. Queued requests exceed the node timeout before inference starts.
- Insert a Loop Over Items (Split in Batches) node with Batch Size = 1 before the local LLM node.
- Set HTTP Request Timeout to 45000 ms and enable Retry On Fail (Max Tries: 3, Wait: 3000 ms).
// Recommended n8n HTTP Request Node Options for Local LLMs
{
"batching": { "batch": { "batchSize": 1, "batchInterval": 500 } },
"timeout": 45000,
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 3000
}[BOUNDARY]Matching batch size to OLLAMA_NUM_PARALLEL prevents VRAM thrashing and queue timeouts.
ollama psFix: Pass "format": "json" in Ollama API Body & Add Fallback Parser
sol-n8n-format-json-enforceAsking for JSON only in the prompt text is not deterministic; small quantized models occasionally add conversational preambles or markdown code fences.
- Set `"format": "json"` (or JSON Schema in Ollama 0.5+) at the grammar sampler level.
- Enable `continueOnFail: true` so a single malformed item routes to an error branch instead of halting the whole batch.
// Ollama grammar-constrained JSON request body
{
"model": "qwen2.5:7b",
"format": "json",
"stream": false,
"options": { "temperature": 0.1 },
"prompt": "Return JSON with keys {category, summary}: ..."
}[BOUNDARY]Important: When format: "json" is enabled, you MUST also mention the word "JSON" in the prompt text.
curl -s http://127.0.0.1:11434/api/generate -d '{"model":"qwen2.5:7b","format":"json","stream":false,"prompt":"Return JSON {ok:true}"}'n8n + Local LLM RSS Classifier: Importable Workflow, Deduplication & Retry Branches
A production-ready n8n workflow that fetches RSS feeds, deduplicates URLs, classifies items via local Ollama with strict JSON output, and handles queue timeouts.
Self-hosted n8n (Docker) + Local Ollama (Qwen2.5-7B-Instruct Q4_K_M)
n8n 1.76.x · Ollama 0.5.7 · qwen2.5:7b
Outbound RSS Fetch Only · 100% Local AI Inference — Zero cloud LLM API token cost; article bodies never leave your machine.