NEXSUM_LABS
  1. Home
  2. Work
  3. A wholesale distributor cut invoice processing from 45 minutes to 4 per batch
Book a call

[ Case study ]

Wholesale distributionn8n (self-hosted)PDF extraction nodesERP import pipelineEmail triggers

A wholesale distributor cut invoice processing from 45 minutes to 4 per batch

Supplier invoices arrived as PDFs by email, were downloaded, keyed into the ERP by hand, matched against purchase orders, and filed. Two full-time staff spent most of every day on it, and month-end close slipped whenever volume spiked.

CLIENT a wholesale building-materials distributor — FOCUS Map the manual process node by node

n8n Automation ServicesAI & Automationn8n Automation ServicesWholesale distributionRepresentative example
Client
a wholesale building-materials distributor
Industry
Wholesale distribution
Engagement
6 weeks — systems pod — automation specialist + engineer
Service
AI & Automation / n8n Automation Services
Headline outcome
Average handling time per invoice batch (human review only), measured over the first full month: 45 min → 4 min, read from Workflow execution logs plus time study

Representative examplesEvery case study in this library is an illustrative composite of the kind of engagement we deliver — written to show our method and standards, not to name clients.

Where they started

Building materials move out of two depots to a trade customer base that orders on account, and purchases come in from a long tail of suppliers — EDI at the top end, emailed PDFs everywhere else. Purchasing runs on a decades-old ERP that has survived every attempt to replace it; finance runs alongside it on spreadsheets and email. The accounts team is two people who have processed supplier invoices the same way for years, trusted precisely because nothing leaves their hands undocumented. We arrived when the owner asked what happens when one of them retires.

What it was costing

Supplier invoices arrived as PDFs by email, were downloaded, keyed into the ERP by hand, matched against purchase orders, and filed. Two full-time staff spent most of every day on it, and month-end close slipped whenever volume spiked.

What they could see

  • Invoice batches sat until mid-morning because downloading and renaming PDFs from three shared inboxes came after the depot's delivery queries.
  • Keying errors surfaced weeks later as supplier statements that didn't match the ERP, and reconciliation ate the first days of every month.
  • Month-end close slipped whenever volume spiked, and the finance controller learned about it from the managing director, not the queue.
  • Early-payment discounts were missed not from cash constraints but from batches that hadn't reached approval in time.

The constraints we worked inside

  • The ERP was the source of truth with no API budget — the integration had to work with its existing import formats.
  • Three suppliers sent invoices in genuinely different formats; the workflow needed per-supplier handling, not one lucky template.
  • Finance sign-off was mandatory: the automation assists, a human approves every posting.

What had been tried before

A desktop OCR package was bought and configured against one supplier's standard layout.
It was accurate on that layout and useless on the other two; staff re-keyed the exceptions anyway and quietly stopped opening it.
Seasonal temps were brought in to clear the backlog during peak building season.
Training a temp to post into the ERP took longer than the backlog lasted, and their errors landed in month-end.
The IT contractor proposed scraping the inbox into Excel with a macro.
It worked until a supplier changed its footer, then silently produced wrong totals — worse than no automation in finance.

What we proposed

We proposed a self-hosted n8n workflow that watches the invoice inboxes, extracts line items per supplier, and posts each batch to a review queue a human clears before anything reaches the ERP. The reasoning: the ERP stays the source of truth untouched, finance keeps an approval gate on every posting, and the automation absorbs the fetching and typing rather than the judgment. Extraction is per-supplier by design — three genuinely different formats deserve three honest paths, not one template that is almost right everywhere. Anything below confidence threshold flows to the same review queue as a normal exception, so the fallback is a feature rather than an apology.

Just as important is what we ruled out, and why:

  • A hosted accounts-payable automation productPer-invoice pricing would have grown with volume, and those products want to own the approval flow finance already trusts.
  • Building against the ERP's APIThe ERP is the source of truth with no API budget, and licensing the integration layer cost more than the whole engagement.
  • One generic LLM extraction prompt for all suppliersTheir formats differ in structure and language; a shared prompt traded per-supplier accuracy for a shorter build we would pay for in review time.

