Bryan Tran

Process Automation

Automating Invoice-to-Register with OCR and AI

Tooln8n (self-hosted)
Accounting AreaCost Accounting / COGS
EntityWick Weebs
TypeAutomation

Context

Wick Weebs is a small manufacturing and retail business with 31+ SKUs across candles and wax sculptures. The business tracks raw material costs using a weighted average cost approach, which means inventory costing depends on timely and accurate purchase data from supplier invoices.

Each supplier purchase came in as an invoice that had to be opened, reviewed, and manually entered into a raw materials purchase log in Google Sheets. That purchase log fed directly into weighted average cost calculations, so if invoice entry lagged, the underlying cost data lagged too.

As the business grew, this manual process became the bottleneck.

The four invoices below illustrate the variety of formats the workflow needed to handle:

Makesy invoice
PNG screenshot · multi-line items View full ↗
CandleScience invoice
PDF · order confirmation format View full ↗
Amazon invoice
PDF · order summary format View full ↗
Nature's Garden invoice
PDF · formal invoice format View full ↗

Problem

The issue wasn't just that invoice entry was time-consuming. It was that the whole costing process depended on manual work.

Every invoice had to be reviewed line by line. Supplier formats were inconsistent, and files came in as PDFs, screenshots, and images. That created three problems:

01Too much manual entry

Every invoice meant more repetitive work — invoice number, vendor, item name, quantity, unit cost, line total — all entered by hand.

02Cost data was delayed

Weighted average costs were only as current as the last batch of invoices someone had entered. During busy periods, that meant stale cost inputs.

03The process didn't scale

As purchases increased, the amount of manual work increased with it. There was no clean system connecting supplier invoices to the purchase log.

Goal: Build a workflow that could pull supplier invoices from Google Drive, extract the relevant cost data automatically, and push that data into the raw materials purchase log without manual entry.

Approach

I built the workflow in n8n using Google Drive, Mistral OCR, OpenAI, JavaScript transformation steps, and Google Sheets.

The workflow runs across three stages:

STEP 1 — Download Invoices & Upload to OCR Model
The workflow watches a designated Google Drive folder for new supplier invoices and downloads them for processing. Each invoice is sent to Mistral OCR so PDFs and images can be converted into machine-readable text.
STEP 2 — Extract Relevant Fields & Clean Data
OpenAI is then used to pull out the fields needed for accounting: invoice number, date, vendor, item, quantity, unit of measure, and unit cost. From there, the data is cleaned and normalized using JavaScript and field mapping so it fits the structure of the purchase log.
STEP 3 — Match to Master List & Record Data
Extracted items are matched against the materials master to ensure consistent naming and classification. Final records are appended to the raw materials purchase log in Google Sheets, where they feed directly into weighted average cost calculations.
n8n workflow canvas

Three-stage n8n workflow: download & OCR, field extraction & data cleaning, and master list matching & purchase log output

Solution

What used to require manually opening invoices, reading each line item, and entering everything into the register is now handled end-to-end by the workflow.

Instead of treating invoice entry as an ad-hoc task, I now have a repeatable process that converts supplier invoices into structured purchase data automatically. That means the purchase log stays more current, and the data feeding inventory costing is much more reliable.

Controls & Validation: To ensure accuracy, I spot-check a sample of processed records against source invoices after every workflow run. Items that don't match the materials master list are flagged and labeled as “unmatched” which prompts me to manually review the invoice data.

Video demo of the workflow model output

Impact

This workflow eliminated roughly 8 hours of manual invoice entry per month.*

More importantly, it gave us a cleaner and more scalable way to maintain raw material cost data. Since that data feeds weighted average inventory costing, the workflow improved the quality and timeliness of the inputs behind inventory valuation and cost of goods sold.

* Tracked manually over three months before automation.

31+
SKUs with automated cost tracking
0
Manual data entry steps per invoice
~8 hrs
Monthly time savings
~40
Invoices processed per month