Skip to main content

Monitor D2C inventory, forecast demand with GPT-4o, and send POs via Google Sheets and Gmail

Workflow preview

Workflow preview
100%
Monitor D2C inventory, forecast demand with GPT-4o, and send POs via Google Sheets and Gmail preview
Open on n8n.io

1. Workflow Overview

Description Stop finding out you're out of stock after a customer already tried to buy. This workflow monitors your entire product inventory daily, calculates how fast each SKU is selling, and a...

Best for

  • CRM automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.googlesheets, n8n-nodes-base.if, n8n-nodes-base.code, n8n-nodes-base.scheduletrigger, n8n-nodes-base.httprequest, n8n-nodes-base.gmail, n8n-nodes-base.filter, @n8n/n8n-nodes-langchain.openai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Rahul Joshi.

Original n8n.io source

1.1 Workflow description

Title
Monitor D2C inventory, forecast demand with GPT-4o, and send POs via Google Sheets and Gmail
Workflow name
Monitor D2C inventory, forecast demand with GPT-4o, and send POs via Google Sheets and Gmail

๐Ÿ“Š Description

Stop finding out you're out of stock after a customer already tried to buy. This workflow monitors your entire product inventory daily, calculates how fast each SKU is selling, and automatically raises purchase orders to your supplier before you hit zero โ€” all without you opening a spreadsheet. Built for D2C brands and ops teams who are tired of manual stock checks, surprise stockouts, and dead inventory eating up cash. The AI layer adds demand forecasting and tells you exactly what to bundle, discount, or kill every week.

What This Workflow Does

โฐ Triggers every morning at 8AM to fetch fresh product and stock data automatically ๐Ÿงฎ Calculates sales velocity per SKU using a 7-day rolling average from your Sales Log ๐Ÿšฆ Flags every SKU as ๐Ÿ”ด Stockout Risk, ๐ŸŸก Dead Stock, or ๐ŸŸข Healthy and updates Google Sheets ๐Ÿ“ง Sends instant email alerts when a SKU is about to run out or has been sitting unsold ๐Ÿ“‹ Automatically calculates reorder quantity using lead time and buffer stock formula ๐Ÿญ Emails a formatted Purchase Order directly to your supplier โ€” no manual drafting ๐Ÿค– Sends all dead/slow SKUs to GPT-4o every Sunday for actionable recommendations โ€” bundle, discount, or kill ๐Ÿ“Š Delivers a 30-day demand forecast every Sunday based on 90 days of sales history and seasonal context

Key Benefits

โœ… Never get caught off guard by a stockout again โœ… POs go to suppliers automatically โ€” zero manual work โœ… AI tells you what to do with slow-moving inventory every week โœ… 30-day demand forecast keeps you buying ahead, not reacting โœ… Everything logged in Google Sheets โ€” full visibility at all times โœ… Works with any product catalog โ€” just plug in your Sheet

How It Works

The workflow runs in 5 stages, each timed 5 minutes apart every morning so data flows cleanly from one stage to the next.

Stage 1 โ€” Data Sync (8:00 AM daily) Pulls product data from DummyJSON API (swap with your Shopify or WooCommerce endpoint when going live), simulates daily sales per SKU, and writes everything into your Google Sheets inventory log.

Stage 2 โ€” Stock Health Check (8:05 AM daily) Reads the last 7 days of sales, calculates average daily velocity per SKU, and assigns a flag. Anything running out in under 14 days gets flagged ๐Ÿ”ด. Anything with zero sales in 7 days gets flagged ๐ŸŸก. Everything else is ๐ŸŸข. Flags are written back to your sheet and email alerts fire immediately for anything critical.

Stage 3 โ€” Auto Reorder Engine (8:10 AM daily) Picks up every ๐Ÿ”ด SKU and runs it through a reorder formula โ€” (avg daily sales ร— lead time) + 7-day buffer stock. A properly formatted Purchase Order email goes straight to your supplier. Every PO is logged in the PO Tracker sheet with status, quantity, and date.

