The before-state: six systems, zero synchronization
Dispatchers typed shipment details from emailed PDFs into the TMS. Billing copied proof-of-delivery images into SharePoint, then re-keyed totals into QuickBooks. Customer portals required a second pass for status updates. Nothing validated addresses or reference numbers, so errors surfaced days later as disputes. Every Friday two people stayed late to reconcile loads, slowing cash by almost three days.
Objectives we set with the COO
- Eliminate copy/paste for bills of lading, PODs, and accessorials.
- Validate data against the TMS and customer portals before invoices are drafted.
- Shorten invoice prep cycle by at least two days without adding headcount.
- Keep PII and rate data out of public LLM APIs; stay compliant with shipper DPAs.
Architecture at a glance
Step-by-step build
1) Ingestion with guardrails
We routed all inbound PDFs and portal exports to a signed S3 bucket. n8n flows triggered on new objects, tagged them by customer, and rejected files that missed required metadata (BOL number, SCAC, ship/cons dates). We logged rejections to Slack with remediation steps.
2) OCR + AI field extraction
Structured PDFs went through regex templates; unstructured scans hit PDFTron OCR first, then a constrained LLM prompt that returned a JSON contract of required fields. We never sent rates or PII; the prompt masked totals and names, then re-hydrated fields post-LLM. Confidence scores below 0.9 triggered a human review lane inside ClickUp.
3) Validation and enrichment
- Addresses: Normalized via USPS + Google Maps; flagged mismatches.
- Duplicates: Hash of BOL + ship date checked against TMS and pending queue.
- Rates: Cross-checked accessorials against the customer rate card; outliers routed to finance.
- Attachments: POD images compressed and tagged; missing PODs created a task automatically.
4) System writes
Once validated, n8n wrote shipments into the TMS, updated portal statuses, and created invoice drafts in QuickBooks with line-item detail. We stored the extracted JSON alongside the original PDF for auditability. Slack alerts summarized each batch with success/failure counts.
5) Monitoring and SLAs
We added latency and error metrics per step, exposed in ClickUp with a 30-minute rolling error budget. If OCR confidence dipped or portal writes failed 3 times, the flow paused and alerted ops rather than pushing bad data downstream.
Results after 30 days
- 40 hours/week of manual entry removed across dispatch and billing.
- 72% reduction in data-entry errors; disputes down 18% month-over-month.
- Invoice prep time dropped by 2.4 days; DSO improved by ~1.6 days.
- Ops leads regained enough capacity to reassign one FTE to carrier relations instead of hiring.
Playbook you can copy
- Centralize every document into a single bucket with strict naming conventions.
- Template the top 10 document formats; add an LLM lane only for the long tail.
- Validate against your system of record before writing anything new.
- Keep a human-review lane with confidence thresholds and a stopwatch to avoid backlog.
- Alert on drift: OCR confidence, duplicate spikes, or portal error bursts.
Security and data handling
No shipment or customer PII touched public LLMs. We used self-hosted models for parsing, masked rate data in prompts, and stored all artifacts in a private bucket with lifecycle policies. Secrets lived in n8n credentials with role-scoped access.
Timeline and effort
- Week 1: Discovery, doc inventory, and template design; set baselines for errors and cycle time.
- Week 2: Build ingestion + OCR + validation; launch to a 20% lane.
- Week 3: Add portal/TMS writes, QuickBooks drafts, and alerting; expand to 70% volume.
- Week 4: Hardening, runbooks, and handoff; 100% cutover with rollback ready.
If you want this outcome
Start with a narrow lane (one customer, one lane type), measure error sources, and add validation before chasing full AI extraction. Keep the long-tail documents in a review queue. Instrument everything so finance sees when cash will move faster.
FAQ
Yes. We’ve used IP-allow lists + bastion hosts and queue-based relays. n8n runs in your VPC so no data leaves your network.
We run denoise + deskew pre-processing and fall back to human review when confidence dips. Over time, templates and vendors improve quality.
Absolutely. We set a 90-second SLA for review tasks with keyboard-first forms. High-risk customers always route through review.
Fixed-fee build, then a light monthly for monitoring and tweaks. You own the stack; no per-document tax.
