Skip to content
FlowHubFluxonLab
C
Google Drivefree

File Google Drive inbox documents into dated folders with a Google Sheets audit log

by Kevin Yuadapted from n8n official workflow galleryUpdated Aug 2026
RequiresCCodeGoogle DriveGoogle DriveGoogle SheetsGoogle Sheets
Share Post Share
GDWatch Inbox FolderWatch Inbox Fol…CoPlan Destination From RulesPlan Destinatio…SwRoute By Document TypeRoute By Docume…Find Year FolderIfYear Folder Exists?Year Folder Exi…Create Year FolderCreate Year Fol…Find Month FolderFind Month Fold…IfMonth Folder Exists?Month Folder Ex…Create Month FolderCreate Month Fo…Find Type FolderIfType Folder Exists?Type Folder Exi…Create Type FolderCreate Type Fol…Move File Into FolderMove File Into …Append Audit RowLog Filing FailureLog Filing Fail…1234567891011121314151617181920212223242526272829
1/5
STEPS · 29
Starts on a Google Drive event

Quick overview This workflow monitors a Google Drive inbox folder for new files, classifies them by filename regex rules, files them into a Year/Month/Type folder structure in Google Drive, and logs each success or failure to a Google Sheets audit log. How it works Triggers every minute when a new file is created in a selected Google Drive folder. Evaluates the filename against configurable regular-expression rules to assign a document type, derive the year/month from the file’s created time, and build a destination path. Uses the planned destination root to find or create the required year folder, then the month folder, then the type folder in Google Drive. Moves the file into the final type folder. Appends a “Filed” audit row to Google Sheets with timestamp, original filename, matched rule, destination path, and file ID. If any step errors, appends a “Failed” audit row to Google Sheets with error details so the run continues. Setup Add Google Drive OAuth2 credentials, select the inbox folder to watch, and ensure the archive root is a different Google Drive folder to avoid reprocessing filed files.

Tags

n8nreference-onlygoogle-drivegoogle-sheets
Connects
CCodegoogledriveGoogle DrivesheetsGoogle Sheets
CategoryGoogle Drive
Triggermanual
Complexitycomplex
Nodes15
AddedJul 3, 2026

Related workflows

See all Google Drive
CgoogledrivesheetsW
free

Recognize invoices / receipts from Google Drive and put them into Google Sheets

This workflow allows you to recognize a folder with receipts or invoices (make sure your files are in .pdf, .png, or .jpg format). The workflow can be triggered via the "Test workflow" button, and it also monitors the folder for new files, automatically recognizing them. Video Demo https://youtu.be/mGPt7fqGQD8 1. n8n import glitch After import, the trigger node "When clicking 'Test workflow'" might be disconnected. You need to connect it via 2 arrows to "Google Sheets1" and "Google Drive" nodes. So, the workflow has 2 triggers - via button, and via Google Sheets "new file" event - both of these triggers should be connected to 2 nodes. Here is how it should look like: https://ocr.oakpdf.com/n8n_fix.png 2. Set up RapidAPI HTTP auth key Create new "HTTP header" n8n credential and paste your RapidAPI key from https://rapidapi.com/restyler/api/receipt-and-invoice-ocr-api into it. https://ocr.oakpdf.com/n8n_api_key.png Make sure "HTTP Request" node uses this credential. 3. Set up your Google Auth You need a Google connection to work with your Google Sheets and Google Drive accounts: https://docs.n8n.io/integrations/builtin/credentials/google/oauth-generic/#finish-your-n8n-credential 4. S

by Anthony
Cgoogledrivesheets
free

Automated Work Attendance with Location Triggers

his workflow automates time tracking using location-based triggers. How it works Trigger: It starts when you enter or exit a specified location, triggering a shortcut on your iPhone. Webhook: The shortcut sends a request to a webhook in n8n. Check-In/Check-Out: The webhook receives the request and records the time and whether it was a "Check-In" or "Check-Out" event. Google Sheets: This data is then logged into a Google Sheet, creating a record of your work hours. Set up steps Google Drive: Connect your Google Drive account. Google Sheets: Connect your Google Sheets account. Webhook: Set up a webhook node in n8n. iPhone Shortcuts: Create two shortcuts on your iPhone, one for "Check-In" and one for "Check-Out." Configure Shortcuts: Configure each shortcut to send a request to the webhook with the appropriate "Direction" header. It's easy to setup, around 5 minutes.

by Rui Borges
Cgoogledrive
free

Send specific PDF attachments from Gmail to Google Drive using OpenAI

This workflow reads PDF textual content and sends the text to OpenAI. Attachments of interest will then be uploaded to a specified Google Drive folder. For example, you may wish to send invoices received from an email to an inbox folder in Google Drive for later processing. This workflow has been designed to easily change the search term to match your needs. See the workflow for more details. Prerequisites OpenAI credentials. Google credentials. How it works Triggers off on the On email received node. Iterates over the attachments in the email. Uses the OpenAI node to filter out the attachments that do not match the search term set in the Configure node. You could match on various PDF files (i.e. invoice, receipt, or contract). If the PDF attachment matches the search term, the workflow uses the Google Drive node to upload the PDF attachment to a specific Google Drive folder.

by n8n Team