Files & Documents

Extract Email Data and Organize in Google Sheets and Drive

23 nodes 112 81 Automatic trigger
Download

Workflow Description

An automation that monitors incoming Gmail messages, extracts critical data using AI, and automatically organizes it into Google Sheets tables while archiving attachments in Google Drive folders for centralized document management.

How it works

  1. 1.Monitor new Gmail messages and apply filtering rules to relevant emails
  2. 2.Extract structured data and attachments using AI-powered analysis
  3. 3.Process extracted information in batches and format for consistency
  4. 4.Write organized data records to designated Google Sheets
  5. 5.Store attachments in organized Google Drive folders with metadata

Use cases

  • Automate invoice and receipt processing from email with data logging
  • Consolidate customer feedback and inquiry data into searchable spreadsheets
  • Archive important documents with linked metadata for compliance tracking

Requirements

  • Active Gmail account with full message access permissions
  • Google Drive and Google Sheets access under same workspace
  • OpenAI API key configured for intelligent data extraction

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Split In Batches OpenAI Tool Output Parser Gmail AI Agent Google Drive Google Sheets

Details

Trigger Automatic trigger
Nodes 23
Apps 8
Views 112
Downloads 81

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (23)

/

Loop Over Items

Split In Batches

#1

OpenAI Chat Model

OpenAI

#2

Calculator

Tool Calculator

#3

Structured Output Parser

Output Parser Structured

#4

On Email receipt

Gmail

#5

Get Filename and mimeType

Code

#6

Filter ZIP files only

Filter

#7

Unzip Invoice

Compression

#8

Just for style

No Op

#9

Get filename and mimeType on extracted docs

Code

#10

Split XML and PDF

Switch

#11

Extract PDF Data

Extract From File

#12

Extract XML Data

Extract From File

#13

Convert to JSON

Xml

#14

Append both Docs

Merge

#15

Aggregate all Data into 1 list

Aggregate

#16

Extract Data from PDF and XML

Agent

#17

Create initial PDF

Google Drive

#18

Merge both flows

Merge

#19

Update PDF with actual name

Google Drive

#20

Get Current Date

Code

#21

Create or update row

Google Sheets

#22

Sticky Note

Sticky Note

#23