Extract Purchase Orders from Gmail using Gemini AI and Save to Google Sheets

Go to Workflow
29 views
Built by SayOne Technologies SayOne Technologies
Created on June 05, 2026

Description

πŸš€ AI-Powered Email to Purchase Order Workflow

Automatically scan your inbox for new purchase order requests, extract order details using Gemini AI, and log them into Google Sheets β€” all without manual effort.

✨ Core Capabilities
⏱ Runs every minute to check unread emails
πŸ“§ Filters emails by subject
πŸ€– Uses Gemini AI to summarize email content & extract structured order details
πŸ“… Formats dates into ISO calendar weeks
πŸ“Š Adds product data from Google Sheets to complete order info
βœ… Appends final purchase order records into a Google Sheet (without replacing previous ones)

πŸ›  Setup Essentials
πŸ“© Gmail account for fetching unread emails
πŸ”‘ Google Gemini (PaLM) API credentials
πŸ“’ Google Sheet with predefined purchase order headers

πŸ“– Activation Guide
βš™οΈ Configure Gmail & Google Sheets credentials in n8n
🎯 Adjust the subject filter to match your email rules
πŸ”Œ Connect Gemini AI with your API credentials
πŸ“‘ Create a Google Sheet with the required headers
▢️ Activate the workflow and let it run in the background

🎨 Customizing the Workflow
πŸ” Email Filters β†’ Change keywords in the filter node to match your purchase order email subjects
🏷 Order Fields β†’ Modify Set and Append to Google Sheet nodes if your schema differs
✍️ AI Instructions β†’ Adjust the AI Agent’s prompt to fit your company’s email style or product details
⏲ Frequency β†’ Update the Cron node if you want to scan emails less often
πŸ“‚ Target Google Sheet β†’ Point to a different sheet or tab depending on your department or customer

Nodes Used (5)

AI Agent
@n8n/n8n-nodes-langchain.agent
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
Google Sheets
n8n-nodes-base.googleSheets