Predict Shopify stockouts with GPT-4o and email suppliers via Gmail
š 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_products and read_orders scopes; copy the Admin API Access Token
OpenAI ā connect your OpenAI API credential (GPT-4o)
Gmail ā connect Gmail OAuth2; replace supplier@example.com with your real supplier address
Google Sheets ā connect Google Sheets OAuth2; replace YOUR_REORDER_LOG_SHEET_ID with your sheet ID; create a sheet tab named Reorder 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
kumar@smartflowcraft.com
https://www.smartflowcraft.com/contact
More free templates https://www.smartflowcraft.com/n8n-templates
Related Templates
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
š° AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
ā” AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
š Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments