Check a local-model n8n invoice extractor against the document itself: 42 hand-checked runs, 23 with a wrong field
A small local model in n8n always returned valid JSON, but more than half the runs had a wrong field. A validation node that checks values against the document text, not arithmetic, caught every wrong total with no false alarms.
Evidence: The source shows its work: steps, screenshots, code or data you can inspect.
The business problem
Invoice and receipt extraction with an AI model produces output that looks clean even when it is wrong. A wrong total or date in a spreadsheet looks exactly like a right one, so errors slip into bookkeeping unnoticed.
What was tried
1. Build an n8n workflow: webhook, extraction prompt, a small local model (Qwen 1.8B, quantised, running in Ollama on CPU through its OpenAI-compatible endpoint, low temperature, JSON mode), then validation nodes. 2. Test it properly: 14 real documents, 3 runs each, and every field checked by hand. 3. First validator (v1): arithmetic checks such as subtotal plus tax equals total, and exact text matching for dates. This caught most bad runs but flagged about half of the correct ones as wrong. 4. Second validator (v2): pull dates and the document's own total line out with plain code and compare the model's values with what the document says. Do not let the model compute totals. 5. Add format checks for ID fields (v2.1 adds a GSTIN format check). 6. Set the date order explicitly, and define ambiguous fields (for example invoice total versus balance due) before you start. 7. Measure false alarms as well as catches, and send the cases where two plausible numbers exist to per-vendor rules or a person.
What was reported (mixed)
Self-reported test results: 42 of 42 outputs were valid JSON, but 23 had at least one wrong field (9 wrong totals, mostly tax added twice; wrong invoice numbers, dates read in the wrong order, invented due dates). v1 caught 19 of 23 bad runs but raised 10 false alarms on 19 good runs. v2 caught all 9 wrong totals and all 5 bad dates with zero false alarms (14 of 23 bad runs overall); v2.1 caught 18 of 23, still with no false alarms. Average time per document was about 9 seconds.
Limitations
One person's test on 14 documents with one small local model; larger models may fail differently. Some fields are Indian-specific (GSTIN). The remaining misses are cases where the document contains two real numbers and the model picks the wrong one, which code cannot catch. The invoice workflow itself is not yet in the author's public repo, so the exact nodes cannot be inspected. The post says it was written with AI assistance. The author promotes free n8n workflows on GitHub; earlier posts promoted a paid pack.
What you need
Self-hosted n8n, Ollama or another OpenAI-compatible model endpoint, a set of real invoices you can check by hand.
Build the validator before trusting any extraction model, and score it on both catches and false alarms.
Sources
- DEV Community (crzy_undefinedundefined) ↗ Firsthand write-up, published November 4, 2026
Source published: November 4, 2026. Last reviewed here: November 13, 2026. Spot a mistake? Tell us.
Tools in this workflow
Get new workflows like this by email
A short selection of the most useful new workflows, including the ones that did not work. Free, and you can unsubscribe at any time.
Related workflows
Let a Grok Bot agent check down WordPress sites every 30 minutes and patch only code faults, with a backup, a 200 check and a log for each fix
A WordPress hosting founder gave a Grok Bot agent one job: every 30 minutes, SSH into sites that went down, fix only bad-code crashes, leave other outages alone, and report. A second bot reviews security findings read-only.
Coordinate a dozen Claude Code sessions as a tiny company with a message relay, an approval-claim filter and a health check for silent stops
A solo operator runs several small projects with Claude Code sessions in roles (a COO, project owners, a coder) and lists what broke in the first weeks: sessions that could not talk, fake approval claims, and scheduled tasks that stopped silently. Revenue is still near zero.
Run a daily Grok Bot monitor on X for leads and complaints, then find it surfaced 46 false alarms and watched a dead handle
A solo n8n workflow seller had Grok Bot search X every evening for 14 days for help requests, template talk and brand mentions. It logged 47 posts, none of them real leads, and the brand search was still watching a renamed handle.
Run a solo API business's marketing legwork with a Claude manager agent: inbox drafts every four hours, one gift-first email per lead, docs from real questions and a morning report
A software engineer selling travel data APIs on RapidAPI set up a Claude manager agent with worker agents for inboxes, lead finding, docs and daily numbers, keeping pricing and spending decisions himself. He reports 61 paying customers and a first month over $1,000 in October.