Skip to main content

Invoices from Gmail to Drive and Google Sheets

Workflow preview

Workflow preview
100%
Invoices from Gmail to Drive and 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

Attachments Gmail to Drive and Google Sheets Description Automatically process invoice emails by saving attachments to Google Drive and extracting key invoice data to Google Sheets using AI. This w...

Best for

  • Invoice Processing automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.gmailtrigger, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.googledrive, n8n-nodes-base.gmail, n8n-nodes-base.extractfromfile, @n8n/n8n-nodes-langchain.lmopenai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Juan Carlos Cavero Gracia.

Original n8n.io source

1.1 Workflow description

Title
Invoices from Gmail to Drive and Google Sheets
Workflow name
Invoices from Gmail to Drive and Google Sheets

Attachments Gmail to Drive and Google Sheets

Description

Automatically process invoice emails by saving attachments to Google Drive and extracting key invoice data to Google Sheets using AI. This workflow monitors your Gmail for unread emails with attachments, saves PDFs to a specified Google Drive folder, and uses OpenAI's GPT-4o to extract invoice details (date, description, amount) into a structured spreadsheet.

Use cases

  • Invoice Management: Automatically organize and track invoices received via email
  • Financial Record Keeping: Maintain a structured database of all invoice information
  • Document Organization: Keep digital copies of invoices organized in Google Drive
  • Automated Data Entry: Eliminate manual data entry for invoice processing

Resources

  • Gmail account
  • Google Drive account
  • Google Sheets account
  • OpenAI API key

Setup instructions

Prerequisites

  1. Active Gmail, Google Drive, and Google Sheets accounts
  2. OpenAI API key (GPT-4o model access)
  3. n8n instance with credentials manager

Steps

  1. Gmail and Google Drive Setup:

    • Connect your Gmail account in n8n credentials
    • Connect your Google Drive account with appropriate permissions
    • Create a destination folder in Google Drive for invoice storage
  2. Google Sheets Setup:

    • Connect your Google Sheets account
    • Create a spreadsheet with columns: Invoice date, Invoice Description, Total price, and Fichero
    • Copy your spreadsheet ID for configuration
  3. OpenAI Setup:

    • Add your OpenAI API key to n8n credentials
  4. Configure Email Filter:

    • Update the email filter node to match your specific sender requirements

Benefits

  • Time Saving: Eliminates manual downloading, filing, and data entry
  • Accuracy: AI-powered data extraction reduces human error
  • Organization: Consistent file naming and storage structure
  • Searchability: Creates a searchable database of all invoice information
  • Automation: Runs every minute to process new emails as they arrive

Related templates

  • Email Parser to CRM
  • Document Processing Workflow
  • Financial Data Automation

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 - Sticky Note

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

Block 2 - Gmail Trigger1

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.1

Block 3 - Setup1

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

Block 4 - Upload PDF to Drive1

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

Block 5 - Rename file1

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 6 - Move to the correct folder1

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 7 - Gmail

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

Block 8 - Extract from File2

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

Block 9 - Google Drive

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 10 - OpenAI Model

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

Block 11 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.1

Block 12 - Append to Reconciliation Sheet

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

Block 13 - Sticky Note2

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

Block 14 - Map Output

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

Block 15 - Apply Data Extraction Rules

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.4

Block 16 - Sticky Note6

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

Block 17 - Only invoice mails with attachments

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

3. Summary Table

Workflow Invoices from Gmail to Drive and Google Sheets
Complexity advanced
Nodes 17
Categories Invoice Processing, AI Summarization
Author Juan Carlos Cavero Gracia
Published 25 Feb 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3016/3016.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 Invoices from Gmail to Drive and Google Sheets do?

Attachments Gmail to Drive and Google Sheets Description Automatically process invoice emails by saving attachments to Google Drive and extracting key invoice data to Google Sheets using AI. This w...

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 Invoice Processing, AI Summarization use case.