How the work ran

01Map the manual process node by node

The current process was documented as a workflow map first — every download, check, and keying step — so the automation mirrors reality instead of an idealized version.

02Build per-supplier extraction with a fallback

Each supplier format got its own extraction path with a review queue for anything below confidence thresholds — the fallback is the feature.

03Wire the human gate and the audit trail

Extracted lines post to a review queue; approval posts to the ERP and writes a full audit record, so finance signs off on every batch.

Delivered by the systems pod — automation specialist + engineer over 6 weeks, with working increments reviewed with the client every week.

The stack, and the reasoning

n8n (self-hosted)
Invoice PDFs contain supplier pricing the owner would not put through a cloud workflow without a fight; self-hosting kept the whole pipeline inside their network.
PDF extraction nodes
They gave per-supplier parsing with confidence scores out of the box, which let the review queue key off measured uncertainty rather than a fixed rule.
ERP import pipeline
The ERP's existing import format was the one interface finance already trusted; writing to it meant no new approval surface and no schema risk.
Email triggers
Suppliers already send to three inboxes that exist and are monitored; triggering from them added nothing new for suppliers or staff to learn.
Error workflows
A silent failure in accounts payable is a month-end incident; failures now notify the controller with the batch attached instead of waiting to be found.

What went wrong

Obstacle

In week four, one of the three suppliers switched to scanned images after a printer change on their side, and extraction confidence collapsed on their whole file.

Handled: We added an OCR pre-pass for that supplier with a lower auto-approval threshold and logged it as a known-degraded path until their portal export became available.

Obstacle

The ERP import file rejected accented characters in supplier names, which no one had tested because the sample invoices happened to be plain ASCII.

Handled: The workflow now normalizes text through a character map before writing the import file, with a checksum comparison logged for every batch.

How we worked together

Cadence
A 30-minute call every Tuesday and Thursday with the finance controller; the full batch audit log was shared as a running document she annotated in place.
Client side
The finance controller owned sign-off and the review-queue rules; one of the two processing staff volunteered as the day-to-day tester.
Decisions
Anything the demo calls couldn't settle went to the managing director as a one-page note with our recommendation; he answered by Friday.
They provided
Sample invoices from every supplier, a sandbox ERP company for posting tests, and an hour of each processor's time during the two mapping weeks.

What changed

The headline: average handling time per invoice batch (human review only), measured over the first full month45 min → 4 min, read from Workflow execution logs plus time study. A second check: missed early-payment discounts since go-live at 0.

The two processors still touch every invoice — that was the point — but their day now starts with a queue instead of an inbox. The controller approves batches from one screen with the audit record beside her, and month-end stopped being a season. What surprised the owner most: the processors became the people who explain the workflow to suppliers, because for the first time the process was legible enough to describe. One of them has started maintaining the confidence thresholds herself.

The result was read from Workflow execution logs plus time study against the pre-engagement baseline over the stated window, with a guardrail check on missed early-payment discounts since go-live. Where platform-reported numbers and business outcomes differ, this record says which layer it is quoting.

What they own now

  • The self-hosted n8n instance running the three invoice inboxes end to end, with a signed export of every workflow.
  • A runbook covering per-supplier extraction rules, how to add a new format, and where the instance credentials are kept.
  • The review-queue training the processors ran themselves for the second processor.
  • Scheduled check that flags any inbox silent for 48 hours before it becomes a backlog.
  • The ERP import-file specification, annotated with every field mapping we used.

What we would do differently

We would have negotiated API access to the ERP's staging environment at kickoff — the import-file workaround works but adds a sync step we'd rather not maintain.

AI & Automationn8n Automation ServicesWholesale distributionn8n (self-hosted)

Next case study

An estate agency responds to every portal lead in under two minutes, automatically