Reorder inventory and track supplier confirmations with Sheets, Gmail and GPT-4 Mini
Ready for 3.0What this workflow does
This AI workflow has 57 nodes and runs on a schedule (cron 0 7 * * 1-5) (plus 2 other triggers). Along the way it connects Google Sheets, Gmail and OpenAI Chat Model.
How it runs
Trigger: On a schedule (cron 0 7 * * 1-5) (plus 2 other triggers).
- Set Reorder Policy (Edit Fields (Set)): sets 21 fields: sheet_id, buyer_email, ops_email…
- Set Confirmation Rules (Edit Fields (Set)): sets 6 fields: sheet_id, buyer_email, price_tolerance_pct…
- Alert on Workflow Failure (Gmail): uses Gmail
- Read Products from Sheets (Google Sheets): uses Google Sheets
- Read Open Orders for Reply (Google Sheets): uses Google Sheets
- Aggregate: combines items into one
- Aggregate: combines items into one
- Read Stockouts from Sheets (Google Sheets): uses Google Sheets
- Strip the Quoted Reply (Code): runs custom JavaScript code
- Aggregate: combines items into one
…plus 39 more steps. See the full node list below.
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.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (When a Supplier Replies).
Nodes used (15)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - Google Sheets
n8n-nodes-base.googleSheets - Aggregate
n8n-nodes-base.aggregate - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail - No Operation, do nothing
n8n-nodes-base.noOp - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - If
n8n-nodes-base.if - Split Out
n8n-nodes-base.splitOut - Gmail Trigger
n8n-nodes-base.gmailTrigger - Information Extractor
@n8n/n8n-nodes-langchain.informationExtractor - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Error Trigger
n8n-nodes-base.errorTrigger
From the author
Quick Overview This workflow audits inventory and open purchase orders in Google Sheets, calculates reorder quantities based on measured demand and lead times, and emails purchase orders via Gmail with optional buyer approval; it also uses OpenAI to extract…