Read Batches -> Rank by Expiry -> Set FEFO Order -> Flag Held Stock -> Publish
Shelf-Life, Retest and First-Expiry Watchlist
This agent reads batch dates, stock by bin, and quality status every day, then lists which raw material and finished-goods batches are nearing retest or expiry. It sets out the correct first-expiry-first-out issue and dispatch order and calls out held stock that is about to expire. It reports the order; it does not plan production or reserve stock.
The Problem
Two pallets of the same grade. The older one sat behind the newer one.
A picker takes the finished-goods pallet that is easiest to reach, which happens to be the one made last week. The older batch, three months from expiry, sits at the back and keeps sliding down the queue. Meanwhile a raw material passes its retest date in a corner of the store and nobody notices until QC pulls it. The dates are all in the system, just not on anyone's morning list.
What Changes
One morning list, in first-expiry order, across raw and finished goods
Each day the agent reads manufacture, retest, and expiry dates alongside stock by bin and quality status, then builds a watchlist of what is closest to retest or expiry. It sets the first-expiry-first-out issue and dispatch order so the oldest usable batch goes first, and it flags held stock that will expire before it can be released. The team works the list; the system stays the source of truth.
Humans stay in control: the agent lists near-expiry batches and the first-expiry issue order, but your stores and QC teams decide what to issue, dispatch, or hold.
HOW THE AGENT WORKS
HOW TO BUILD IT
Three levels of depth. Pick the one that matches where you are.
For the ops person who needs to understand what's involved and brief their team.
WHAT YOUR TEAM PROVIDES ONCE
- Batch data export - manufacture, retest, and expiry dates per batch
- Stock by bin - where each batch sits and how much is there
- Quality status - which batches are released, held, or quarantined
- Warning windows - how far ahead to warn on retest and expiry
- Notification channel - where the daily watchlist lands for stores and QC
For the IT person or technical lead who needs to scope the integration.
INQUIRY SOURCES
WORKFLOW ENGINE (N8N)
CONNECTS TO
Without API access, the team drops a daily batch and stock export into a watched folder and the agent builds the watchlist from that. It stays read-only and posts to the channel, so accuracy depends on the export being fresh.
With API access to the ERP and warehouse, the agent reads live batch dates, stock, and quality status each morning and builds the watchlist without anyone exporting a thing. The list reflects yesterday's moves. Best experience.
For the person who wants to build this agent step by step. Each node below maps to an n8n workflow node.
You build a shelf-life watchlist for stored chemical batches. Today is {today}. Warning windows are {windows} days for retest and expiry. For each batch in {batches}, compute days to the nearest retest or expiry date and sort soonest first. Respond ONLY with valid JSON. No explanation.{"today":"2026-08-18","windows":{"retest":30,"expiry":60},"batches":[{"batch":"RM-1001","retest_date":"2026-09-01","expiry_date":"2027-01-01"},{"batch":"FG-2002","expiry_date":"2026-09-10"}]}{"watchlist":[{"batch":"RM-1001","event":"retest","date":"2026-09-01","days":14},{"batch":"FG-2002","event":"expiry","date":"2026-09-10","days":23}]}You set the first-expiry-first-out issue order for released chemical batches. Given material {material} and its released batches {batches} with expiry dates, order them so the earliest expiry issues first. Respond ONLY with valid JSON. No explanation.{"material":"Solvent X","batches":[{"batch":"B-01","expiry_date":"2026-12-01","qty_kg":500},{"batch":"B-02","expiry_date":"2026-10-15","qty_kg":300}]}{"material":"Solvent X","issue_order":[{"batch":"B-02","expiry_date":"2026-10-15","qty_kg":300},{"batch":"B-01","expiry_date":"2026-12-01","qty_kg":500}]}- Start with one export of batches, dates, and quality status.
- Rank by soonest retest or expiry using a hard-coded window.
- Post the ranked list to one channel each morning.
- Add the FEFO issue order for one busy material.
- Flag held stock inside the expiry window.
- Check the list against a batch you know is close to expiry.
- Pull batch, stock, and quality data live from the ERP and WMS.
- Extend FEFO order across every material, not just one.
- Split the list by store or zone so each team sees its own.
- =+ Add a dispatch order so finished goods leave in first-expiry order too.
- Track how much near-expiry stock is issued versus written off.
- =+ Add a retest-due reminder that pings QC ahead of the date, for them to schedule.
Full Video Walkthrough Coming Soon
Watch the agent turn scattered batch dates into one first-expiry watchlist each morning.
Register to be notifiedEverything on this page is free to learn.
When you're ready to build — do it yourself or bring us in.
OTHER AGENTS IN LEASING & MARKETING
Cycle-Count Prioritiser and Variance Explainer
Hazardous Storage Compatibility Checker
Weighbridge Inward Reconciliation Agent
Frequently asked questions
This is 3 of 4 agents in Warehouse, Stores & Tank Farm. → · Explore all 15 departments →