Skip to main content

Forecast inventory and auto-generate reorders with Google Sheets, GPT-4o mini and Slack

Workflow preview

Workflow preview
100%
Forecast inventory and auto-generate reorders with Google Sheets, GPT-4o mini and Slack preview
Open on n8n.io

1. Workflow Overview

How it works Fetches sales history and current inventory from Google Sheets in parallel, then calculates days of stock remaining, average daily sales velocity, and projected stockout dates for ever...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.code, n8n-nodes-base.set, n8n-nodes-base.googlesheets, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.if

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Redowan Ahmed Farhan.

Original n8n.io source

1.1 Workflow description

Title
Forecast inventory and auto-generate reorders with Google Sheets, GPT-4o mini and Slack
Workflow name
Forecast inventory and auto-generate reorders with Google Sheets, GPT-4o mini and Slack

How it works

Fetches sales history and current inventory from Google Sheets in parallel, then calculates days of stock remaining, average daily sales velocity, and projected stockout dates for every product An AI agent (GPT-4o mini) analyzes the snapshot and generates a structured forecast report covering critical alerts, reorder priorities, demand trends, and supply chain risk flags Routes critical stock alerts to Slack instantly, generates purchase orders for all flagged items, and logs the full forecast summary back to Google Sheets

Set up steps

Connect Google Sheets OAuth2, add your spreadsheet ID in Set Forecast Configuration, and ensure your sheet has Sales_History, Current_Inventory, and Forcast_Analysis tabs (5 min) Add your OpenAI API key and connect your Slack workspace, then point the alert node to your preferred channel (5 min)

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 - When clicking 'Execute workflow'

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Combine Forecast and AI Output

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

Block 3 - Set Forecast Configuration

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - Fetch Sales History

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

Block 5 - Fetch Current Inventory

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

Block 6 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 7 - Build Forecast Dataset

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

Block 8 - Demand Forecast Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 9 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 10 - Critical Stock Exists?

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

Block 11 - Send a message

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 12 - Write Forecast to Sheet

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

Block 13 - Generate Purchase Orders

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

Block 14 - Log Forecast Completion

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 15 - Main Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Section 1: Trigger & Data Intake

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Section 2: AI Forecasting

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Section 3: Alerts & Purchase Orders

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Section 4: Output & Logging

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Forecast inventory and auto-generate reorders with Google Sheets, GPT-4o mini and Slack
Complexity advanced
Nodes 19
Categories CRM, AI Summarization
Author Redowan Ahmed Farhan
Published 14 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15706/15706.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 Forecast inventory and auto-generate reorders with Google Sheets, GPT-4o mini and Slack do?

How it works Fetches sales history and current inventory from Google Sheets in parallel, then calculates days of stock remaining, average daily sales velocity, and projected stockout dates for ever...

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.