Pull Inventory -> Match Demand -> Rank Risk -> Flag Stale -> Send List

Critical Spares Stockout-Risk Agent

The agent reads your CMMS spares inventory, consumption history, and open work orders, then ranks the critical parts that are one failure away from a stockout with a long replacement lead time. It also surfaces reorder points that no longer match usage and spares tied to equipment you already retired. You get a short expedite list, a stale-level list, and a dead-stock list every morning.

The Problem

The pump failed on a Tuesday. The spare had a 16-week lead time and none on the shelf.

A seal pump trips at 2am and the standby is already down for overhaul. Stores shows zero on hand for the impeller, and the vendor quotes 16 weeks. The reorder point was set five years ago when the line ran half the batches it runs now, so nothing ever triggered a purchase. The batch sits, and the first anyone hears of the gap is the breakdown itself.

What Changes

See the stockout before the breakdown does.

The agent joins inventory on hand against open work-order demand, recent consumption, and vendor lead times, then flags every critical spare where one more issue empties the shelf before a replacement can arrive. It checks reorder points against actual usage and calls out the ones that drifted. It lists spares still carried for equipment that was decommissioned, so you can free the cash and the shelf space.

Humans stay in control: the agent ranks and drafts the expedite list, and your planner decides what to order, expedite, or write off.

HOW THE AGENT WORKS

TRIGGERLLMAPIDECISIONACTIONWAIT
TRIGGERNightly Inventory Export ArrivesThe overnight CMMS export lands and starts the run before the shift begins.
APILoad Spares and Work OrdersPulls inventory on hand, consumption, reorder points, open demand, and lead times.
LLMScore Each Spare RiskRanks each critical spare on how close it is to a stockout against its lead time.
DECISIONAny Spare At Risk?
LLMDraft Expedite and Dead-Stock ListsWrites plain reasons for each at-risk spare, stale reorder point, and obsolete part.
ACTIONSend Digest to PlannerDelivers the ranked list to the planner by email or chat for a decision.
The agent does not raise purchase orders or expedite anything. Your maintenance planner does. The agent removes the manual cross-checking of stock, demand, and lead times that never gets done until something breaks.

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.

Your CMMSSpares, consumption, work orders
The AgentWorkflow engine + LLM
Your Planner's InboxRanked risk digest

WHAT YOUR TEAM PROVIDES ONCE

  • CMMS inventory export - a daily snapshot of spares on hand and reorder points
  • Consumption history - how often each part has been issued
  • Open work-order demand - parts already committed to scheduled jobs
  • Vendor lead times - how long a replacement takes to arrive
  • Equipment criticality - which assets stop production when they fail
What happens day-to-day: every morning the planner opens one email with a short list of spares to expedite, reorder points that look wrong, and dead stock to review. Most days it is a handful of lines, not a spreadsheet to comb.

For the IT person or technical lead who needs to scope the integration.

INQUIRY SOURCES

CMMS inventory and consumption export (CSV or API)
Open work-order demand from the maintenance system
A criticality and lead-time reference table

WORKFLOW ENGINE (N8N)

Scheduled nightly run
Pull inventory and work orders
Join lead times and criticality
Score stockout risk per spare
Filter to items above threshold
Write plain-language reasons
Deliver digest via notification

CONNECTS TO

CMMS (SAP PM / Maximo / Fiix)Read: inventory, consumption, work orders, reorder points. Write: none
Procurement (SAP Ariba / Coupa)Read: vendor lead times. Write: none
Notification (Email / Microsoft Teams / Slack)Read: none. Write: daily risk digest
Spreadsheet or BI (Excel / Power BI)Read: criticality reference. Write: risk log
WITHOUT PMS API

Without API access, someone drops a nightly CSV export into a watched folder and the agent runs from that. It still ranks risk and sends the digest, just from the file you provide.

WITH PMS API

With API access to the CMMS, the agent pulls a fresh inventory and demand snapshot every night, matches it to live lead times, and posts the digest straight to the planner's channel. No manual export, no stale file. Best experience.

