Send low-stock purchase orders with Google Sheets, Slack, and OpenAI
Ready for 3.0What this workflow does
This AI workflow has 16 nodes and runs manually, when you click “Execute workflow” (plus 2 other triggers). Along the way it connects OpenAI Chat Model, Slack and Google Sheets.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 2 other triggers).
- Get Active Products (Google Sheets): uses Google Sheets
- Slack: uses Slack
- Process One Product at a Time (Loop Over Items (Split in Batches)): loops over the items in batches
- Slack: uses Slack
- Calculate Stock Level & Urgency (Code): runs custom JavaScript code
- Update Last Checked Date (Google Sheets): update
- Needs Reorder? (If): checks a condition and branches into true / false
- Already Reordered Today? (If): checks a condition and branches into true / false
- Generate PO Message (AI Agent): runs an AI agent, with model: OpenAI — PO Model
- Slack: uses Slack
…plus 2 more steps. See the full node list below.
Services it uses
Other OpenAI + Google Sheets templates (2,011) · Other Google Sheets + Slack templates (1,314) · Other OpenAI + Slack templates (979)
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.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (10)
- OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Error Trigger
n8n-nodes-base.errorTrigger - Slack
n8n-nodes-base.slack - AI Agent
@n8n/n8n-nodes-langchain.agent - Google Sheets
n8n-nodes-base.googleSheets - Manual Trigger
n8n-nodes-base.manualTrigger - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Code
n8n-nodes-base.code - If
n8n-nodes-base.if
From the author
Quick overview This workflow checks product stock levels from a Google Sheets inventory, calculates urgency and reorder needs, uses OpenAI to draft a purchase order message, posts reorder notifications to Slack, and updates both the inventory sheet and a…