đź›» AI agent for logistics order processing with GPT-4o, Gmail and Google Sheet
Needs changesWhat this workflow does
This AI workflow has 7 nodes and runs on Gmail events. Along the way it connects OpenAI Chat Model, Google Sheets and Gmail.
How it runs
Trigger: On Gmail events.
- Is PO? (If): checks a condition and branches into true / false
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; output parser: Structured Output Parser
- Format Purchase Order Lines (Code): runs custom JavaScript code
- Store Purchase Order Lines (Google Sheets): append
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + Gmail templates (1,623)
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent (v1.8): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
- Also check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll).
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2025 — 19% of 2025 templates need changes for 3.0. See how template age affects 3.0 readiness →
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (7)
- AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Google Sheets
n8n-nodes-base.googleSheets - Gmail Trigger
n8n-nodes-base.gmailTrigger - If
n8n-nodes-base.if - Code
n8n-nodes-base.code
From the author
Tags: Supply Chain, Logistics, AI Agents Context Hey! I’m Samir, a Supply Chain Data Scientist from Paris, and the founder of LogiGreen Consulting. We design tools to help companies improve their logistics processes using data analytics, AI, and automation—to…