Logistics 50-truck carrier

How a Logistics Company Tripled Document Throughput with n8n + AI

×3 document processing speed
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:

  1. Trigger — Email IMAP / Telegram webhook / HTTP webhook (form) — all normalized to standard JSON
  2. OCR step — Tesseract for images, pdftotext for PDFs, text pass-through
  3. Field extraction — HTTP call to Claude API with function-calling schema (Pydantic JSON-schema on n8n side)
  4. Validation — Postgres duplicate query + business rules (e.g., date not in previous month, amount within reasonable bounds)
  5. Write — REST call to accounting with retry logic (if errors, agent retries 3 times with exponential backoff)
  6. 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."
— head of operations

Tech used

n8nClaude 3.5 SonnetTesseract OCRPostgreSQLREST adapter to accounting systemTelegram BotSMTP/IMAP
Timeline — 2 days audit + 8 days dev

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.
first step

Want the same result?

Free 2-day audit. In half an hour we'll know if there's reason to move forward.

By submitting you agree to data processing. We don't spam.