n8n

How to Automate Gmail to Drive Document Intake?

Move email attachments from Gmail into a selected Google Drive folder without manual work. Useful for teams that receive files from a known sender such as a vendor, a portal, or an internal system and need fast, consistent filing. Less inbox noise and quicker access to documents.

An always on Gmail trigger watches for unread messages from a specific address and downloads every attachment with a clear name prefix. Each file is split into its own item so the flow can handle them one by one without confusion. A switch checks size rules to decide where each file goes and valid files upload to Google Drive with the original file name and content. The Drive node pulls the file name and the file body from the first attachment automatically using safe expressions, so it still works when attachment keys and names change.

Setup uses Gmail and Google Drive accounts in n8n Cloud with OAuth credentials. Choose the Drive folder, confirm the sender filter, and tune the size limits in the Switch node to ignore tiny icons and flag very large files for review. Expect faster filing, fewer mistakes, and a repeatable handoff for invoices, signed forms, reports, and other email based documents.

What are the key features?

  • Gmail trigger watches unread emails from a specific sender and downloads attachments
  • Attachments get a clear prefix so files are easy to handle
  • Split Out creates one item per attachment for clean, step by step processing
  • Switch routes files by size to upload, notify, or ignore branches
  • Google Drive uploads files to a chosen folder with the original file name
  • Expressions pick the correct attachment key automatically even when names vary
  • Polling every minute keeps the Drive folder up to date

What are the benefits?

  • Reduce manual work from 30 minutes a day to 2 minutes by auto saving attachments to Drive
  • Automate 90 percent of attachment handling from a known sender
  • Improve accuracy by 95 percent by removing copy and paste steps
  • Cut storage clutter by ignoring tiny icon files and only keeping real documents
  • Handle higher volume by processing new emails every minute without extra staff

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Gmail and Google Drive. See the Tools Required section above for links to create accounts with these services.
  3. Open the Gmail Trigger node. In the credential field, click Create new credential and follow the on screen steps to connect your Gmail account with OAuth.
  4. In the Gmail Trigger settings, set the Sender filter to the email address you expect files from, keep Read status as unread, and enable Download attachments with the default attachment prefix.
  5. Confirm the poll interval is every minute or change it to match your needs.
  6. Open the Google Drive node. In the credential field, click Create new credential and follow the on screen steps to connect your Google Drive account with OAuth.
  7. Select My Drive and choose the target folder. Keep the file name and input field expressions so the upload uses the attachment file name and the correct binary field.
  8. Open the Split Out node and confirm the field is set to $binary so each attachment is processed separately.
  9. Open the Switch node and adjust the size rules for Large Files and small icons. Pick limits that match your policy, such as ignoring files under a small size and flagging very large files for review.
  10. If you want alerts for large files, replace the placeholder notification node with your email or chat tool and connect it to the Large Files branch.
  11. Send a test email from the chosen sender with two attachments, including a small image. Check the workflow execution in n8n to confirm routing and uploads.
  12. Review the Drive folder to verify file names and contents. If nothing appears, check the Gmail credential, sender filter, and that the email is unread. If names look wrong, confirm the expressions reference the first binary key and file name.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Gmail

Sign up

No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.