What it does
Grow2.ai deploys a stockout-prediction pipeline that reads data from the data warehouse and predicts when each SKU will go out of stock. The model accounts for sales history, seasonality, and current inventory levels, and when the stockout probability exceeds the threshold — sends an alert to the working channels of the procurement team.
What the automation does
- Collects data from the data warehouse: order history, current stock levels by SKU, supply parameters (lead time, MOQ).
- Calculates a consumption forecast for each SKU over the horizon up to the next delivery date.
- Compares the projected consumption with the current stock level and calculates the probability of a stockout before replenishment arrives.
- Sends a structured alert to the communications channel: category, SKU, stock level, projected out-of-stock date, recommended order volume.
- Logs the alert event and the team's decision in order to gradually adjust thresholds and improve the model over time.
- In parallel, identifies SKUs with excess stock where purchasing should be reduced.
What the automation does NOT do
- Does not place orders with suppliers automatically — the final purchasing decision remains with the buyer.
- Does not replace ERP or WMS as the source of truth for inventory levels; the pipeline reads data but does not write to warehouse management systems.
- Does not guarantee 100% accuracy: rare events (viral sales, supplier disruptions, sudden demand shifts) require manual adjustment.
The primary goal is to shift the purchasing decision from 'the item is out of stock' to 'the item will run out in N days'. In the cited e-commerce case, this reduced the number of stockouts from 47 to 8 per quarter (-83%), helped recover £18,000 in lost sales, and cut excess inventory by £43,000.
The solution is suitable for e-commerce and retail with a catalog of hundreds of active SKUs and at least 6 months of sales history. The cleaner the data in the data warehouse, the more accurate the forecast; a basic setup with daily granularity produces a noticeable effect after just 2-3 order cycles.
How it works
The technical solution is a pipeline built on custom code (most commonly Python) that connects to the data warehouse, calculates a forecast for each SKU, and sends alerts to a communications channel. Deployment takes several weeks with data ready.
Main flow
- Daily extract.A scheduler (cron, Airflow, or a workflow engine) runs the pipeline in the morning before the procurement team's shift begins. The script queries the data warehouse and pulls sales for the relevant period, current stock levels, and the SKU reference.
- Feature engineering. Rolling sales averages per SKU, weekly and annual seasonality, trend, and turnover rate are calculated. The supplier's lead time — from the moment of ordering to goods arriving at the warehouse — is taken into account.
- Forecast model. Expected consumption is calculated for each SKU over the horizon to the next possible delivery. The baseline version uses statistical methods (exponential smoothing, Prophet); the advanced version uses gradient boosting with external factors (promotions, holidays).
- Stockout score. Based on the forecast and current stock, the probability of an out-of-stock before the next delivery arrives and the recommended order volume are calculated.
- Filter and prioritization. SKUs with a high stockout probability and significant margin or turnover are selected for the alert. The rest are logged without notifications to avoid generating noise.
- Notification. The alert is sent to the communications channel with a list of SKUs, reasons, a recommendation, and a deadline for action.
- Feedback loop. The buyer's decisions (ordered / deferred / ignored) are logged and used for threshold calibration and model recalibration.
Solution components
Layer | What it does | Implementation example |
|---|---|---|
Data source | Sales history, stock levels, SKU reference | Data warehouse / BI |
Pipeline | Extract, feature engineering, forecast | Python + scheduler |
Forecast storage | Saving results for BI and history | Table in the same warehouse |
Notification | Sending alerts to the team | Communications channel via API |
Monitoring | Forecast quality, drift, pipeline errors | Logs + simple BI dashboard |
Implementation steps
- Data audit in the data warehouse: completeness of sales history, stock synchronization, SKU reference.
- Development of a baseline model on a sample of SKUs (A-category by turnover) with back-validation on historical data.
- Pipeline and scheduler setup, extracting parameters (thresholds, horizon, lead time) into config.
- Integration with the communications channel and agreement on the alert format with the procurement team.
- A 2-3 week pilot: comparing forecasts with reality, threshold calibration, feedback from buyers.
- Scaling to the full catalog and establishing a feedback loop for continuous improvement.
The model does not replace planning — it gives the team advance visibility into shortage risk and data for decision-making. Forecast accuracy depends on the quality of input data: with dirty stock levels or a short history, the effect will be lower.
Prerequisites
To launch stockout prediction, Grow2.ai requires prepared data and team readiness to work with forecasts rather than post-factum reports.
Data and access
- Data warehouse or BI layer with at least 6 months of sales history (preferably 12+ for annual seasonality).
- Current stock levels by SKU, synchronized with the warehouse or ERP at least once per day.
- SKU directory with categories, suppliers, and lead time.
- Procurement parameters: minimum order quantities, delivery lead times, safety stock by category.
- Communications channel (Slack, email, or Telegram) for sending alerts with API access.
Team readiness
- A procurement process owner — makes decisions on alerts and provides feedback to the model.
- A tech lead or analyst for pipeline setup and warehouse operations.
- An agreed alert format and response SLA (for example: alert received in the morning — decision by end of day).
- A policy for handling false positive / false negative cases: who updates thresholds and how.
Timeline
For a straightforward case with clean data, implementation takes 2-4 weeks:
- Week 1: data audit, baseline model, retro-validation.
- Week 2: pipeline, scheduler, communications integration.
- Weeks 3-4: pilot, threshold calibration, catalog scaling.
If the sales history is fragmented, stock levels are out of sync, or tens of thousands of SKUs with a long tail need to be covered — timelines grow to 6-10 weeks and the solution moves into the medium category.
Pain points
- Poor Forecasting (cashflow/sales/stock)
- Errors in Manual Operations
FAQ
How long does implementation take?
For a catalog of up to several thousand SKUs with clean data in a data warehouse — 2-4 weeks: the first week is data audit and baseline model, the second is pipeline setup and integration with the communications channel, the third and fourth are pilot and threshold calibration. With fragmented sales history or tens of thousands of SKUs, the timeline grows to 6-10 weeks and the solution moves into the medium category.
What if we don't have a full data warehouse?
The solution works without a classic warehouse too, provided there is a BI layer or a regular export from ERP/WMS in structured form. The minimum is tables with sales history, stock levels, and a SKU reference, updated once per day. If data lives only in CSV exports, the first step is setting up sync to Postgres or a similar storage, and the pipeline reads from there.
What are the risks and what can break?
The main risk is false negatives: the model missed a shortage, the item ran out. The second risk is noise: too many alerts, the team stops reacting. Both are resolved by threshold calibration during the pilot. Technically, the pipeline breaks when the warehouse schema changes, stock levels go out of sync, or access to the communications API is lost — this is caught by monitoring and logs.
Does the solution work in our industry?
The solution is designed for e-commerce and retail with physical inventory and recurring sales. For B2B retail with long lead times and large orders, the solution is applicable with calibration for specific conditions. For markets with unique goods and no sales history (made-to-order items, antiques), forecasting as a pattern is not applicable — other approaches work there.
How accurate is the forecast?
Accuracy depends on data quality and the regularity of sales per SKU. For A-category items with predictable demand, the forecast is significantly more accurate than for long-tail items with infrequent sales. For rare SKUs, Grow2.ai uses wide safety stock thresholds instead of narrow forecast values. Accuracy is measured during the pilot and recalculated after every 2-3 months of operation.
Want this in your business?
Book a free audit — we'll show how this automation will work for you.