GenAiHub

Last checked 24 November 2026 — responded normally.

Draft weekly purchase orders from stock and sales with OpenAI and Gmail

Quick overview

Live
Open / InstallLast updated November 24, 2026

Description

Quick overview This workflow runs every Monday morning to calculate weekly reorder quantities from n8n Data Tables stock and 28‑day sales, uses OpenAI to generate and verify Japanese purchase reasons, emails the plan for Gmail approval, and creates per-supplier Gmail draft purchase orders while logging outcomes. How it works Runs every Monday at 09:00 on a schedule. Loads reorder settings, then reads stock/open-order/lead-time data from the n8n Data Table reorder_stock and 28-day sales totals from reorder_sales. Calculates which SKUs need reordering based on sales velocity, lead time, safety days, current stock plus open orders, and rounds quantities up to minimum order quantities. If there are items to order, uses OpenAI to write a one-line Japanese reason and risk note per SKU and then performs a second OpenAI pass to verify and correct any numbers against the calculated plan. Sends the plan to the buyer via Gmail with approve/decline buttons and waits up to three days for a response. If approved, groups lines by supplier, creates one Gmail draft purchase order email per supplier, and logs the drafts to the reorder_log Data Table; if declined, logs the declined plan to reorder_log. Setup Create three n8n Data Tables named reorder_stock, reorder_sales, and reorder_log, and ensure they contain the columns referenced by the workflow (SKUs, stock/on-order/lead-time/MOQ, sales in last 28 days, and log fields). Populate reorder_stock and reorder_sales with your real inventory and sales data (or run the manual “Load Sample Data” branch once to insert sample rows). Add a Gmail OAuth2 credential, replace REPLACE_WITH_BUYER_EMAIL and the company name in Set Reorder Settings, and add each supplier's order email to the supplier_email column of reorder_stock. Add an OpenAI credential and confirm the selected chat model is available in your account. Adjust safety days, order cycle days, and the Monday 09:00 schedule to match your purchasing cadence. An n8n automation workflow template by Yuji.

Community Metrics

Views
0
Avg Rating
N/A
Ratings
0
Likes
0
Comments
—

Author

Yuji

Platform

web

Pricing model

free

Categories

  • Automation
  • AI

Tags

  • n8n
  • workflow
  • gmail
  • code
  • basic-llm-chain
  • openai-chat-model
  • structured-output-parser

Capabilities

  • 5 nodes

Information

TypeWorkflow
Sourcen8n
AddedNovember 17, 2026

Comments

?

Others in the same category, ranked by how often they are opened.