AI Demand Forecasting Workflow: Data In, SKU-Level Forecasts Out
AI demand forecasting combines your sales history with the signals a spreadsheet cannot hold — promotions, price changes, weather, holidays, marketing spend, web traffic — and produces a forecast per SKU per location per week with an error band. The workflow below runs that model on a schedule in n8n, and uses an AI agent only where it helps: explaining exceptions to planners and drafting the weekly forecast review.
Written by Max Zeshut
Founder at Agentmelt · Last updated Sep 11, 2026
The problem
Spreadsheet forecasts update monthly, miss the signals that actually move demand, and treat every SKU the same. Over-forecasting ties up cash in inventory; under-forecasting causes stockouts and expedited freight. Planners spend the week reconciling numbers instead of deciding.
What changes when it runs
Every Monday, planners open a forecast that is already refreshed with last week's actuals and next month's promotions, with the twenty SKUs whose forecast moved the most listed first and a sentence explaining why. Forecast error measured as WAPE drops — typically by a fifth to a third against the spreadsheet baseline — and the improvement shows up as lower safety stock and fewer expedites.
Trigger, then 8 steps
Trigger
Schedule Trigger (weekly, after the sales data closes)
Runs Sunday night after the ERP's weekly close. A second, lighter run on Wednesday refreshes the short-term horizon with the latest POS data for the top movers.
Pull sales history
PostgresUnits sold per SKU per location per week from the ERP or data warehouse (NetSuite, SAP, Dynamics, BigQuery, Snowflake), including returns and stockout flags so lost sales are not read as low demand.
Pull the signals
HTTP RequestPromotion calendar, price history, marketing spend, web sessions per product, weather for store regions, public holidays, and competitor price feeds where you have them. Each becomes a feature aligned to the same SKU-location-week grid.
Clean and align
CodeFills gaps, corrects stockout weeks (censored demand), maps promotions to weeks, and produces one wide table per SKU-location. Bad rows are logged, not silently dropped.
Run the forecasting model
HTTP RequestCalls the forecasting service — a gradient-boosted model (LightGBM) or a foundation time-series model (Chronos, TimesFM) hosted as an endpoint, or Nixtla's TimeGPT API for teams that do not want to host. Returns point forecasts and quantiles (p10/p50/p90) for the next 13 weeks.
Score last week's forecast
CodeCompares the forecast made a week ago to the actuals that just arrived and computes WAPE, bias and forecast-value-added by segment, so the workflow reports its own accuracy every run.
Write forecasts to the planning system
PostgresStores forecasts and quantiles by SKU-location-week, with a run id, in the table the planning tool or replenishment sheet reads.
Explain the exceptions
AI AgentFor SKUs where the forecast moved by more than a threshold or error was worst, the agent reads the feature changes (a new promotion, a price drop, a stockout) and writes a one-line explanation with the numbers. It never changes a forecast.
Publish the weekly review
SlackPosts the accuracy scorecard, the top exceptions with explanations, and a link to the planning sheet. Planners override in the sheet; overrides are stored and scored separately so you learn whether they help.
Data it touches
- Sales history by SKU-location-week (ERP / data warehouse)
- Promotion and price calendars
- Marketing spend and web analytics
- Weather (Open-Meteo, Visual Crossing) and public holidays
- Stockout / inventory position (to correct censored demand)
Guardrails
- The model forecasts; the agent explains. No language model touches a number that goes into replenishment.
- Every run scores the previous run's accuracy so drift is visible within a week.
- Planner overrides are captured and evaluated against the model, not silently overwritten.
- Forecasts carry quantiles, and safety stock uses them — a point forecast alone hides the uncertainty that drives stockouts.
What AI demand forecasting actually changes
Classical forecasting fits a curve to each product's history: moving averages, exponential smoothing, ARIMA. It is fast and understandable and it is what most planning tools still do by default. Its limit is that it only knows the past of one series. It cannot know that the promotion calendar has a 2-for-1 next month, that the price went up last week, that it will be 35°C in the stores that sell fans, or that a competitor is out of stock.
Machine-learning forecasting — gradient-boosted trees over engineered features, or more recently foundation time-series models pre-trained on millions of series — learns across all your SKUs at once and takes those external signals as inputs. The M5 forecasting competition (Walmart data, 42,840 series) is the best public benchmark: the winning approaches were all gradient-boosted models with rich feature sets, and they beat the best classical benchmarks by a wide margin at the aggregate level while being roughly comparable on very intermittent SKUs. That pattern holds in practice: the gain is largest on high-volume, promotion-driven items and smallest on slow, erratic ones.
The “AI” in the workflow above is therefore mostly the ML model. The language-model agent has one job — explaining — because that is the part planners actually struggle with. A forecast that moved 40% with no reason attached gets overridden; the same forecast with “promotion week 34, last comparable promo lifted units 3.1×” gets trusted.
How accurate is it, and how to measure that honestly
Use weighted absolute percentage error (WAPE, sometimes written MAD/mean ratio) rather than plain MAPE. MAPE explodes on low-volume weeks and rewards under-forecasting; WAPE weights each SKU by its volume so the number reflects the business impact. Report it by segment — top 20% of SKUs by revenue, promoted vs non-promoted, new vs established — because a single site-wide number hides where the model is weak.
Two more metrics belong on the scorecard. Bias (signed error) tells you whether you are systematically over- or under-forecasting, which is what drives inventory cost. Forecast value added compares the model to a naive baseline (last year same week, or a 13-week moving average) and to the planners' overrides; if a step in the process does not reduce error, remove it.
Realistic expectations: against a spreadsheet or naive baseline, well-implemented ML forecasting typically cuts WAPE by 20–35% on the fast-moving half of the range in the first quarter, less on the tail. The inventory effect follows: safety stock is set from forecast error, so a third less error is a third less safety stock at the same service level.
Worked example: 800 SKUs, 12 locations, weekly
A mid-size distributor with 800 SKUs across 12 branches has 9,600 SKU-locations and three years of weekly history — about 1.5 million rows, small by ML standards. The workflow assembles the feature table Sunday night (sales, price, promo flag, holiday, regional temperature, web sessions for the 200 products with product pages) and calls a LightGBM endpoint that was trained once on the history and is retrained monthly.
Output: 9,600 × 13 weeks of p10/p50/p90 forecasts written to the forecast table. The replenishment sheet reads p50 for the order quantity and the p90–p50 gap for safety stock. Monday's Slack post lists last week's WAPE (say 28% overall, 19% on the A items), the bias (+3%, slightly over-forecasting), and the 20 biggest movers with one line each. The planner spends an hour on those 20 instead of a day on 800.
Implementation sequence
Week one: get the history out and clean, and compute the naive baseline's WAPE — that number is what you have to beat and most teams have never measured it. Week two: connect the signals that exist (promotions and price are usually enough to start; weather and web traffic come later). Week three: run the model in shadow mode next to the current process and score both. Week four: switch replenishment for the A items to the model, keep the rest on the old process, and expand as the scorecard justifies.
Do not start with a custom model. A hosted API (TimeGPT, or a Chronos endpoint) with your history gives you 80% of the gain in days; train your own only when you have a specific reason — proprietary signals, unusual seasonality, or data-residency constraints.
Where it goes wrong
Stockouts read as zero demand. If a SKU was out of stock for three weeks, the history says nobody wanted it; the model learns that and forecasts low, which causes the next stockout. The clean step has to mark those weeks as censored, using the inventory position, and either impute or exclude them.
New products with no history. The model cannot forecast what it has never seen; use analog products (same category, same price band) for the first 8–12 weeks and let the actuals take over. The workflow needs an explicit new-product path or those SKUs get nonsense.
Planner overrides that are never scored. Overrides feel like control, but unscored they are just noise. Store them, score them against the model monthly, and show planners the result; most teams find overrides help on promotions and hurt everywhere else.
Tools in the stack
| Tool | Role in this workflow |
|---|---|
| n8n | Scheduling, data assembly, scoring, publishing |
| LightGBM / Chronos / TimesFM / TimeGPT | Forecasting model (self-hosted endpoint or API) |
| BigQuery / Snowflake / Postgres | Feature store and forecast table |
| Claude | Exception explanations and the weekly review draft |
| Google Sheets / planning tool | Where planners read and override |
Want this running without building it?
Automation workflow
$297/month
We set up, host and maintain this workflow on n8n and connect it to your tools. Setup included, cancel monthly, you keep the JSON.
Custom build
$5,000–9,000 one-time
Your systems, your rules, your edge cases. A one-off build on Claude and n8n, delivered with documentation and a walkthrough.
The subscription assumes a hosted model API (TimeGPT or similar) and up to 5,000 SKU-locations. Training a custom model on your history, integrating a planning system (o9, Kinaxis, Blue Yonder), or multi-echelon networks is a custom build.
Frequently asked questions
What data do we need to start AI demand forecasting?
Two years of weekly (or daily) sales by SKU and location is enough to beat a spreadsheet; three is better for seasonality. Add the promotion and price history, and the stockout or inventory record so lost sales can be corrected. Weather, holidays and web traffic come after the basics are working.
Do we have to train our own model?
No. Hosted time-series APIs (Nixtla TimeGPT) and open foundation models (Amazon Chronos, Google TimesFM) forecast well from your history without training. Train a custom model later if you have proprietary signals or unusual demand patterns.
How does this connect to our planning or ERP system?
The workflow writes forecasts and quantiles to a table or sheet your planning tool reads. For NetSuite, SAP, Dynamics and most planning tools there is an API or import format; that integration is part of the build.
What does the language model do in a forecasting workflow?
It explains, it does not forecast. When a SKU's forecast changes a lot or its error was high, the agent reads what changed in the inputs and writes one sentence a planner can act on. Keeping the model out of the numbers keeps the forecast auditable.
How much does AI demand forecasting cost?
As a subscription, $297/month covers the workflow, a hosted model API and up to 5,000 SKU-locations. Custom models, planning-system integration or multi-echelon networks are one-off builds from $5,000. Model API usage is billed by the provider on top.
Case study
AI Supply Chain Agent for a Mid-Market Manufacturer: 30% Fewer Stockouts
How a 500-employee consumer goods manufacturer used an AI supply chain agent to replace spreadsheet-based planning—reducing stockouts by 30% and excess inventory by 22%.
Calculator
Put your own numbers in
Estimate the cost of the current process and what this workflow changes.
The pillar
AI Supply Chain Agent
Optimize inventory, forecast demand, track shipments, and automate procurement with AI.