Skip to main content

Extract structured data from Gmail attachments to Google Sheets, GPT vision

Workflow preview

Workflow preview
100%
Extract structured data from Gmail attachments to Google Sheets, GPT vision preview
Open on n8n.io

1. Workflow Overview

Automatically extract structured information from emails using AI powered document analysis. This workflow processes emails from specified domains, classifies them by type, and extracts structured ...

Best for

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

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.gmail, n8n-nodes-base.code, n8n-nodes-base.filter, n8n-nodes-base.if, n8n-nodes-base.extractfromfile, n8n-nodes-base.httprequest

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Extract structured data from Gmail attachments to Google Sheets, GPT vision
Workflow name
Extract structured data from Gmail attachments to Google Sheets, GPT vision

Automatically extract structured information from emails using AI-powered document analysis. This workflow processes emails from specified domains, classifies them by type, and extracts structured data from various attachment formats.

Who is this for

Operations teams, coordinators, and business professionals who receive proposals or reports from multiple sources via email and need to consolidate the information into a structured database.

What this workflow does

  1. Monitors Gmail every 30 minutes for emails from specified domains
  2. Classifies emails into three categories based on customizable keywords
  3. Processes attachments intelligently based on file type and email classification
  4. Extracts structured data: dates, times, names, amounts, and other fields
  5. Saves to Google Sheets with full metadata and classification
  6. Labels processed emails in Gmail for tracking

Setup requirements

  • Gmail OAuth2 credentials
  • OpenAI API key (GPT-4 Vision)
  • Google Sheets OAuth2 credentials
  • AWS S3 bucket for temporary image storage
  • ConvertAPI account for PPTX/PDF conversion

How to customize

Edit the domain list and classification keywords in the code nodes to adapt for your specific use case.

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 - Workflow Description

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

Block 2 - Email Classification Info

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

Block 3 - Gmail Labels Info

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

Block 4 - File Processing Info

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

Block 5 - ConvertAPI Info

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

Block 6 - Google Sheets Info

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

Block 7 - AWS S3 Info

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

Block 8 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 9 - Gmail - Get Emails

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

Block 10 - Domain Filter

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

Block 11 - Filter Valid Emails

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

Block 12 - Gmail - Get Attachments

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

Block 13 - Detect File Types

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

Block 14 - IF - Has Excel?

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

Block 15 - Extract from Excel

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

Block 16 - Parse Excel Data

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

Block 17 - IF - Has PPTX/PDF?

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

Block 18 - ConvertAPI to PNG

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 19 - Prepare for S3 Upload

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

Block 20 - S3 Upload (PPTX)

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

Block 21 - Collect S3 URLs

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

Block 22 - Prepare GPT Request (PPTX)

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

Block 23 - GPT Vision Analysis

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 24 - IF - Has Image?

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

Showing the first 24 of 48 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Extract structured data from Gmail attachments to Google Sheets, GPT vision
Complexity advanced
Nodes 48
Categories Document Extraction, AI Summarization
Author Masaki Go
Published 26 Jan 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13004/13004.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 structured data from Gmail attachments to Google Sheets, GPT vision do?

Automatically extract structured information from emails using AI powered document analysis. This workflow processes emails from specified domains, classifies them by type, and extracts structured ...

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.