Templates / Forecast stockouts and draft purchase orders with Gemini, Sheets, Slack and Gmail

Forecast stockouts and draft purchase orders with Gemini, Sheets, Slack and Gmail

Ready for 3.0

by Oka Hironobu ✓ · 40 views · created 2026-08-11 · CRM, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 10 nodes and runs on a schedule (every day at 07:00). Along the way it connects Google Sheets, Google Gemini Chat Model, Slack and Gmail.

How it runs

Trigger: On a schedule (every day at 07:00).

  1. Get Inventory (Google Sheets): uses Google Sheets
  2. Forecast Days of Cover (Code): runs custom JavaScript code
  3. Write Purchase Recommendation (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model
  4. Route by Stock Status (Switch): routes items into 2 branches
  5. Alert Stockout Risk (Slack): uses Slack
  6. Email Low Stock Notice (Gmail): uses Gmail
  7. Draft Purchase Order (Gmail): work with draft
  8. Write Back Stock Status (Google Sheets): append or update

Services it uses

Google SheetsGoogle Gemini Chat ModelSlackGmail

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (8)

From the author

Quick Overview This workflow runs every morning to read inventory from Google Sheets, calculate days of cover and reorder suggestions, and use Google Gemini to draft a purchase recommendation. It alerts Slack and creates Gmail drafts for stockout risks,…

Excerpt from Oka Hironobu's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.