Library / Files & Cloud Storage
Files & Cloud Storage
Categorize Google Drive files with OpenAI and log results to Google Sheets
Runs on a schedule, classifies files in a Drive source folder with OpenAI, moves them into category folders, logs each outcome to Sheets, and alerts on low-confidence or failed runs.
What it does
## Auto-categorize Google Drive files into folders using AI with Google Sheets logging ### How it works This workflow periodically scans a configured Google Drive source folder, uses file metadata and extracted content to classify each file with an AI service, then moves the file into an appropriate category folder. It records every processing outcome in Google Sheets, handles low-confidence classifications with review notifications, and sends run-level or workflow-level alerts when errors occur. A separate scheduled path builds and sends a daily summary from the processing log. ### Setup steps - Configure Google Drive credentials with permission to list, download, create folders, and move files in the source and destination folders. - Configure Google Sheets credentials and create the processing log spreadsheet/sheet referenced by LOG_SPREADSHEET_ID and LOG_SHEET_NAME. - Set SOURCE_FOLDER_ID, DESTINATION_ROOT_FOLDER_ID, LOG_SPREADSHEET_ID, LOG_SHEET_NAME, and the AI endpoint/API details in the configuration node. - Configure Slack credentials/channels and email/SMTP settings for review, daily summary, run error, and workflow failure notifications. - Enable the schedules and ensure the workflow error trigger is registered as the error workflow for the main workflow if using n8n error handling. ### Customization Adjust the AI prompt/categories, confidence threshold, duplicate-name strategy, polling and daily-summary schedules, supported file extractors, and notification recipients to match the folder taxonomy and review process.
The steps
- When Poll Triggered
- Daily Summary 11:50pm
- Set Configuration Variables
- Read Logs from Sheets
- If Daily Summary Triggered
- Fetch Google Drive Files
- Select Files for Processing
- Loop Over Drive Files
- Identify File Type
- If Content Extraction Required
- Download Google Drive File
- Route by Extraction Type
- PDF Text Extraction
- Spreadsheet Row Extraction
59 steps in total.
Similar automations
Email AutomationInspect Vinted listings and log results with Google Sheets, Slack, Notion or email54 stepsAI Agents & AssistantsQualify and route inbound leads with GPT-4.1, HubSpot, Google Calendar and Slack38 stepsEmail AutomationCategorize Aruba Italian e-invoices with OpenAI and send monthly Excel reports via34 stepsEmail AutomationCategorize Gmail Emails with GPT-4o mini Multi-Labels8 steps