π€ Predict Shopify stockouts with GPT-4o and email suppliers via Gmail
β‘ 98 views Β· π€ CRM & Sales Operations
Description
π How it works
Runs daily at 06:00 UTC, pulls every Shopify product variantβs stock level,
calculates real sales velocity from the last 7 days of orders, then uses
GPT-4o to predict stockout dates and decide whether to reorder β automatically.
- ποΈ Fetches all Shopify product variants and current inventory quantities
- π¦ Pulls the last 7 days of orders and computes units sold per variant
- β‘ Calculates sales velocity (units/day) and estimated days until stockout
- π€ AI Agent classifies risk: critical / high / medium / low and recommends reorder quantity (30-day demand + 20% safety buffer)
- π§ Sends a formatted reorder request email to your supplier for high-risk variants
- π Logs every decision (reordered or skipped) to Google Sheets for inventory tracking
π οΈ Set up steps
Estimated setup time: ~15 minutes
- Shopify β create a Custom App in your Shopify Admin β Apps β Develop Apps; enable
read_productsandread_ordersscopes; copy the Admin API Access Token - OpenAI β connect your OpenAI API credential (GPT-4o)
- Gmail β connect Gmail OAuth2; replace
supplier@example.comwith your real supplier address - Google Sheets β connect Google Sheets OAuth2; replace
YOUR_REORDER_LOG_SHEET_IDwith your sheet ID; create a sheet tab namedReorder Log - Follow the sticky notes inside the workflow for per-node guidance
π Prerequisites
- Shopify store (any plan with Admin API access)
- OpenAI API key
- Gmail account for supplier notifications
- Google Sheets for reorder log
Custom Workflow Request with Personal Dashboard
https://www.smartflowcraft.com/contact
More free templates
https://www.smartflowcraft.com/n8n-templates
π Nodes Used
Google Sheets, Shopify, Gmail, Schedule Trigger, AI Agent, OpenAI Chat Model
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File