How to automate file collection with n8n: a practical workflow guide

Collecting files from multiple people is one of those tasks that sounds simple until it isn't. Shared folders confuse some users, email threads get messy, and nothing ever lands in the right place. n8n offers a straightforward solution: a workflow that watches your inbox, detects a keyword in the subject line, and automatically saves any attachment to a designated Google Drive folder.

This guide walks through that exact workflow. It covers the trigger configuration, the attachment download step, the Google Drive upload node, and how to publish the automation so it runs continuously without manual input. No custom code is required.

TL;DR

• Problem: Collecting file attachments from multiple people is disorganized and relies on users knowing how to upload to shared folders.

• Solution: n8n can monitor a Gmail inbox for a specific keyword, automatically download any attachment, and save it to Google Drive.

• Outcome: A fully automated file collection workflow that runs 24/7 without manual intervention or portals.

What n8n does

n8n is an open-source workflow automation platform that connects apps and services through a node-based visual editor. Each node represents a distinct action: receiving a trigger, fetching data, transforming it, or sending it somewhere else. Users build automations by chaining these nodes together without writing code.

Unlike cloud-only automation tools, n8n can be self-hosted. That means the workflow logic and credentials stay on a server you control. It supports a wide range of integrations including Gmail, Google Drive, Slack, Airtable, HTTP webhooks, and more. Trigger types include manual starts, scheduled intervals, webhook events, and app-based signals such as a new email arriving in an inbox.

The platform targets users who want automation flexibility without the constraints of a fully managed SaaS product. It is particularly well suited to recurring, rule-based tasks where the logic is predictable and the data flow is linear.

Why it matters

The workflow covered in this guide addresses a common friction point: asking people to submit files through a system they are unfamiliar with. Shared folder links, upload portals, and file request services all require the recipient to take an extra step outside their usual behaviour. Email attachment is a behaviour virtually everyone already knows.

By building the automation around the sender's existing habits rather than asking them to change, the collection process becomes passive. The automation handles the routing. The sender just attaches a file and adds a keyword to the subject line.

From a broader perspective, this illustrates the practical value of n8n for non-technical users. The workflow does not require a developer. It uses three nodes, a credential setup that is done once, and a filter rule that mirrors Gmail's own search syntax. The barrier to entry is lower than it appears.

Strengths

The keyword-based trigger approach is both flexible and precise. Gmail's built-in search syntax, which n8n uses directly in its filter configuration, allows combinations of subject line keywords, attachment presence, and read status. This means the workflow only activates under specific conditions, reducing the risk of processing unintended emails.

Credential reuse is a meaningful time saver. Once a Gmail or Google Drive credential is configured using OAuth2, it is available to every workflow in the n8n instance. Users who build multiple automations involving Google services only go through the authentication process once.

The modular node structure also makes the workflow extensible without redesigning it from scratch. Because each step is isolated, adding a fourth node to rename files, send confirmation emails, or sort attachments into monthly subfolders only requires inserting that node into the existing chain. The base workflow does not need to change.

Self-hosting provides an additional advantage for users handling sensitive documents such as invoices, tax records, or contracts. Data does not pass through a third-party cloud automation service. It moves directly between the user's Gmail account and their Google Drive via the n8n instance they control.

Limitations

The initial setup requires some technical groundwork. Configuring OAuth2 credentials through the Google Cloud Console is a one-time process, but it involves navigating developer console settings that are unfamiliar to many non-technical users. The interface changes periodically, which means written documentation can become outdated.

Self-hosting also introduces infrastructure responsibility. n8n needs to run on a server that stays online for the automation to function continuously. Users on entry-level hosting plans may encounter performance limits when running multiple concurrent workflows or processing large file volumes. Maintenance, updates, and uptime monitoring fall to the user.

The workflow as described handles one attachment per email. Emails with multiple attachments require additional configuration to loop through each file. This is achievable within n8n but adds complexity beyond what this basic setup covers.

There is also a dependency on Gmail specifically. Users on other email providers would need to use a different trigger node. n8n supports other mail integrations, but the filter logic and credential process differ and would require separate configuration.

Verdict

This n8n workflow is a practical starting point for anyone looking to automate a recurring, low-complexity file collection task. The three-node structure is manageable for users with no automation background, and the logic is straightforward enough to adapt once the fundamentals are in place.

The main investment is the initial credential setup and server configuration. Once those are in place, the workflow runs without ongoing maintenance. For users already operating a self-hosted n8n instance, the time to build and publish this automation is minimal.

n8n is not the right choice for users who need a fully managed, zero-infrastructure solution. But for those comfortable with self-hosting or already using a VPS, it delivers reliable automation with meaningful flexibility and no recurring per-task fees.

FAQ

Does this workflow work with email providers other than Gmail?

The workflow as described uses the Gmail trigger node, which is specific to Gmail accounts. n8n does support other email integrations, but users on different providers would need to select the appropriate trigger node and configure credentials separately for that service.

What happens if an email contains more than one attachment?

The basic workflow handles one attachment per email. Processing multiple attachments from a single email requires additional nodes to iterate through each file. This is possible in n8n using a loop or split-in-batches node, but it adds steps beyond the foundational setup.

Is it possible to sort files into different folders based on the sender or subject line?

Yes. n8n supports conditional logic through its IF node, which can route attachments to different Google Drive folders based on criteria such as sender address, subject line content, or date. This requires adding and configuring those nodes after the existing Google Drive upload step.

Some links may be affiliate links. This helps support the site at no additional cost and does not influence the content or reviews.

Scroll to Top