Stage 4 โ€” Dead Inventory AI Digest (Every Sunday 9:00 AM) All ๐ŸŸก SKUs get sent to GPT-4o with your stock levels and sales data. The AI comes back with a recommendation for each one โ€” bundle it, run a discount (with exact percentage), or kill the SKU entirely. You get a clean email grouped by urgency: high, medium, low.

Stage 5 โ€” 30-Day Demand Forecast (Every Sunday 9:30 AM) Aggregates the last 90 days of sales per SKU and sends it to GPT-4o with the current month for seasonality context. GPT predicts how many units you'll need in the next 30 days, calculates stock gap, and tells you what to reorder now, stock up on, or reduce. Delivered as a clean email report every Sunday morning.

Features

  • Cron-based daily and weekly automation triggers
  • Sales velocity calculation with 7-day and 90-day rolling windows
  • 3-tier SKU health flagging system (๐Ÿ”ด ๐ŸŸก ๐ŸŸข)
  • Reorder quantity formula with lead time + buffer stock logic
  • Automated PO generation and supplier email dispatch
  • GPT-4o dead inventory strategist with discount recommendations
  • GPT-4o 30-day demand forecasting with seasonality awareness
  • Full Google Sheets logging across Inventory Master, Sales Log, and PO Tracker
  • Gmail-based alerting and weekly digest reports
  • Modular 5-stage architecture โ€” easy to swap data sources

Requirements

  • OpenAI API key (GPT-4o access)
  • Google Sheets OAuth2 connection
  • Gmail OAuth2 connection
  • A configured Google Sheet with 3 sheets: Inventory Master, Sales Log, PO Tracker
  • DummyJSON API โ€” free, no key needed (replace with Shopify/WooCommerce for production)

Setup Steps

  • Copy the Google Sheet template and grab your Sheet ID from the URL
  • Paste the Sheet ID into all Google Sheets nodes (there are 8 of them)
  • Connect your Google Sheets OAuth2 credentials
  • Connect your Gmail OAuth2 credentials
  • Add your OpenAI API key to both GPT-4o nodes
  • Replace the email address in all Gmail nodes with your own
  • Activate all triggers โ€” the system runs itself from here

Target Audience

๐Ÿ›’ D2C brand owners managing inventory without a dedicated ops team ๐Ÿ“ฆ E-commerce operators tired of manual stock checks and surprise stockouts ๐Ÿ’ผ Operations managers who want a real-time view of inventory health ๐Ÿค– Automation agencies building supply chain solutions for e-commerce clients

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Read Inventory Master

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.2

Block 2 - Read Sales Log

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.2

Block 3 - IF Dead or Overstock

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 4 - IF Stockout Risk

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 5 - Read Inventory Master1

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.2

Block 6 - Read Inventory Master2

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.2

Block 7 - Read sales log

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.2

Block 8 - Read Inventory Master3

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.2

Block 9 - Build Forecast Prompt

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Build Forecast Email

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - ๐Ÿ• Daily 8AM Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.3

Block 12 - Fetch Products (DummyJSON)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 13 - Simulate Daily Sales

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - Log to Sales Log

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 15 - Write to Inventory Master

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 16 - Daily 8:05AM Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.1

Block 17 - Calculate Velocity & Flags

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Alert โ€” Stockout Risk

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 19 - Alert โ€” Dead Stock

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 20 - Update Flags (Stockout)

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.2

Block 21 - Update Flags (Dead Stock)

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.2

Block 22 - Daily 8:10AM Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.1

Block 23 - Filter Stockout SKUs

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 24 - Calculate Reorder Quantity

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Showing the first 24 of 47 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Monitor D2C inventory, forecast demand with GPT-4o, and send POs via Google Sheets and Gmail
Complexity advanced
Nodes 47
Categories CRM, AI Summarization
Author Rahul Joshi
Published 09 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13961/13961.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Monitor D2C inventory, forecast demand with GPT-4o, and send POs via Google Sheets and Gmail do?

Description Stop finding out you're out of stock after a customer already tried to buy. This workflow monitors your entire product inventory daily, calculates how fast each SKU is selling, and a...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your CRM, AI Summarization use case.