For the person who wants to build this agent step by step. Each node below maps to an n8n workflow node.

TRIGGERNode 1
Schedule Trigger - fires the nightly run
Cron node set to run at 05:00 each weekday, before the shift starts.
Output: A run signal with the current date.
APINode 2
HTTP Request - pull the CMMS export
GET the inventory, consumption, and open work-order endpoints, or read the latest CSV from the watched folder.
Output: Raw tables of spares on hand, issues, reorder points, and demand.
APINode 3
Merge - join lead times and criticality
Match each part number to its vendor lead time and the criticality of the equipment it serves.
Output: One row per spare with stock, demand, lead time, and criticality.
LLMNode 4
LLM - score stockout risk
Send the joined rows to the model with the scoring prompt and parse the JSON reply.
Output: At-risk, stale-reorder, and dead-stock groupings with reasons.
You are a maintenance stores analyst. For each spare below, decide whether it is at risk of a stockout before a replacement can arrive, and whether its reorder point looks stale. Input: {spares_json}. A spare is at risk when on_hand minus open_demand is at or below the quantity likely to be consumed over the vendor lead_time_weeks, and equipment_criticality is high. A reorder point is stale when it was set more than {stale_months} months ago or no longer matches recent consumption. Respond ONLY with valid JSON. No explanation.
INPUT
{"stale_months":24,"spares":[{"part":"IMP-204","desc":"Impeller, feed pump","on_hand":0,"open_demand":1,"weekly_use":0.3,"lead_time_weeks":16,"equipment_criticality":"high","reorder_point":2,"reorder_set":"2019-03-01"}]}
OUTPUT
{"at_risk":[{"part":"IMP-204","reason":"Zero on hand against one open work-order demand, 16-week lead time on a high-criticality pump","action":"expedite"}],"stale_reorder":[{"part":"IMP-204","reason":"Reorder point set in 2019, well past the 24-month window"}],"dead_stock":[]}
DECISIONNode 5
IF - keep only at-risk items
Filter to spares where projected cover is below lead time and criticality is high.
Output: The shortlist plus the stale and dead-stock groupings.
ACTIONNode 6
Send Email - deliver the digest
Format the three lists into a plain-text digest and email the planner.
Output: A sent daily digest ready for the planner to action.
MVP vs Advanced — Where To Start
MVP — START HERE
  • Export one nightly CSV from the CMMS with part number, on hand, reorder point, and consumption.
  • Add a small reference sheet mapping each part to equipment criticality and vendor lead time.
  • Build the schedule trigger and the file or API read in n8n.
  • Drop in the LLM node with the scoring prompt and test it on last week's data.
  • Filter to at-risk items and format a plain-text digest.
  • Send the digest to the planner by email and check the first week's flags by hand.
ADVANCED — ADD LATER
  • =+ Pull live lead times from procurement instead of a static sheet.
  • =+ Add seasonality to consumption so risk reflects the busy season.
  • =+ Post to Teams or Slack with an acknowledge button that logs who actioned each item.
  • =+ Track flagged versus actioned spares to measure avoided stockouts.
  • =+ Feed dead-stock findings into a quarterly write-off review.
  • =+ Learn per-vendor lead-time reliability and widen the buffer for the unreliable ones.

Full Video Walkthrough Coming Soon

A two-minute look at how the agent turns a nightly CMMS export into a ranked spares risk list.

Register to be notified

Everything 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

Ranks the maintenance to do in the next changeover window by risk

Frequently asked questions

Critical Spares Stockout-Risk Agent is an AI agent that flags critical spares one failure from a stockout, plus stale levels and dead stock.
The pump failed on a Tuesday. The spare had a 16-week lead time and none on the shelf. The Critical Spares Stockout-Risk Agent addresses this: flags critical spares one failure from a stockout, plus stale levels and dead stock.
No. Your team stays in control. The agent does not raise purchase orders or expedite anything. Your maintenance planner does. The agent removes the manual cross-checking of stock, demand, and lead times that never gets done until something breaks.