Discard found Google Apps documents
Configured with Filter, Google Drive, Google Drive Trigger, Switch. Review the connections and setup before adapting this template.
Node categories in this workflow
- Transform
- Routing
- Code
- Files / media
- Trigger
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| Config | Transform | Edit Fields | See node parameters |
| Edit Fields | Transform | Edit Fields | See node parameters |
| Filter | Routing | Filter | See node parameters |
| Deduplicate Keep First | Code | Code | See node parameters |
| Deduplicate Keep Last | Code | Code | See node parameters |
| Send Duplicates to Trash | Files / media | Google Drive | deleteFile |
| No Operation, do nothing | Routing | No Op | See node parameters |
| Is Flagged | Routing | If | See node parameters |
| Google Drive Trigger | Trigger | Google Drive Trigger | See node parameters |
| Drop Google Apps files | Routing | Filter | See node parameters |
| Working Folder | Files / media | Google Drive | fileFolder |
| Google Drive | Files / media | Google Drive | update |
| Keep First/Last | Routing | Switch | See node parameters |
| Trash/Flag Duplicates | Routing | Switch | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
googleDriveOAuth2Api
Workflow notes
2. Configuration
2. Configuration
Choose the keep and action behavior of the workflow
- The keep parameter let's you decide whether to keep the first or last received file when duplicates are detected. (possible values:
first,last. Default:last) - The action parameter let's you decide what to do with the detected duplicates. Send them to the trash or flag them by renaming them with prefix DUPLICATE- (possible values:
trash,flag. Default:flag) flag already prexied by DUPLICATE- are not flagged again.
The parameters owner and folder are taken from the trigger and will probably never need to be changed:
- The folder points to the folder to work with. By default it is taken from the trigger.
- The owner parameter needs to match the owner of the files. The workflow only works with files owned by this user. It is specified with the user email and is taken from the first file owner of the trigger.
Working Folder
Working Folder
The "Working Folder" node let's you choose Files to deduplicate.
This workflow includes a filter to work on just 1 folder at depth level 1. It doesn't work with files in nested folders
You can remove the Folder filter to work on the entire drive instead or add different filters.
Discard found Google Apps documents
Discard found Google Apps documents
Docs, Sheets, Forms, Slides, Drawins etc. are discarded because they are not actual binary files and their content can't be directly checked.
1. Trigger Settings and Working Folder
1. Trigger Settings and Working Folder
When using Google Drive Trigger configure the Poll times and the Folder to work with.
By Default the trigger is configured to check for file uploads every 15 minutes.
When configured with a specific folder in the drive the workflow works only with files directly in the folder (It will not check/modify files in sub-folders).
When configured with the root (/) folder of the drive it will check all files in all folders and sub-folders so USE THIS WITH CAUTION since it might lead to trashing/renaming of important files.
In Google Drive Trashed files are kept for 30 days before being permanently deleted.
In Google Drive Trashed files are kept for 30 days before being permanently deleted.
They can be reviewed and restored during that 30 day interval.
Discard found Google Apps documents
Discard found Google Apps documents
Purpose and structure
This folder contains the Discard found Google Apps documents workflow. Its executable nodes use code, filter, googleDrive, googleDriveTrigger, if, noOp, set, switch. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
Google Drive Trigger
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/0848_Code_Filter_Update_Triggered.json MIT; preserve source notices.
Canvas section labels
These name areas of the original canvas; they do not include explanatory instructions.
- Files that already start with *DUPLICATE-* are not flagged again.