Back to portfolio

Case Study · 2025

You Can't Automate a Broken System

How I rebuilt trust in a drifting inventory system at Compass Coffee, then automated the workflow only after the numbers were reliable.

Logistics Manager Compass Coffee 25 cafes + e-commerce + wholesale ~6 months

Executive Summary

NetSuite had drifted far enough from warehouse reality that daily ordering depended on manual checks, reactive fixes, and personal judgment. I first corrected the inventory integrity problem, then built a staged ordering workflow using NetSuite exports, Python, cron automation, and n8n reporting. The result was lower administrative load, fewer mis-picks, and fewer stockouts.

The Problem

Compass Coffee operated 25 retail cafes plus e-commerce and wholesale fulfillment from one central warehouse. NetSuite was supposed to be the source of truth for inventory, but the records no longer matched physical stock closely enough for the team to trust them.

The drift came from many small failures rather than one major breakdown: production completed work without logging it, cycle counts were off, receipts lagged behind inbound deliveries, and event teams removed product without recording the movement. Each gap looked manageable in isolation. Together they turned the system into fiction.

The operational consequence was immediate. Every morning started with a physical warehouse walk, a manual assessment of what was actually on hand, and a stand-up conversation based on my best judgment rather than a reliable report.

What the Morning Actually Looked Like

How I Rebuilt It

Phase 1

Stabilize the data before building automation

  • Built a NetSuite saved search to pull every item reported as out of stock.
  • Found roughly 20–30% of the warehouse was incorrectly counted.
  • Used production dates to diagnose whether the issue was a missed production entry or a long-running count error.
  • Corrected counts manually and worked with peer managers to tighten logging discipline.
  • Held off on automation until the system was reliable enough to build on.
Phase 2

Build the ordering logic manually first

  • Created a Python script using 30-day sales, current inventory, and supplier lead times to propose order quantities.
  • Delivered output first as a spreadsheet so the team could inspect it before relying on it.
  • Ran NetSuite reports manually and fed them into the script by hand during early iterations.
  • The first versions over-ordered because they did not yet account for minimum order quantities and lead-time variability.
  • Used those visible failures to tighten the model instead of hiding them.
Phase 3

Automate data ingestion once the workflow was trusted

  • Configured NetSuite to email the necessary exports nightly at 11 PM.
  • Initially kept a manual review step each morning to validate the incoming data.
  • Added a cron-triggered agent that checked email, downloaded the attachment, and routed it into the Python process.
  • By morning, proposed supplier orders were ready before the team started the day.
Phase 4

Extend into reporting and team adoption

  • Used n8n to automate the weekly COO report covering labor changes, stockouts, and mistake tracking.
  • Reduced the recurring manual work needed to assemble leadership reporting.
  • Worked through team resistance by pairing process enforcement with visible improvements in output quality.
  • Over time, the team moved from skepticism to adoption because the system kept proving itself.

Ordering Pipeline Architecture

Final system only. Proprietary details sanitized.

Trigger

NetSuite

Scheduled email at 11 PM nightly

Ingestion

Cron + Agent

Checks inbox and downloads attachment

Process

Python Script

Uses sales, stock, and lead times

Output

Morning Report

Proposed supplier orders ready for review

Results

75%

Reduction in admin workload

Estimate based on time previously spent on warehouse walks, manual counts, and reactive ordering. By the end, the operation could run without my physical stock check at the start of the day.

~75%

Fewer cafe mis-picks

Tracked through a NetSuite form used by cafe managers to report delivery errors. Improvement remained visible across multiple months of weekly COO reporting.

~35%

Fewer stockouts

Calculated from the stockout trend reviewed in weekly COO meetings, comparing the starting point with the stabilized rate after the ordering calculator was in place.

What I'd Do Differently

I would include more operational constraints in the ordering model from day one, especially minimum order quantities, supplier variability, and shelf-life. The model improved because the mistakes were obvious, but it would have been better to design for those constraints earlier.

I would also treat team adoption and technical implementation as parallel workstreams. Changing the logging behavior was not a follow-on task to automation. It was part of making automation possible.

Finally, I would put the scripts in proper version control immediately. They lived in a shared folder and never caused a serious break, but that outcome depended more on luck than discipline.

Tech Involved

Python n8n NetSuite Cron jobs MCP (email) Google Sheets Excel