Skip to main content

Extract purchase orders from Gmail using Gemini AI and save to Google Sheets

Workflow preview

Extract purchase orders from Gmail using Gemini AI and save to Google Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

Overview

πŸš€ 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

  1. βš™οΈ Configure Gmail & Google Sheets credentials in n8n
  2. 🎯 Adjust the subject filter to match your email rules
  3. πŸ”Œ Connect Gemini AI with your API credentials
  4. πŸ“‘ Create a Google Sheet with the required headers
  5. ▢️ 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