Google Drive output duplicate

Describe the issue/error/question

Google Drive list files outputs x2-x3 duplicate of the files and increases after each run

What is the error message (if any)?

Please share the workflow

Share the output returned by the last node

{ "name": "BL Shorts from GDrive -> AWS -> Sheets -> Sociamonials", "nodes": [ { "parameters": {}, "name": "Start", "type": "n8n-nodes-base.start", "typeVersion": 1, "position": [ 80, 1080 ] }, { "parameters": { "resource": "databasePage", "operation": "getAll", "databaseId": "8e44efcd-3dfc-4380-b070-40ff1aa5c8a0", "returnAll": true, "filterType": "manual", "filters": { "conditions": [ { "key": "Drive Shorts|url", "condition": "is_not_empty" }, { "key": "Short Status |select", "condition": "equals", "selectValue": "đź“… Schedule Shorts" } ] }, "options": { "downloadFiles": false } }, "name": "Notion", "type": "n8n-nodes-base.notion", "typeVersion": 2, "position": [ 220, 1080 ], "credentials": { "notionApi": { "id": "2", "name": "Notion account" } } }, { "parameters": { "authentication": "oAuth2", "operation": "list", "useQueryString": true, "queryString": "='{{$node[\"Notion\"].json[\"property_drive_shorts\"].slice(39,-12)}}' in parents and mimeType !='application/vnd.google-apps.folder'", "options": {} }, "name": "Google Drive", "type": "n8n-nodes-base.googleDrive", "typeVersion": 1, "position": [ 380, 1080 ], "executeOnce": true, "credentials": { "googleDriveOAuth2Api": { "id": "8", "name": "Google Drive account" } } }, { "parameters": { "authentication": "oAuth2", "operation": "append", "sheetId": "1wmQ-BaqMxFF8ORs6g7p4TSrzeftOizZCv9Jg-2J2V6g", "range": "A1:J", "options": { "valueInputMode": "USER_ENTERED" } }, "name": "Google Sheets1", "type": "n8n-nodes-base.googleSheets", "typeVersion": 1, "position": [ 700, 920 ], "credentials": { "googleSheetsOAuth2Api": { "id": "9", "name": "Google Sheets account" } } }, { "parameters": { "operation": "upload", "bucketName": "beeloud", "fileName": "={{$json[\"name\"]}}", "additionalFields": { "parentFolderKey": "={{$node[\"Notion\"].json[\"name\"]+\" shorts\"}}", "serverSideEncryption": "AES256" }, "tagsUi": { "tagsValues": [ { "key": "source", "value": "gdrive" } ] } }, "name": "AWS S3NaN", "type": "n8n-nodes-base.awsS3", "position": [ 860, 1080 ], "typeVersion": 1, "credentials": { "aws": { "id": "3", "name": "AWS account" } } }, { "parameters": { "authentication": "oAuth2", "operation": "download", "fileId": "={{$json[\"id\"]}}", "options": {} }, "name": "Google Drive1", "type": "n8n-nodes-base.googleDrive", "typeVersion": 1, "position": [ 700, 1080 ], "credentials": { "googleDriveOAuth2Api": { "id": "8", "name": "Google Drive account" } } }, { "parameters": { "batchSize": 1, "options": {} }, "name": "SplitInBatches", "type": "n8n-nodes-base.splitInBatches", "typeVersion": 1, "position": [ 560, 1080 ] }, { "parameters": { "values": { "string": [ { "name": "VideoURL", "value": "=https://beeloud.s3.us-west-2.amazonaws.com/{{encodeURI($node[\"Notion\"].json[\"property_name\"] + \" shorts\")}}/{{encodeURI($node[\"Google Drive\"].json[\"name\"])}}" }, { "name": "Message", "value": "={{$node[\"Google Drive\"].json[\"name\"].replace('.mp4','')}}" }, { "name": "Category", "value": "BeeLoud" }, { "name": "PinTitle", "value": "={{$node[\"Google Drive\"].json[\"name\"].replace('.mp4','')}}" } ], "number": [ { "name": "Year", "value": 2022 } ] }, "options": { "dotNotation": false } }, "name": "Set1", "type": "n8n-nodes-base.set", "typeVersion": 1, "position": [ 560, 920 ], "executeOnce": false } ], "connections": { "Start": { "main": [ [ { "node": "Notion", "type": "main", "index": 0 } ] ] }, "Notion": { "main": [ [ { "node": "Google Drive", "type": "main", "index": 0 } ] ] }, "Google Drive": { "main": [ [ { "node": "SplitInBatches", "type": "main", "index": 0 }, { "node": "Set1", "type": "main", "index": 0 } ] ] }, "AWS S3NaN": { "main": [ [ { "node": "SplitInBatches", "type": "main", "index": 0 } ] ] }, "Google Drive1": { "main": [ [ { "node": "AWS S3NaN", "type": "main", "index": 0 } ] ] }, "SplitInBatches": { "main": [ [ { "node": "Google Drive1", "type": "main", "index": 0 } ] ] }, "Set1": { "main": [ [ { "node": "Google Sheets1", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": {}, "id": 1, "tags": [] }

Image of output

There’s only 10 items but the output is 30 and increases after each run

Information on your n8n setup

  • **n8n version:**0.182
  • Database you’re using (default: SQLite):
  • **Running n8n with the execution process [own(default), main]:**own
  • **Running n8n via [Docker, npm, n8n.cloud, desktop app]:**desktop

Hey @pooria,

How many items are coming out of the Notion node? The node will run once for each input item so if you had 10 items but the Notion node is outputting 3 items you will get runs and 30 items out of the Drive node.

So from the Notion node @Jon only the LINK to the google drive URL is being used - the output is just a notion row and we use the URL to navigate to that folder to list files in there.

But is it just one item that is displayed in n8n or does it say 3?

Just one :slight_smile:

That is odd, I hae just taken a look at your screenshot of the Google data and it looks like Google is returning all that info as they all have different IDs.

Do you have multiple copies of that data in the drive at all? I can’t think of why else it would be returned. As a temporary solution you might be able to merge on name but I wouldn’t know which ID is the correct one.

Yeah it’s super weird.

On another note: How can I bulk rename Google drive files?

To remove special characters AND change spaces to “_” (underscore)

In Google Drive?

You could try using the update option in the Drive node and for the name putting something like {{$json["file_name_key"].replace(' ', '_')}}

Interesting. It seems the update option for the Drive is just for “Drive” not “Files”. :grinning:

Replace is a good idea, split also works