{"slug": "stop-drowning-in-files-auto-organize-your-google-drive-with-n8n-free-workflow", "title": "Stop drowning in files: auto-organize your Google Drive with n8n (free workflow JSON)", "summary": "Free n8n workflow JSON that automatically organizes files in Google Drive by monitoring a designated \"Inbox\" folder. When a new file is added, the workflow classifies it by type (e.g., PDF, Image, Spreadsheet) based on its MIME type or extension, renames it with a date prefix, and moves it into the appropriate subfolder. It also logs every action in a Google Sheet for a complete audit trail.", "body_md": "Your Google Drive is a mess. Don't lie.\nDownloads folder. Desktop. Shared drives. Inbox attachments saved without thinking. After a year of casual saving, you've got PDFs next to vacation photos next to invoices next to half-finished presentations â€” and nothing is findable.\nThe fix isn't a \"digital declutter weekend.\" That takes hours and you'll slide back in two weeks. The fix is an automation that runs forever and silently keeps everything sorted for you.\nHere's a 4-node n8n workflow that watches a Google Drive folder and automatically moves every new file into the right sub-folder â€” PDFs, Images, Spreadsheets, Documents, Presentations, Videos â€” with a date prefix so files sort chronologically without renaming anything manually.\nPolls a specific Google Drive folder every minute for new files. The moment a file lands in your \"Inbox\" folder (your drop zone), the workflow fires.\nLooks at the file's MIME type and filename extension:\napplication/pdf\nor .pdf\nâ†’ PDFs\nimage/*\nor .jpg/.jpeg/.png/.gif/.svg/.webp\nâ†’ Images\nspreadsheet\nMIME or .xlsx/.xls/.csv\nâ†’ Spreadsheets\ndocument\nMIME or .doc/.docx/.txt/.md\nâ†’ Documents\npresentation\nMIME or .ppt/.pptx\nâ†’ Presentations\nvideo/*\nor .mp4/.mov/.avi\nâ†’ Videos\nAlso prepends today's date: 2026-05-22_invoice-client.pdf\n. Every folder sorts automatically from oldest to newest â€” no manual date-tagging ever.\nMoves the file from the Inbox folder into the classified sub-folder. Two-second operation. The original file is gone from your drop zone, organized where it belongs.\nAppends a row to a FileLog sheet: fileId\n, fileName\n, targetFolder\n, newName\n. Full audit trail: every file ever sorted, when it was sorted, where it went.\nCreate the folder structure in Google Drive:\nInbox/\n(your drop zone)Files/PDFs/\nFiles/Images/\nFiles/Spreadsheets/\nFiles/Documents/\nFiles/Presentations/\nFiles/Videos/\nFiles/Other/\nImport the JSON into n8n (New Workflow â†’ Import from clipboard)\nConnect your Google account in the Drive Trigger, Drive, and Sheets nodes (one OAuth connection covers all three)\nSet your folder IDs in Node 1 (Inbox folder ID) and Node 3 (target folder IDs â€” one per category). Get folder IDs from the URL when you open a folder in Drive: drive.google.com/drive/folders/FOLDER_ID_HERE\nCreate a Google Sheet called FileLog\nand set its ID in Node 4\nActivate the workflow â€” it now runs forever\nFrom now on: drop anything into Inbox, it's organized in under 60 seconds.\n{\n\"name\": \"File Organizer\",\n\"nodes\": [\n{\n\"parameters\": {\n\"pollTimes\": {\"item\": [{\"mode\": \"everyMinute\"}]},\n\"triggerOn\": \"specificFolder\",\n\"folderToWatch\": {\"__rl\": true, \"value\": \"YOUR_INBOX_FOLDER_ID\", \"mode\": \"id\"}\n},\n\"id\": \"fo1\", \"name\": \"Watch Google Drive\",\n\"type\": \"n8n-nodes-base.googleDriveTrigger\", \"typeVersion\": 1, \"position\": [240, 300]\n},\n{\n\"parameters\": {\n\"jsCode\": \"const file = $input.first().json;\\nconst name = file.name || '';\\nconst mime = file.mimeType || '';\\nlet folder = 'Other';\\nif (mime.includes('pdf') || name.endsWith('.pdf')) folder = 'PDFs';\\nelse if (mime.includes('image') || /\\\\.(jpg|jpeg|png|gif|svg|webp)$/i.test(name)) folder = 'Images';\\nelse if (mime.includes('spreadsheet') || /\\\\.(xlsx|xls|csv)$/i.test(name)) folder = 'Spreadsheets';\\nelse if (mime.includes('document') || /\\\\.(doc|docx|txt|md)$/i.test(name)) folder = 'Documents';\\nelse if (mime.includes('presentation') || /\\\\.(ppt|pptx)$/i.test(name)) folder = 'Presentations';\\nelse if (mime.includes('video') || /\\\\.(mp4|mov|avi)$/i.test(name)) folder = 'Videos';\\nconst datePrefix = new Date().toISOString().split('T')[0];\\nreturn [{ json: { fileId: file.id, fileName: name, targetFolder: folder, newName: datePrefix + '_' + name } }];\"\n},\n\"id\": \"fo2\", \"name\": \"Classify File Type\",\n\"type\": \"n8n-nodes-base.code\", \"typeVersion\": 2, \"position\": [480, 300]\n},\n{\n\"parameters\": {\n\"operation\": \"move\",\n\"fileId\": \"={{ $json.fileId }}\",\n\"folderId\": \"={{ $json.targetFolder }}\"\n},\n\"id\": \"fo3\", \"name\": \"Move to Folder\",\n\"type\": \"n8n-nodes-base.googleDrive\", \"typeVersion\": 3, \"position\": [720, 200]\n},\n{\n\"parameters\": {\n\"operation\": \"append\",\n\"documentId\": {\"__rl\": true, \"value\": \"YOUR_SHEET_ID\", \"mode\": \"id\"},\n\"sheetName\": {\"__rl\": true, \"value\": \"FileLog\", \"mode\": \"name\"},\n\"columns\": {\"mappingMode\": \"autoMapInputData\"}\n},\n\"id\": \"fo4\", \"name\": \"Log Action\",\n\"type\": \"n8n-nodes-base.googleSheets\", \"typeVersion\": 4.5, \"position\": [720, 400]\n}\n],\n\"connections\": {\n\"Watch Google Drive\": {\"main\": [[{\"node\": \"Classify File Type\", \"type\": \"main\", \"index\": 0}]]},\n\"Classify File Type\": {\"main\": [[{\"node\": \"Move to Folder\", \"type\": \"main\", \"index\": 0}, {\"node\": \"Log Action\", \"type\": \"main\", \"index\": 0}]]}\n},\n\"settings\": {\"executionOrder\": \"v1\"},\n\"tags\": [{\"name\": \"file-management\"}]\n}\nAdd more file types\nThe Code node's classification logic is just a series of if/else\nstatements. Add a line like:\nelse if (/\\.(zip|tar|gz)$/i.test(name)) folder = 'Archives';\nfor ZIP files, audio files, code files â€” whatever categories you need.\nUse it as a shared team inbox\nShare the Inbox folder with your team. Now anyone on the team can drop files and they'll auto-sort into the right place. Works great for shared client deliverables, design assets, or contract PDFs.\nAdd Slack notification\nAppend a Slack node after Node 3:\n\"âœ… {{$json.fileName}} â†’ {{$json.targetFolder}}\"\nGreat for team awareness when important files arrive.\nEmail attachment auto-saver\nPair this workflow with an n8n Gmail trigger that saves all attachments to the Inbox folder. Now every email attachment is automatically sorted by type and logged â€” your inbox clutter permanently solved.\nAdd AI-based naming\nReplace the date prefix logic in the Code node with a call to the OpenAI or Claude API to generate a clean descriptive filename based on file content (for text-readable files). More complex but powerful for documents with generic names like scan001.pdf\n.\nUnlike a \"clean up your files\" session that you'll undo in a month, this workflow runs silently forever. The longer it runs, the better your files are organized. Set it up once in 5 minutes, and your Drive is permanently sorted.\nThe audit log in Sheets also means you can easily answer: where did that file go? Search by filename, filter by date, done.\nThis workflow is part of our 15-template n8n automation bundle â€” each one covering a different business use case: lead capture, invoice generation, AI customer support, social media automation, price monitoring, and more.\nGrab the full bundle at stripeai.gumroad.com â€” pre-tested, documented, ready to activate.\nBuilt with n8n. Self-hostable, open source, no vendor lock-in.", "url": "https://wpnews.pro/news/stop-drowning-in-files-auto-organize-your-google-drive-with-n8n-free-workflow", "canonical_source": "https://dev.to/flowkithq/stop-drowning-in-files-auto-organize-your-google-drive-with-n8n-free-workflow-json-39g", "published_at": "2026-05-22 10:37:02+00:00", "updated_at": "2026-05-22 11:03:44.800521+00:00", "lang": "en", "topics": ["developer-tools", "products", "data", "enterprise-software", "cloud-computing"], "entities": ["Google Drive", "n8n"], "alternates": {"html": "https://wpnews.pro/news/stop-drowning-in-files-auto-organize-your-google-drive-with-n8n-free-workflow", "markdown": "https://wpnews.pro/news/stop-drowning-in-files-auto-organize-your-google-drive-with-n8n-free-workflow.md", "text": "https://wpnews.pro/news/stop-drowning-in-files-auto-organize-your-google-drive-with-n8n-free-workflow.txt", "jsonld": "https://wpnews.pro/news/stop-drowning-in-files-auto-organize-your-google-drive-with-n8n-free-workflow.jsonld"}}