Back to Templates

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

Last update

Last update 3 months ago

Share


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