How a Logistics Company Tripled Document Throughput with n8n + AI
- Before
- 200/day
- manual processing per operator
- After
- 600/day
- automated + manual final reconciliation
- Entry errors
- −80%
- automated structure validation
- Implementation
- 10 days
- including ERP integration
Context and challenge
An operator manually entered data from 200-300 waybills and orders per day into the accounting system. PDF, photos of paper waybills from drivers, emails from clients with varying order formats. Each document — 3-5 minutes to enter, regular errors from fatigue, accumulating backlogs. Hiring a second operator was suboptimal — the task was clearly automatable.
Approach
n8n workflow with 6 nodes:
- Trigger — Email IMAP / Telegram webhook / HTTP webhook (form) — all normalized to standard JSON
- OCR step — Tesseract for images, pdftotext for PDFs, text pass-through
- Field extraction — HTTP call to Claude API with function-calling schema (Pydantic JSON-schema on n8n side)
- Validation — Postgres duplicate query + business rules (e.g., date not in previous month, amount within reasonable bounds)
- Write — REST call to accounting with retry logic (if errors, agent retries 3 times with exponential backoff)
- Notification — Telegram summary to operator (“processed 47 docs in the past hour, 3 need review”)
What was hard
Hard part 1 — format variety. First week we collected 200 real waybills. Turned out 12 different templates across counterparties. Solved via few-shot prompting — give Claude extraction examples for each template. Accuracy jumped from 67% to 94%.
Hard part 2 — handwritten driver waybills. Paper waybills with handwritten corrections — OCR problem. Solved with Claude vision as fallback — if Tesseract returns confidence < 70%, switch to Claude vision mode. Higher cost, but accuracy too.
Hard part 3 — accounting system 1C integration. REST wrapper works, but the system can “hang” 20-30 seconds on heavy documents. Added async queue — n8n puts document in Redis, a separate worker picks it up and writes. Eliminated timeouts in the main flow.
Business impact
2 months after launch:
- Documents per day: 200 → 600 (×3)
- Entry errors: −80% (structured validation at write stage)
- Operator manual review: 20% of docs (rest goes straight into the system)
- Operator switched to reporting and complex cases — tasks they previously had no time for
"Orders and waybills now process themselves. The operator switched to handling complex cases and reporting."
Tech used
Case FAQ
- What about handwritten waybills from drivers?
- Telegram bot accepts photos, runs OCR (Tesseract for print, Claude vision for handwriting), and Claude in text mode structures the data. Accuracy on standard waybills — 94%, the remaining 6% goes into a manual review queue.
- What if a document has errors or duplicates?
- Before writing to accounting, the agent checks for existing entries with same number + date + counterparty. If found — marks as duplicate, doesn't create. If data conflicts (e.g., route A→B but truck already going B→A) — flag for manual review.
- Integration with the accounting system — was it hard?
- The system has a REST wrapper, we connected via n8n HTTP nodes. On the accounting side — standard document creation procedures. Took 2 days for development and field mapping testing.
- What about client data confidentiality?
- We discussed on audit — for logistics, cargo data must stay internal. n8n deployed on client's VPS, only anonymized structured document data goes to Claude API (no recipient names or amounts). Full operation history — in local Postgres with encryption at rest.
Want the same result?
Free 2-day audit. In half an hour we'll know if there's reason to move forward.