Skip to main content

Automatic Gmail invoice PDF upload to Google Drive with spreadsheet logging

Workflow preview

Workflow preview
100%
Automatic Gmail invoice PDF upload to Google Drive with spreadsheet logging preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Sort invoice PDFs from Gmail to Google Drive and Google Sheets Who’s it for Freelancers, finance teams, and small businesses that receive invoice PDFs by email and want them automatically saved to ...

Best for

  • Invoice Processing automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.stickynote, n8n-nodes-base.filter, n8n-nodes-base.googledrive, n8n-nodes-base.googlesheets, n8n-nodes-base.gmail, n8n-nodes-base.if

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automatic Gmail invoice PDF upload to Google Drive with spreadsheet logging
Workflow name
Automatic Gmail invoice PDF upload to Google Drive with spreadsheet logging

Sort invoice PDFs from Gmail to Google Drive and Google Sheets

Who’s it for

Freelancers, finance teams, and small businesses that receive invoice PDFs by email and want them automatically saved to Google Drive and logged in Google Sheets—without manual downloading or copy-pasting.

How it works / What it does

This workflow watches your Gmail inbox for unread messages that match an invoice pattern (e.g., subject:invoice filename:pdf). For each email, it checks for attachments, uploads each PDF to a chosen Google Drive folder, and appends a new row to a Google Sheet with useful metadata: received time, sender, subject, filename, Drive link, and IDs. Finally, it marks the original email as read to avoid duplicates.

How to set up

  1. Open the Config (Set) node and fill in:

    • drive_folder_id (or leave blank for root)
    • spreadsheet_id (from the Sheet URL)
    • sheet_name (e.g., Invoices)
  2. Connect credentials for Gmail, Google Drive, and Google Sheets in each node.

  3. Adjust the Gmail search query if needed (language/vendor terms).

  4. Run once manually to verify data mapping, then activate.

Requirements

  • n8n with valid credentials for Gmail, Google Drive, and Google Sheets.
  • A Google Sheet with appropriate headers (or let the workflow write new columns).

How to customize the workflow

  • Replace Gmail with IMAP or Microsoft Outlook if you don’t use Gmail; remove the “mark as read” step accordingly.
  • Add parsing (e.g., extract invoice totals or vendor names via PDF/AI nodes) before the Sheets step.
  • Route based on vendor: create subfolders dynamically in Drive and write to different tabs.
  • Notify your team by adding Slack/Email nodes after logging to Sheets.

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 - Gmail Trigger

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

Block 2 - Sticky Note

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

Block 3 - Has PDF Attachments?

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

Block 4 - Sticky Note1

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

Block 5 - Upload to Google Drive

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

Block 6 - Sticky Note2

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

Block 7 - Log to Google Sheets

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

Block 8 - Sticky Note3

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

Block 9 - Mark Email as Read

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

Block 10 - Sticky Note4

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

Block 11 - Sticky Note5

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

Block 12 - If

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

3. Summary Table

Workflow Automatic Gmail invoice PDF upload to Google Drive with spreadsheet logging
Complexity intermediate
Nodes 12
Categories Invoice Processing
Author Toshiya Minami
Published 14 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9610/9610.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 Automatic Gmail invoice PDF upload to Google Drive with spreadsheet logging do?

Sort invoice PDFs from Gmail to Google Drive and Google Sheets Who’s it for Freelancers, finance teams, and small businesses that receive invoice PDFs by email and want them automatically saved to ...

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 use case.