AI Inventory Reorder & Supplier Notification

n8n workflow that runs every morning and lets Claude AI analyze 15+ SKUs against reorder thresholds — then automatically drafts purchase orders, emails suppliers, logs to Google Sheets, and alerts the ops team on Slack. Zero manual procurement work.

n8nClaude AIOpenRouterGmail APIGoogle Sheets APISlackAI Decision-MakingWholesale Distribution

Overview

A scheduled n8n automation built for wholesale distributors — one of the highest-volume manual workflows in that industry. Every morning, the workflow loads current inventory levels for 15+ SKUs, sends the full dataset to Claude AI via OpenRouter, and receives back a structured JSON reorder analysis: which items are critical, what quantities to order, why each reorder is flagged, and estimated PO value per supplier. Claude doesn't just check thresholds — it reasons about each item's urgency (critical/high/medium) based on how far below the reorder point stock has fallen. The workflow then generates formatted purchase orders grouped by supplier, emails the first PO to the supplier via Gmail, logs the run to a Google Sheets audit trail, and posts a rich Slack alert to the ops channel with item count, critical count, total PO value, and supplier summary. Error handling routes failures to a Slack alert node so nothing disappears silently.

Problem

Wholesale distributors run on tight margins where stockouts are expensive and over-ordering ties up cash. Most small-to-mid distributors manage inventory in spreadsheets — someone checks stock manually each morning, decides what to reorder, emails suppliers, and logs it somewhere. At 15–50 SKUs across 3–8 suppliers, that's 30–60 minutes of daily manual procurement work that follows the same logic every time. The decision-making is repetitive, the data is available, and the downstream actions (email, log, notify) are fully automatable.

Approach

Scheduled webhook trigger loads 15 mock SKUs covering 5 categories (Safety, Packaging, Cleaning, Tools, Electrical) across 5 suppliers. A Code node formats the inventory as a structured markdown table and builds the full Claude API request with a precise system prompt and urgency scoring rules. An HTTP Request node posts to OpenRouter's chat completions endpoint (Claude 3.5 Sonnet), receiving a structured JSON response with the full reorder analysis. A Parse AI Response Code node extracts the reorder items, strips any markdown wrapping, handles JSON parse failures gracefully, and groups items by supplier for PO generation. An IF node branches on reorder count — if zero items need reorder, the false path returns a 'all stock nominal' summary. On the true path, a Format PO Code node builds professional purchase order text per supplier with SKU details, urgency flags, quantities, and line totals. Gmail sends the first supplier's PO. Google Sheets appends the run log. Slack posts the ops summary. Key pattern: HTTP Request nodes replace $json with their API response — all downstream nodes reference upstream data via $('Parse AI Response').item.json.field to avoid data loss across the pipeline.

Tech Stack

n8nClaude AI (claude-3.5-sonnet via OpenRouter)OpenRouter APIGmail OAuth2 APIGoogle Sheets APISlack Incoming WebhooksJavaScript (Code nodes)Conditional Logic (IF nodes)Scheduled Triggers

Results

Live end-to-end: Claude correctly identified 8 of 9 expected reorder items across 5 suppliers, flagged 6 as critical, and calculated $4,889.77 in total PO value — with per-item reasoning in the structured JSON response. Gmail PO delivered to SafeGuard Industrial. Google Sheets 'Wholesale PO Log' row appended with all 8 columns. Slack ops alert posted with full summary. Execution time: 20.4 seconds including Claude API call. Designed for wholesale distributors in safety equipment, industrial supplies, packaging, and tools — the exact Opticfy target niche in NYC.