Free automation, built to workOffer ends September 1, 2026.Claim yours

Save email attachments to Google Drive automatically

Detect Gmail attachments, sort them into folders, upload to Google Drive, and optionally log the file — an n8n workflow you can import.

Intermediate·~40 min·9 nodes

n8n · Gmail · Google Drive · OpenAI · Airtable

Property Management · Real Estate · Accounting · Professional Services·Operations · Administration · Document Processing · Finance

What this automation does

Instead of downloading every PDF from Gmail and dragging it into the right Drive folder, this workflow watches incoming mail, splits each attachment, guesses a category, creates the year/month/type folder if needed, and uploads the file. An optional Airtable row keeps a searchable log.

When to use it

Use this workflow if:

  • Invoices, contracts, or IDs arrive by email and live in someone’s inbox.
  • The shared Drive is missing files because filing is manual.
  • Property, accounting, or ops teams need a predictable folder tree.
  • You want a log of what arrived, from whom, and where the file now sits.
  • Attachments are easy to miss when the rest of the thread is noise.

Workflow overview

  1. Trigger

    Gmail reports a new message and can download binaries.

  2. Validate

    Messages with no attachments stop immediately.

  3. Process

    Each file becomes its own item with a safe filename.

  4. Decision

    A category is taken from the name or from an optional AI step.

  5. Action

    Drive folders are ensured, then the file is uploaded.

  6. Notification

    Airtable can log the file; Slack can be added if you want a ping.

Interactive flow

Pan, zoom, and click a node to inspect it. Use the buttons below the canvas to jump to a step.

n8n workflow JSON

Copy this workflow JSON and import it directly into n8n. You will still need to connect your own credentials and configure the services used by the workflow.

Download JSON

Import this workflow into n8n

  1. Copy or download the workflow JSON from this page.
  2. Open n8n and create a new workflow — or open an empty canvas.
  3. Use Import from File, or paste the JSON via the workflow menu.
  4. Connect your own credentials for every service the workflow uses.
  5. Replace the placeholder IDs, channels, tables, and folder names.
  6. Run a test with a sample payload before you activate it.
  7. Activate the workflow only after the test run looks correct.

Setup requirements

Accounts

  • n8n
  • Gmail
  • Google Drive
  • OpenAI (optional — disable Classify Document if unused)
  • Airtable (optional — disable the log node if unused)

Credentials

  • Gmail OAuth
  • Google Drive OAuth
  • OpenAI credential if you keep the classifier
  • Airtable token if you keep the log

Information

  • Root Google Drive folder ID (YOUR_DRIVE_FOLDER_ID)
  • Whether you want year/month/category folders or a flatter tree
  • Airtable Documents table fields, if logging
  • Which Gmail label or inbox should be watched

Step-by-step

  1. Step 1Watch incoming mail

    The Gmail Trigger should download attachments. If binaries are missing on the first run, add a Gmail Get Message node with download enabled.

  2. Step 2Skip empty messages

    The IF node continues only when the item has binary files, so ordinary replies do not create empty folders.

  3. Step 3Split and name files

    Code emits one item per attachment, with a sanitized filename and a first-pass category from the name or MIME type.

  4. Step 4Classify the document

    Optional OpenAI step refines invoice vs receipt vs contract vs other. Disable Classify Document and Apply Category if filename rules are enough.

  5. Step 5File in Drive

    A folder is created (or reused) under your root ID, then the binary is uploaded. Confirm the binary property name matches what Split Attachments emitted.

  6. Step 6Log the document

    Airtable stores filename, category, sender, and Drive id. Disable this node if Drive is the only system of record.

Ways to extend this workflow

  • Disable the OpenAI nodes and keep filename-based categories only.
  • Notify Slack or WhatsApp when an invoice lands in Drive.
  • Extract totals from PDFs with a parser before the Airtable log.
  • Route contracts to a review folder instead of the live archive.
  • Match the sender domain to a client record in your CRM.
  • Deduplicate by filename plus date so forwards do not upload twice.
  • Swap Airtable for a property-management system or QuickBooks Online attachment.

Need this customized for your business?

This template is the starting point. If the workflow needs custom logic, several systems, error handling, or production monitoring, Syntropic Ops can design and implement it with you.