This workflow corresponds to n8n.io template #16625 — we link there as the canonical source.
This workflow follows the Documentdefaultdataloader → Google Gemini Embeddings recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "FkDrGfr9NlbzDG6a",
"name": "Google Drive to Pinecone RAG Sync Engine",
"tags": [],
"nodes": [
{
"id": "d070ff02-9aa2-4b7a-8055-57770e889bd5",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
32,
448
],
"parameters": {
"width": 480,
"height": 896,
"content": "## Google Drive to Pinecone RAG Sync Engine\n\n### How it works\n\nThis workflow runs on a schedule to keep a Pinecone vector index synchronized with files in Google Drive using a Google Sheets log as the source-of-truth for previous sync state. It compares current Drive files against the log, removes stale vector and log entries, downloads new or updated files, extracts text based on MIME type, maps metadata, and writes supported content into Pinecone with Gemini embeddings. After ingestion, it updates the sync log and performs a final reconciliation to clean up any remaining missing or overlapping records.\n\n### Setup steps\n\n- Configure Google Drive credentials and set the target Drive folder or query used by the file listing and download nodes.\n- Configure Google Sheets credentials and prepare the sync log sheet with columns for file id, name, modifiedTime, and any row identifiers required for updates/deletes.\n- Configure Pinecone credentials, index name, namespace, and vector dimensions to match the Gemini embedding model.\n- Configure Google Gemini embeddings credentials/API key and confirm the embedding model matches the Pinecone index dimension.\n- Set the HTTP Request delete endpoints and authentication headers for the vector deletion service used by the VectorDB cleanup nodes.\n- Review the schedule trigger interval and adjust it to the desired sync frequency.\n- Verify the MIME type switch routes all expected file types to the correct extraction branch.\n\n### Customization\n\nAdd or adjust MIME type branches for additional file formats, change chunking settings in the data loader, or modify the metadata fields in the value mapping nodes to include folder paths, owners, tags, or access-control information."
},
"typeVersion": 1
},
{
"id": "6c8dbcfc-6330-4240-a0b1-f9f55f71c0c4",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
592,
544
],
"parameters": {
"color": 7,
"width": 416,
"height": 528,
"content": "## Scheduled source inventory\n\nStarts the workflow on a schedule and fetches both the existing Google Sheets sync log and the current Google Drive file list for comparison."
},
"typeVersion": 1
},
{
"id": "8ac78381-388b-41f0-9045-cbc0674fd7a5",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1040,
656
],
"parameters": {
"color": 7,
"width": 416,
"height": 320,
"content": "## Detect file changes\n\nCombines the Drive inventory with the log and decides whether each file is new, updated, unchanged, or potentially deleted from Drive."
},
"typeVersion": 1
},
{
"id": "a795f8a6-f63c-41d6-83bd-dda6a95f9264",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1488,
464
],
"parameters": {
"color": 7,
"width": 864,
"height": 368,
"content": "## Prepare changed files\n\nHandles new or updated files by splitting them into individual items, deleting any previous vector entry, downloading the file from Drive, and routing it by MIME type."
},
"typeVersion": 1
},
{
"id": "6ba79a50-39ff-429f-b364-7c6ecb2e9b70",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1488,
864
],
"parameters": {
"color": 7,
"width": 640,
"height": 512,
"content": "## Clean deleted files\n\nProcesses files detected as removed from Google Drive by splitting them into items, deleting their vectors, and removing their rows from the sync log."
},
"typeVersion": 1
},
{
"id": "2bca8c79-38c0-4718-8eba-6ad562785ae3",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
2432,
224
],
"parameters": {
"color": 7,
"width": 368,
"height": 336,
"content": "## Extract PDF content\n\nExtracts text from PDF files and maps the result into normalized text and metadata fields for downstream indexing and logging."
},
"typeVersion": 1
},
{
"id": "30a62e59-587c-42b8-a3f0-d20b9fe2bfea",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
2432,
592
],
"parameters": {
"color": 7,
"width": 704,
"height": 320,
"content": "## Convert spreadsheet content\n\nProcesses XLSX files by extracting the spreadsheet, converting it into a file representation, extracting text from the converted file, and mapping standard metadata."
},
"typeVersion": 1
},
{
"id": "65fdab66-0603-436f-a95a-fb8485a04fc9",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
2432,
944
],
"parameters": {
"color": 7,
"width": 384,
"height": 320,
"content": "## Extract alternate files\n\nExtracts content from another routed file type and maps its text, id, name, and modified time for log updates."
},
"typeVersion": 1
},
{
"id": "80498450-4d39-4322-ae2f-238f53905c58",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
2432,
1296
],
"parameters": {
"color": 7,
"width": 384,
"height": 320,
"content": "## Extract generic files\n\nExtracts content from a generic file route and maps normalized text and metadata for Pinecone indexing and log updates."
},
"typeVersion": 1
},
{
"id": "1e289c66-e4ee-43fa-b525-bab9d0822fa8",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
3168,
624
],
"parameters": {
"color": 7,
"width": 384,
"height": 496,
"content": "## Index vectors in Pinecone\n\nStores mapped document content in Pinecone using Gemini embeddings and the default data loader/chunking configuration."
},
"typeVersion": 1
},
{
"id": "eea1a461-bc51-4a96-acf7-21ee527d3b9c",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
3168,
80
],
"parameters": {
"color": 7,
"width": 368,
"height": 512,
"content": "## Refresh sync state\n\nUpdates the Google Sheets log for processed files, then reloads the log and Drive inventory to prepare a final consistency check."
},
"typeVersion": 1
},
{
"id": "1cb705aa-13f1-43ed-a9fe-f0c128dc2d80",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
3584,
192
],
"parameters": {
"color": 7,
"width": 368,
"height": 512,
"content": "## Final cleanup reconciliation\n\nCompares the refreshed log and Drive file list, then deletes any remaining stale vectors and log rows found after ingestion."
},
"typeVersion": 1
},
{
"id": "1145deb2-b571-4ccf-a5e8-3ef388e2cc08",
"name": "Download from Google Drive",
"type": "n8n-nodes-base.googleDrive",
"position": [
1984,
624
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Split by ID').item.json.id }}"
},
"options": {
"binaryPropertyName": "fileData",
"googleFileConversion": {
"conversion": {
"docsToFormat": "text/plain",
"slidesToFormat": "application/pdf"
}
}
},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "3883357f-c5f6-4cdd-8b31-1a433115e376",
"name": "Extract Data from XLSX",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2480,
752
],
"parameters": {
"options": {},
"operation": "xlsx",
"binaryPropertyName": "fileData"
},
"typeVersion": 1.1
},
{
"id": "99409107-25d4-4572-8fd0-8c09f40cf53c",
"name": "Extract Text from PDF",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2480,
400
],
"parameters": {
"options": {},
"operation": "pdf",
"binaryPropertyName": "fileData"
},
"typeVersion": 1.1
},
{
"id": "010737d1-d71c-4c16-a6d0-f13c7583bc88",
"name": "Extract from General File",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2480,
1456
],
"parameters": {
"options": {},
"operation": "text",
"binaryPropertyName": "fileData"
},
"typeVersion": 1.1
},
{
"id": "abd01fb7-bfb6-49f2-8009-1407033292da",
"name": "Store Vectors in Pinecone",
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"position": [
3264,
784
],
"parameters": {
"mode": "insert",
"options": {},
"pineconeIndex": {
"__rl": true,
"mode": "list",
"value": "gdrive-rag",
"cachedResultName": "gdrive-rag"
}
},
"credentials": {
"pineconeApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "84554d91-9c8e-4318-87fd-fd7cd394fbf0",
"name": "Generate Embeddings with Gemini",
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
"position": [
3216,
960
],
"parameters": {
"modelName": "models/gemini-embedding-2"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "0fd13666-19e4-45d5-af4a-fcf3a71decc1",
"name": "Scheduled Trigger Every Minute",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
640,
816
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes"
}
]
}
},
"typeVersion": 1.3
},
{
"id": "08e31393-bed0-4fc5-9865-2c4d19c9e340",
"name": "Split by ID",
"type": "n8n-nodes-base.splitOut",
"position": [
1536,
624
],
"parameters": {
"include": "selectedOtherFields",
"options": {},
"fieldToSplitOut": "id",
"fieldsToInclude": "name, mimeType, modifiedTime"
},
"typeVersion": 1
},
{
"id": "d7aed713-8550-4a74-b00e-88dcb82742b3",
"name": "Split by File ID",
"type": "n8n-nodes-base.splitOut",
"position": [
1760,
1120
],
"parameters": {
"include": "selectedOtherFields",
"options": {},
"fieldToSplitOut": "file_id",
"fieldsToInclude": "name, mimeType, modifiedTime,row_number"
},
"typeVersion": 1
},
{
"id": "4374e07b-dee2-47d8-9373-b214642fb0c7",
"name": "Extract from Specialized File",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2480,
1104
],
"parameters": {
"options": {},
"operation": "text",
"binaryPropertyName": "fileData"
},
"typeVersion": 1.1
},
{
"id": "5b835004-ff6f-4854-b57c-1233f5562cf5",
"name": "Convert Data to File Format",
"type": "n8n-nodes-base.convertToFile",
"position": [
2656,
752
],
"parameters": {
"options": {},
"binaryPropertyName": "fileData"
},
"typeVersion": 1.1
},
{
"id": "ead9dcec-3ae0-4ea0-b84a-530a199045a6",
"name": "Extract Data Post-Conversion",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2832,
752
],
"parameters": {
"options": {},
"operation": "text",
"binaryPropertyName": "fileData"
},
"typeVersion": 1.1
},
{
"id": "2e15ba87-8c5c-40f5-88f1-f70bd5c1293b",
"name": "Merge by Missing or Overlap",
"type": "n8n-nodes-base.merge",
"position": [
1088,
816
],
"parameters": {
"mode": "combine",
"options": {},
"advanced": true,
"joinMode": "keepNonMatches",
"mergeByFields": {
"values": [
{
"field1": "file_id",
"field2": "id"
}
]
}
},
"typeVersion": 3.2,
"alwaysOutputData": true
},
{
"id": "b9d76ae6-39e0-45b3-a3c3-8bba32a37db5",
"name": "Check if File New or Updated",
"type": "n8n-nodes-base.if",
"position": [
1312,
816
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "5c2d91a4-5615-4ec0-99da-245d47d70aee",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $input.all().length === 1 && Object.keys($input.all()[0].json).length === 0 ? 0 : $input.all().length }}",
"rightValue": 0
},
{
"id": "fcea8006-cb70-4d5c-9abd-57a68618f7a0",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json._source }}",
"rightValue": "input2"
}
]
}
},
"typeVersion": 2.3
},
{
"id": "3737ea88-2ae5-4090-b30c-c9f5e330fd53",
"name": "Check if File Deleted",
"type": "n8n-nodes-base.if",
"position": [
1536,
1120
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "77b30782-086f-4921-9c8a-de688beb777d",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $input.all().length === 1 && Object.keys($input.all()[0].json).length === 0 ? 0 : $input.all().length }}",
"rightValue": "=0"
},
{
"id": "b373819c-e910-46ab-a3e6-55ea1c44c0f1",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Merge by Missing or Overlap').item.json._source }}",
"rightValue": "=input1"
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.3
},
{
"id": "4dcf4f29-de2a-40c4-a2f8-ec04ade154aa",
"name": "Post to VectorDB API for Deletion",
"type": "n8n-nodes-base.httpRequest",
"position": [
1984,
1024
],
"parameters": {
"url": "https://gdrive-rag-al6q3ox.svc.aped-4627-b74a.pinecone.io/vectors/delete",
"method": "POST",
"options": {},
"jsonBody": "={\n \"filter\": {\n \"file_id\": { \"$eq\": \"{{ $json.file_id }}\" }\n }\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Api-Key"
},
{
"name": "Content-Type ",
"value": "application/json"
}
]
}
},
"typeVersion": 4.4
},
{
"id": "2f05e84d-f2be-4db5-8b7a-02685597463c",
"name": "Delete Log Rows in Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
1984,
1216
],
"parameters": {
"operation": "delete",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw/edit?usp=drivesdk",
"cachedResultName": "rag_log"
},
"startIndex": "={{ $('Read Log for Overlap Check').item.json.row_number }}"
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "0fae581b-361c-4f8d-b8c0-7d6ee46902c4",
"name": "Post to VectorDB API - Remove File",
"type": "n8n-nodes-base.httpRequest",
"position": [
1760,
624
],
"parameters": {
"url": "https://gdrive-rag-al6q3ox.svc.aped-4627-b74a.pinecone.io/vectors/delete",
"method": "POST",
"options": {},
"jsonBody": "={\n \"filter\": {\n \"file_id\": { \"$eq\": \"{{ $json.id }}\" }\n }\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Api-Key"
},
{
"name": "Content-Type ",
"value": "application/json"
}
]
}
},
"typeVersion": 4.4
},
{
"id": "15674b94-c5ab-4ed4-a5a7-1a198ea7a2ac",
"name": "Route by File Type",
"type": "n8n-nodes-base.switch",
"position": [
2208,
592
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "PDF",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "70073599-e92d-4d5e-b5a8-330ed5a453a9",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Split by ID').item.json.mimeType }}",
"rightValue": "application/pdf"
}
]
},
"renameOutput": true
},
{
"outputKey": "XLSX",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b7641afb-339a-4bfe-98ed-b550c2c212d1",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Split by ID').item.json.mimeType }}",
"rightValue": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
]
},
"renameOutput": true
},
{
"outputKey": "Google Docs",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a3639aac-7182-4922-ac50-13c76f56abb4",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Split by ID').item.json.mimeType }}",
"rightValue": "application/vnd.google-apps.document"
}
]
},
"renameOutput": true
},
{
"outputKey": "Google Sheet",
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "6771edb1-9223-4b2c-9b16-4da7f4f3b7c1",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Split by ID').item.json.mimeType }}",
"rightValue": "application/vnd.google-apps.spreadsheet"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.4
},
{
"id": "f4746d59-8484-4f7f-8941-e0eb863f570d",
"name": "Set Fields for PDF Data",
"type": "n8n-nodes-base.set",
"position": [
2656,
400
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "6afb08d2-a642-4ed7-b49e-069e31bd99e5",
"name": "text",
"type": "string",
"value": "={{ $json.text }}"
},
{
"id": "dcf085dd-2d5f-49af-a539-9621ed61bc98",
"name": "id",
"type": "string",
"value": "={{ $('Split by ID').item.json.id }}"
},
{
"id": "1bb14e8e-80fa-4ef0-9edf-3a092837fc74",
"name": "name",
"type": "string",
"value": "={{ $('Split by ID').item.json.name }}"
},
{
"id": "856afb39-22b1-49c0-bb37-37c859e88c71",
"name": "modifiedTime",
"type": "string",
"value": "={{ $('Split by ID').item.json.mimeType }}"
},
{
"id": "c0240255-6ed5-4db2-9822-fc2d4da91aef",
"name": "mimeType",
"type": "string",
"value": "={{ $('Split by ID').item.json.mimeType }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "96d6bf01-4897-4684-a08e-ea743cef1411",
"name": "Set Fields for Converted Data",
"type": "n8n-nodes-base.set",
"position": [
2992,
752
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "6afb08d2-a642-4ed7-b49e-069e31bd99e5",
"name": "text",
"type": "string",
"value": "={{ $json.text }}"
},
{
"id": "dcf085dd-2d5f-49af-a539-9621ed61bc98",
"name": "id",
"type": "string",
"value": "={{ $('Split by ID').item.json.id }}"
},
{
"id": "1bb14e8e-80fa-4ef0-9edf-3a092837fc74",
"name": "name",
"type": "string",
"value": "={{ $('Split by ID').item.json.name }}"
},
{
"id": "856afb39-22b1-49c0-bb37-37c859e88c71",
"name": "modifiedTime",
"type": "string",
"value": "={{ $('Split by ID').item.json.mimeType }}"
},
{
"id": "c0240255-6ed5-4db2-9822-fc2d4da91aef",
"name": "mimeType",
"type": "string",
"value": "={{ $('Split by ID').item.json.mimeType }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "78865ef7-d917-4687-9878-6bfd720ef1da",
"name": "Set Fields for General File",
"type": "n8n-nodes-base.set",
"position": [
2672,
1456
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "6afb08d2-a642-4ed7-b49e-069e31bd99e5",
"name": "text",
"type": "string",
"value": "={{ $json.data }}"
},
{
"id": "dcf085dd-2d5f-49af-a539-9621ed61bc98",
"name": "id",
"type": "string",
"value": "={{ $('Split by ID').item.json.id }}"
},
{
"id": "1bb14e8e-80fa-4ef0-9edf-3a092837fc74",
"name": "name",
"type": "string",
"value": "={{ $('Split by ID').item.json.name }}"
},
{
"id": "856afb39-22b1-49c0-bb37-37c859e88c71",
"name": "modifiedTime",
"type": "string",
"value": "={{ $('Split by ID').item.json.modifiedTime }}"
},
{
"id": "a5a8a596-9da4-449e-b036-14a3bfdabafb",
"name": "mimeType",
"type": "string",
"value": "={{ $('Split by ID').item.json.mimeType }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ce4412b8-bfc4-4ef4-a9a7-ad2384e0d078",
"name": "Set Fields for Specialized File",
"type": "n8n-nodes-base.set",
"position": [
2672,
1104
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "6afb08d2-a642-4ed7-b49e-069e31bd99e5",
"name": "text",
"type": "string",
"value": "={{ $json.data }}"
},
{
"id": "dcf085dd-2d5f-49af-a539-9621ed61bc98",
"name": "id",
"type": "string",
"value": "={{ $('Split by ID').item.json.id }}"
},
{
"id": "1bb14e8e-80fa-4ef0-9edf-3a092837fc74",
"name": "name",
"type": "string",
"value": "={{ $('Split by ID').item.json.name }}"
},
{
"id": "856afb39-22b1-49c0-bb37-37c859e88c71",
"name": "modifiedTime",
"type": "string",
"value": "={{ $('Split by ID').item.json.modifiedTime }}"
},
{
"id": "a5a8a596-9da4-449e-b036-14a3bfdabafb",
"name": "mimeType",
"type": "string",
"value": "={{ $('Split by ID').item.json.mimeType }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "73f52c54-5ab7-4be4-8b80-8b3628c1fdae",
"name": "Append or Update Log in Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
3216,
304
],
"parameters": {
"columns": {
"value": {
"name": "={{ $('Split by ID').item.json.name }}",
"file_id": "={{ $('Split by ID').item.json.id }}",
"modifiedTIme": "={{ $('Split by ID').item.json.modifiedTime }}"
},
"schema": [
{
"id": "file_id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "file_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "name",
"type": "string",
"display": true,
"required": false,
"displayName": "name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "modifiedTIme",
"type": "string",
"display": true,
"required": false,
"displayName": "modifiedTIme",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"file_id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw/edit?usp=drivesdk",
"cachedResultName": "rag_log"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "ea62f22c-ff6d-48be-bf60-95ed6039b52a",
"name": "Read Log Rows in Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
3392,
256
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw/edit?usp=drivesdk",
"cachedResultName": "rag_log"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "ede41ebf-c7a8-4e8a-a20d-212ea9059a61",
"name": "Read Log for Overlap Check",
"type": "n8n-nodes-base.googleSheets",
"position": [
864,
720
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw/edit?usp=drivesdk",
"cachedResultName": "rag_log"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "3d1b94ce-bb8d-4b41-a39e-87b9e4ee0b05",
"name": "List Files from Google Drive",
"type": "n8n-nodes-base.googleDrive",
"position": [
864,
912
],
"parameters": {
"filter": {
"folderId": {
"__rl": true,
"mode": "list",
"value": "14AXrWfJMuKtrzDeWwG86EHXGh3KXLbMT",
"cachedResultUrl": "https://drive.google.com/drive/folders/14AXrWfJMuKtrzDeWwG86EHXGh3KXLbMT",
"cachedResultName": "belajar n8n"
}
},
"options": {
"fields": "={{ [\"id\",\"name\",\"mimeType\",\"modifiedTime\"] }}"
},
"resource": "fileFolder",
"returnAll": true,
"searchMethod": "query"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "9e168752-796d-4d00-b501-a0185b9f3fd2",
"name": "Retrieve Files for Log Update",
"type": "n8n-nodes-base.googleDrive",
"position": [
3392,
432
],
"parameters": {
"filter": {
"folderId": {
"__rl": true,
"mode": "list",
"value": "14AXrWfJMuKtrzDeWwG86EHXGh3KXLbMT",
"cachedResultUrl": "https://drive.google.com/drive/folders/14AXrWfJMuKtrzDeWwG86EHXGh3KXLbMT",
"cachedResultName": "belajar n8n"
}
},
"options": {},
"resource": "fileFolder",
"returnAll": true,
"searchMethod": "query"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "c2426bf6-16aa-44f2-aeb2-4cd99310f42b",
"name": "Remove File via VectorDB API",
"type": "n8n-nodes-base.httpRequest",
"position": [
3808,
368
],
"parameters": {
"url": "https://gdrive-rag-al6q3ox.svc.aped-4627-b74a.pinecone.io/vectors/delete",
"method": "POST",
"options": {},
"jsonBody": "={\n \"filter\": {\n \"file_id\": { \"$eq\": \"{{ $json.file_id }}\" }\n }\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Api-Key"
},
{
"name": "Content-Type ",
"value": "application/json"
}
]
}
},
"typeVersion": 4.4
},
{
"id": "79ffa854-7d05-4b9c-9978-30b4fb1bbed7",
"name": "Remove Rows in Log Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
3808,
544
],
"parameters": {
"operation": "delete",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/18toXypvo88zB0iPHfIh5V1P5AfglTqxg_YywI5qsITw/edit?usp=drivesdk",
"cachedResultName": "rag_log"
},
"startIndex": "={{ $('Combine Missing or Overlap Files').item.json.row_number }}"
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "e6dbde54-7c14-4397-8183-cf7e8e463aed",
"name": "Load and Chunk Default Data",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
3408,
960
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "file_id",
"value": "={{ $json.id }}"
},
{
"name": "name",
"value": "={{ $json.name }}"
},
{
"name": "modifiedTime",
"value": "={{ $json.modifiedTime }}"
},
{
"name": "mimeType",
"value": "={{ $json.mimeType }}"
}
]
}
},
"jsonData": "={{ $json.text }}",
"jsonMode": "expressionData"
},
"typeVersion": 1.1
},
{
"id": "e5c824e3-7673-498f-ba9c-aafec70fa965",
"name": "Combine Missing or Overlap Files",
"type": "n8n-nodes-base.merge",
"position": [
3632,
448
],
"parameters": {
"mode": "combine",
"options": {},
"advanced": true,
"joinMode": "keepNonMatches",
"mergeByFields": {
"values": [
{
"field1": "file_id",
"field2": "id"
}
]
},
"outputDataFrom": "input1"
},
"typeVersion": 3.2
}
],
"active": false,
"settings": {
"binaryMode": "separate",
"executionOrder": "v1"
},
"versionId": "9c2ab49b-b818-4174-9418-0ebd52d49181",
"connections": {
"Split by ID": {
"main": [
[
{
"node": "Post to VectorDB API - Remove File",
"type": "main",
"index": 0
}
]
]
},
"Split by File ID": {
"main": [
[
{
"node": "Post to VectorDB API for Deletion",
"type": "main",
"index": 0
},
{
"node": "Delete Log Rows in Sheets",
"type": "main",
"index": 0
}
]
]
},
"Route by File Type": {
"main": [
[
{
"node": "Extract Text from PDF",
"type": "main",
"index": 0
}
],
[
{
"node": "Extract Data from XLSX",
"type": "main",
"index": 0
}
],
[
{
"node": "Extract from Specialized File",
"type": "main",
"index": 0
}
],
[
{
"node": "Extract from General File",
"type": "main",
"index": 0
}
]
]
},
"Check if File Deleted": {
"main": [
[
{
"node": "Split by File ID",
"type": "main",
"index": 0
}
]
]
},
"Extract Text from PDF": {
"main": [
[
{
"node": "Set Fields for PDF Data",
"type": "main",
"index": 0
}
]
]
},
"Extract Data from XLSX": {
"main": [
[
{
"node": "Convert Data to File Format",
"type": "main",
"index": 0
}
]
]
},
"Read Log Rows in Sheets": {
"main": [
[
{
"node": "Combine Missing or Overlap Files",
"type": "main",
"index": 0
}
]
]
},
"Set Fields for PDF Data": {
"main": [
[
{
"node": "Store Vectors in Pinecone",
"type": "main",
"index": 0
},
{
"node": "Append or Update Log in Sheets",
"type": "main",
"index": 0
}
]
]
},
"Extract from General File": {
"main": [
[
{
"node": "Set Fields for General File",
"type": "main",
"index": 0
}
]
]
},
"Download from Google Drive": {
"main": [
[
{
"node": "Route by File Type",
"type": "main",
"index": 0
}
]
]
},
"Read Log for Overlap Check": {
"main": [
[
{
"node": "Merge by Missing or Overlap",
"type": "main",
"index": 0
}
]
]
},
"Convert Data to File Format": {
"main": [
[
{
"node": "Extract Data Post-Conversion",
"type": "main",
"index": 0
}
]
]
},
"Load and Chunk Default Data": {
"ai_document": [
[
{
"node": "Store Vectors in Pinecone",
"type": "ai_document",
"index": 0
}
]
]
},
"Merge by Missing or Overlap": {
"main": [
[
{
"node": "Check if File New or Updated",
"type": "main",
"index": 0
}
]
]
},
"Set Fields for General File": {
"main": [
[
{
"node": "Store Vectors in Pinecone",
"type": "main",
"index": 0
},
{
"node": "Append or Update Log in Sheets",
"type": "main",
"index": 0
}
]
]
},
"Check if File New or Updated": {
"main": [
[
{
"node": "Split by ID",
"type": "main",
"index": 0
}
],
[
{
"node": "Check if File Deleted",
"type": "main",
"index": 0
}
]
]
},
"Extract Data Post-Conversion": {
"main": [
[
{
"node": "Set Fields for Converted Data",
"type": "main",
"index": 0
}
]
]
},
"List Files from Google Drive": {
"main": [
[
{
"node": "Merge by Missing or Overlap",
"type": "main",
"index": 1
}
]
]
},
"Extract from Specialized File": {
"main": [
[
{
"node": "Set Fields for Specialized File",
"type": "main",
"index": 0
}
]
]
},
"Retrieve Files for Log Update": {
"main": [
[
{
"node": "Combine Missing or Overlap Files",
"type": "main",
"index": 1
}
]
]
},
"Set Fields for Converted Data": {
"main": [
[
{
"node": "Store Vectors in Pinecone",
"type": "main",
"index": 0
},
{
"node": "Append or Update Log in Sheets",
"type": "main",
"index": 0
}
]
]
},
"Append or Update Log in Sheets": {
"main": [
[
{
"node": "Read Log Rows in Sheets",
"type": "main",
"index": 0
},
{
"node": "Retrieve Files for Log Update",
"type": "main",
"index": 0
}
]
]
},
"Scheduled Trigger Every Minute": {
"main": [
[
{
"node": "List Files from Google Drive",
"type": "main",
"index": 0
},
{
"node": "Read Log for Overlap Check",
"type": "main",
"index": 0
}
]
]
},
"Generate Embeddings with Gemini": {
"ai_embedding": [
[
{
"node": "Store Vectors in Pinecone",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Set Fields for Specialized File": {
"main": [
[
{
"node": "Append or Update Log in Sheets",
"type": "main",
"index": 0
}
]
]
},
"Combine Missing or Overlap Files": {
"main": [
[
{
"node": "Remove File via VectorDB API",
"type": "main",
"index": 0
},
{
"node": "Remove Rows in Log Sheets",
"type": "main",
"index": 0
}
]
]
},
"Post to VectorDB API - Remove File": {
"main": [
[
{
"node": "Download from Google Drive",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleDriveOAuth2ApigooglePalmApigoogleSheetsOAuth2ApipineconeApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow runs on a schedule to sync files from a Google Drive folder into a Pinecone vector index for RAG, extracting text from PDFs, XLSX, Google Docs, and spreadsheets, generating embeddings with Google Gemini, and tracking file state in a Google Sheets log to handle…
Source: https://n8n.io/workflows/16625/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
WooriFisa 최종. Uses memoryMongoDbChat, agent, httpRequest, documentDefaultDataLoader. Scheduled trigger; 68 nodes.
This simple philosophy changes the way we think about automated sales agents. Context changes everything. In this 4-part workflow, we start by creating a knowledge base that will act as context across
Tech Radar. Uses googleDrive, documentDefaultDataLoader, stickyNote, mySql. Scheduled trigger; 53 nodes.
This project is built on top of the famous open source ThoughtWorks Tech Radar.
This workflow ingests educational PDF URLs from Google Sheets, extracts and chunks their text, generates embeddings with Google Gemini, and stores them in a Supabase pgvector table for retrieval, whil