๐ค Forecast stockouts and draft purchase orders with Gemini, Sheets, Slack and Gmail
โก 58 views ยท ๐ค CRM & Sales Operations
Description
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, emails the buyer for low stock, and writes status fields back to Sheets.
How it works
- Runs daily at 7:00 to start an inventory check.
- Reads the Inventory sheet from Google Sheets.
- Calculates daily sales velocity, days of cover, a lead-time-based reorder point, and a suggested order quantity, and skips items alerted in the last three days.
- Uses Google Gemini to generate a short, plain-language purchase recommendation for each item that needs attention.
- Routes items by status, sending stockout risks to Slack and drafting a supplier purchase-order email in Gmail.
- Emails the buyer for low-stock items using the generated recommendation text.
- Appends or updates the Inventory sheet in Google Sheets with the latest cover, reorder point, suggested quantity, and status.
Setup
- Connect credentials for Google Sheets, Google Gemini (PaLM) API, Gmail, and Slack.
- In Google Sheets, create/select an Inventory sheet with columns: SKU, Product, Stock On Hand, Weekly Sales, Lead Time Days, Unit Cost, Supplier, Supplier Email, and Last Alert.
- Select the correct spreadsheet and sheet in the Google Sheets nodes, choose the target Slack channel, and update the buyer email address in the Gmail low-stock email action.
๐ Nodes Used
Google Sheets, Slack, Gmail, Schedule Trigger, Basic LLM Chain, Google Gemini Chat Model
๐ฅ Import
Download workflow.json and import into n8n:
Workflow menu โ Import from File