Use this powerful n8n workflow to automatically download and filter multiple Gmail attachments by size, uploading approved files directly to Google Drive. A necessary n8n template for efficiency.
Download this n8n workflow template and start using it instantly.
Operations Managers: Seeking reliable automation to archive important documents sent via email without manual intervention.
Technical Users and Developers: Needing an advanced n8n workflow example demonstrating how to correctly split and reference multiple binary files (attachments).
Teams using n8n: Those who require conditional file storage based on metrics like file size.
Efficiency Seekers: Anyone looking for a robust, no-code n8n template to streamline their Gmail and Google Drive interactions.
Handling email attachments, especially when multiple files are involved, is often a tedious and error-prone process. This specialized n8n workflow solves this by providing a hands-off approach to email file management. It utilizes the power of the n8n node ecosystem to monitor a specified Gmail account for emails matching strict criteria (unread, from a specific sender). Crucially, this n8n workflow demonstrates how to use the Split Out n8n node to correctly process multiple attachments as individual items, allowing for per-file processing and conditional routing.
After splitting the binaries, the workflow intelligently uses a Switch n8n node to evaluate the file size. This allows users to implement business logic—for instance, ignoring small junk files or routing overly large files to a separate notification channel—before uploading only the relevant files to Google Drive. This n8n template is a prime example of advanced logic implemented without custom code.
This automation starts with the specialized Gmail Trigger n8n trigger node, which is configured to look for unread emails from a specific sender and, critically, is set to automatically download all attachments associated with the email.
Gmail Trigger fires when a matching email arrives, downloading the attachments as binary data, prefixed with attachment_.Split Out n8n node receives the email item containing multiple binary files. It then splits the binary data into separate items, ensuring that each subsequent n8n node processes one attachment at a time. This is a vital step for ensuring individual file handling.Switch n8n node evaluates the size of the current attachment item using expressions ($binary.values()[0].fileSize). This n8n node routes the files into three paths:Google Drive n8n node, which uploads the binary file. Thanks to the use of dynamic expressions in the Google Drive n8n node, the file name and the binary input field name are correctly referenced, ensuring the correct file is saved to the designated Google Drive folder.To deploy this powerful n8n workflow, follow these steps:
Gmail Trigger n8n node. You must set up a Gmail OAuth2 credential. Additionally, modify the 'Sender' filter to match the specific email address you wish to monitor.Google Drive n8n node. Create or select an existing Google Drive OAuth2 credential. Ensure the 'Folder ID' is updated to the specific destination folder where you want the filtered attachments stored. Gmail Trigger: The initial n8n trigger for the workflow. It uses filters for specific senders and download unread emails, ensuring the attachments are immediately available as binary data for the next n8n node.
Split Out: Crucial n8n node configured to split the $binary field. This transforms one email item with many attachments into many items, each containing a single attachment, enabling per-file filtering.
Switch: This n8n node acts as the conditional router. It uses complex expressions referencing the binary data's file size property to determine if the attachment should be uploaded, ignored, or flagged, providing advanced flow control within the n8n workflow.
Google Drive: The final action n8n node. It dynamically references the file name and binary data using expressions (={{ $binary.values()[0].fileName }} and ={{ $binary.keys()[0] }}), ensuring the correct attachment is uploaded to the target folder.
Use this powerful n8n workflow to reliably upload large files to Kommo-AmoCRM by automatically splitting them into manageable chunks using advanced n8n node configurations and custom scripting.

Use this powerful n8n workflow to handle large file uploads to Dropbox using the chunked upload API. This n8n templates solution features a responsive web UI for real-time progress tracking.

Automate file uploads from Google Drive folders directly into your InfraNodus knowledge graph. Use this n8n workflow to build a powerful RAG system for document analysis.

Use this powerful n8n workflow to automate podcast publishing. Upload audio to Google Drive, update the GitHub-hosted RSS feed, and launch episodes on Spotify using this reusable n8n template.

Use this powerful n8n workflow to automatically synchronize video and image ad assets from Google Drive and Google Sheets directly to Meta Ads Manager, streamlining ad deployment. Save time deploying new campaigns.


Software developer specializing in "back-end plumbing" to connect and sync data between large corporate systems, enabling application distribution/migration, scaling, and containerization. Using n8n for various orchestration tasks both at home and "on the job."







































