Detect duplicate Google Drive files and log results to Google Sheets
Ready for 3.0What this workflow does
This workflow has 10 nodes and runs from “Set Configuration Parameters” (no trigger node, so run it manually or call it from another workflow). Along the way it connects Google Drive, Google Sheets and Gmail.
How it runs
Trigger: From “Set Configuration Parameters” (no trigger node, so run it manually or call it from another workflow).
- Set Configuration Parameters (Edit Fields (Set)): sets 3 fields: folderID, spreadsheetID, sheetName
- Fetch Files from Drive (Google Drive): work with file folder
- Identify Duplicate Files (Code): runs custom JavaScript code
- Check for Duplicates (If): checks a condition and branches into true / false
- Prepare Duplicates Log Fields (Edit Fields (Set)): sets 9 fields: Group Key, File Name, File ID…
- Prepare Clean Log Fields (Edit Fields (Set)): sets 9 fields: Group Key, File Name, File ID…
- Append Duplicates to Sheets (Google Sheets): append
- Append Clean Log to Sheets (Google Sheets): append
- Limit: keeps the first few items
- Notify via Gmail (Gmail): uses Gmail
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (7)
- Google Drive
n8n-nodes-base.googleDrive - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - Limit
n8n-nodes-base.limit - Gmail
n8n-nodes-base.gmail - Edit Fields (Set)
n8n-nodes-base.set
From the author
Quick overview This workflow manually scans a specified Google Drive folder for duplicate and near-duplicate filenames, appends the results to a Google Sheets log, and optionally sends a single Gmail notification when duplicates are found. How it works 1.…