Forecast stockouts and draft purchase orders with Gemini, Sheets, Slack and Gmail
Ready for 3.0What 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).
- Get Inventory (Google Sheets): uses Google Sheets
- Forecast Days of Cover (Code): runs custom JavaScript code
- Write Purchase Recommendation (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model
- Route by Stock Status (Switch): routes items into 2 branches
- Alert Stockout Risk (Slack): uses Slack
- Email Low Stock Notice (Gmail): uses Gmail
- Draft Purchase Order (Gmail): work with draft
- Write Back Stock Status (Google Sheets): append or update
Services it uses
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)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Google Sheets
n8n-nodes-base.googleSheets - Code
n8n-nodes-base.code - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Switch
n8n-nodes-base.switch - Slack
n8n-nodes-base.slack - Gmail
n8n-nodes-base.gmail
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,…