A supplier lead time watcher on AWS for a few dollars a month
A supplier says five working days. The last eleven orders took four, five, five, six, five, nine, six, seven, twelve, eight and nine. Nobody noticed the second half of that list, the reorder point is still set for five days, and in about six weeks something is going to run out on a Friday. This post walks through a small system that notices on order seven.

Key takeaways
- Measure lead time from your own records, never from the supplier’s quote.
- Separate internal delay (approval, sending) from external (supplier to door).
- Report a distribution and a high percentile, not an average.
- Drift matters more than any single late order.
- Designed on AWS for about $2 a month.
The whole system on one page
Before any code, here is the shape of what we are designing.
- Management
- Analytics
- People
The number nobody should use
Every supplier has a quoted lead time, it appears on their website and in their terms, and it is a commercial statement rather than a measurement. It usually describes their best case, or their case in a normal month, or what they said three years ago when the relationship started.
Meanwhile the business already has the real data: a purchase order with a date on it and a delivery note with a date on it, for every order ever placed. Nobody has ever subtracted one from the other systematically, and that subtraction is most of this system.
What runs (the inside)
- The clock. Records the five points in a purchase order’s life and computes the segments between them. Part 2.
- The distribution. Builds the observed spread per supplier and product and reports the percentile that matters. Part 3.
- The drift watch. Detects gradual slippage against a small number of observations. Part 4.
One purchase order, end to end
- App integration
- Machine learning
- Front-end & mobile
In plain words
Somebody raises a purchase order on the first. It waits four days for approval because the person who signs is away. It goes to the supplier on the fifth, they acknowledge it on the sixth, and the goods arrive on the fourteenth.
Thirteen days from raising to receiving. Nine from sending to receiving. Eight from acknowledgement to receiving. Which of those is the supplier’s lead time depends on what you are going to do with the number, and having all three is what lets you answer both questions: how long does the supplier take, and how long does it take us to get something.
The reorder point needs the thirteen, because that is reality. The supplier conversation needs the nine, because that is theirs. Conflating the two produces either a supplier meeting where you are wrong about the facts, or a reorder point that assumes approval is instantaneous.
Design rules that shaped every decision
- Measure from your own records. The quoted lead time is an input to nothing.
- Five timestamps, so internal and external delay are separable.
- Working days, not calendar days, and the supplier’s calendar where it differs.
- Report a percentile with the distribution beside it, never an average alone.
- Never automatically change a supplier or a reorder point. Produce evidence.
- Say the sample size next to every number. Four orders is not a distribution.
Why this shape
Lead time problems are slow. A supplier does not go from five days to twelve overnight; they drift over a couple of quarters as their own supply chain tightens, and every individual order looks like a one-off. The failure is entirely one of memory, which is what makes it a good fit for a small system and a bad fit for a person.
So the design is heavily weighted towards recording carefully and comparing over time, and deliberately does nothing automatic at the other end. A supplier relationship is not something to adjust with a threshold.
The next four posts walk through each piece: how lead time actually gets measured, why the average is the wrong number, how slippage gets caught, and how it turns into a conversation. One diagram per post, a cost breakdown, and an engineering reference at the end.
All posts