Skip to main content

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

Workflow preview

Workflow preview
100%
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.

1. Workflow 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 m...

Best for

  • Document Extraction automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmail, n8n-nodes-base.cron, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.filter

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by SayOne Technologies.

Original n8n.io source

1.1 Workflow description

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

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

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Get many messages

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 2 - Cron

Type / Role
n8n-nodes-base.cron - cron
Config choices
Version 1

Block 3 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 4 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 5 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Set final output keys

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 9 - Filter emails

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 10 - Reformatted to upload in Google sheet

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Get row(s) in sheet in Google Sheets

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.7

Block 15 - Append row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

3. Summary Table

Workflow Extract purchase orders from Gmail using Gemini AI and save to Google Sheets
Complexity advanced
Nodes 15
Categories Document Extraction, AI Summarization
Author SayOne Technologies
Published 15 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8585/8585.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Extract purchase orders from Gmail using Gemini AI and save to Google Sheets do?

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 m...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI Summarization use case.