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 →
{
"createdAt": "2025-07-01T11:45:05.466Z",
"updatedAt": "2025-10-13T10:21:16.720Z",
"id": "5OuiZIQzm4A7nXRL",
"name": "contoh-rag-embedding",
"active": false,
"isArchived": true,
"nodes": [
{
"parameters": {
"jsonMode": "expressionData",
"jsonData": "={{ $json.data || $json.text || $json.concatenated_data }}",
"options": {
"metadata": {
"metadataValues": [
{
"name": "=file_id",
"value": "={{ $('Set File ID').first().json.file_id }}"
},
{
"name": "file_title",
"value": "={{ $('Set File ID').first().json.file_title }}"
}
]
}
}
},
"id": "d6dbfa30-343a-43da-b794-d02939279fd7",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"typeVersion": 1,
"position": [
2300,
420
]
},
{
"parameters": {
"content": "## Tool to Add a Google Drive File to Vector DB",
"height": 867,
"width": 3073,
"color": 5
},
"id": "59290baa-9f17-4a0c-896b-0927b1959b6a",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-440,
-180
]
},
{
"parameters": {
"operation": "download",
"fileId": {
"__rl": true,
"value": "={{ $('Set File ID').item.json.file_id }}",
"mode": "id"
},
"options": {
"googleFileConversion": {
"conversion": {
"docsToFormat": "text/plain"
}
}
}
},
"id": "357c581b-cbad-48b3-b19c-bcdb5c691ca1",
"name": "Download File",
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 3,
"position": [
640,
100
],
"executeOnce": true,
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"value": "1t2KayTYHE-npFSL59WcUKCaNbGHbkhMW",
"mode": "list",
"cachedResultName": "skripsi-json-data",
"cachedResultUrl": "https://drive.google.com/drive/folders/1t2KayTYHE-npFSL59WcUKCaNbGHbkhMW"
},
"event": "fileCreated",
"options": {}
},
"id": "652d1126-1887-48e1-a14a-1442ade1787b",
"name": "File Created",
"type": "n8n-nodes-base.googleDriveTrigger",
"typeVersion": 1,
"position": [
-380,
-60
],
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"value": "1t2KayTYHE-npFSL59WcUKCaNbGHbkhMW",
"mode": "list",
"cachedResultName": "skripsi-json-data",
"cachedResultUrl": "https://drive.google.com/drive/folders/1t2KayTYHE-npFSL59WcUKCaNbGHbkhMW"
},
"event": "fileUpdated",
"options": {}
},
"id": "9704ef7e-379e-41f3-8cfd-e0cfdeb63224",
"name": "File Updated",
"type": "n8n-nodes-base.googleDriveTrigger",
"typeVersion": 1,
"position": [
-380,
100
],
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "text",
"options": {}
},
"id": "aabefc97-e771-439e-8510-4b3f05cfe528",
"name": "Extract Document Text",
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
1500,
420
],
"alwaysOutputData": true
},
{
"parameters": {
"operation": "delete",
"tableId": "documents",
"filterType": "string",
"filterString": "=metadata->>file_id=like.*{{ $json.file_id }}*"
},
"id": "8037a578-1b8c-4790-9577-05ba74cb5bdb",
"name": "Delete Old Doc Rows",
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
160,
-60
],
"alwaysOutputData": true,
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "10646eae-ae46-4327-a4dc-9987c2d76173",
"name": "file_id",
"value": "={{ $json.id }}",
"type": "string"
},
{
"id": "f4536df5-d0b1-4392-bf17-b8137fb31a44",
"name": "file_type",
"value": "={{ $json.mimeType }}",
"type": "string"
},
{
"id": "77d782de-169d-4a46-8a8e-a3831c04d90f",
"name": "file_title",
"value": "={{ $json.name }}",
"type": "string"
},
{
"id": "9bde4d7f-e4f3-4ebd-9338-dce1350f9eab",
"name": "file_url",
"value": "={{ $json.webViewLink }}",
"type": "string"
}
]
},
"options": {}
},
"id": "97a038cb-f952-4894-94a9-424044281d45",
"name": "Set File ID",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-20,
100
]
},
{
"parameters": {
"operation": "pdf",
"options": {}
},
"id": "e14654e7-892d-494f-88d7-a52f9d4c339d",
"name": "Extract PDF Text",
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
1500,
-140
]
},
{
"parameters": {
"aggregate": "aggregateAllItemData",
"options": {}
},
"id": "cded57a5-b529-42b2-8778-0c83a8c7ce8b",
"name": "Aggregate",
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
1540,
40
]
},
{
"parameters": {},
"id": "98a2f1f9-154f-46eb-a59f-2a5e1478e631",
"name": "Character Text Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
"typeVersion": 1,
"position": [
2200,
540
]
},
{
"parameters": {
"fieldsToSummarize": {
"values": [
{
"aggregation": "concatenate",
"field": "data"
}
]
},
"options": {}
},
"id": "b83a87c3-6d8f-496c-8f4b-74c99ad95094",
"name": "Summarize",
"type": "n8n-nodes-base.summarize",
"typeVersion": 1,
"position": [
1740,
120
]
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"leftValue": "={{ $('Set File ID').item.json.file_type }}",
"rightValue": "application/pdf",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "2ae7faa7-a936-4621-a680-60c512163034",
"leftValue": "={{ $('Set File ID').item.json.file_type }}",
"rightValue": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "fc193b06-363b-4699-a97d-e5a850138b0e",
"leftValue": "={{ $('Set File ID').item.json.file_type }}",
"rightValue": "=application/vnd.google-apps.spreadsheet",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "b69f5605-0179-4b02-9a32-e34bb085f82d",
"leftValue": "={{ $('Set File ID').item.json.file_type }}",
"rightValue": "application/vnd.google-apps.document",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
}
]
},
"options": {
"fallbackOutput": 3
}
},
"id": "259e53f6-ab3b-410c-bb22-ff7b7e1f3f64",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"typeVersion": 3,
"position": [
840,
80
]
},
{
"parameters": {
"mode": "insert",
"tableName": {
"__rl": true,
"value": "documents",
"mode": "list",
"cachedResultName": "documents"
},
"options": {
"queryName": "match_documents"
}
},
"id": "72c9381a-2c21-44d9-9c0d-672a3e2294b9",
"name": "Insert into Supabase Vectorstore",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"typeVersion": 1,
"position": [
2220,
200
],
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "xlsx",
"options": {}
},
"id": "7ddc5802-3eb2-4b0d-a4ab-e646c1113d70",
"name": "Extract from Excel",
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
1320,
40
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "f422e2e0-381c-46ea-8f38-3f58c501d8b9",
"name": "schema",
"value": "={{ $('Extract from Excel').isExecuted ? $('Extract from Excel').first().json.keys().toJsonString() : $('Extract from CSV').first().json.keys().toJsonString() }}",
"type": "string"
},
{
"id": "bb07c71e-5b60-4795-864c-cc3845b6bc46",
"name": "data",
"value": "={{ $json.concatenated_data }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2180,
-20
],
"id": "e500e9e7-e0ee-460c-86d4-fc9c330f6949",
"name": "Set Schema"
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
1320,
220
],
"id": "d9288f59-eb79-4a2d-b988-5c50005443e9",
"name": "Extract from CSV"
},
{
"parameters": {
"options": {
"reset": false
}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
-200,
-60
],
"id": "08384f74-fe7e-4b0a-abbb-4ed5f89b98cc",
"name": "Loop Over Items"
},
{
"parameters": {
"operation": "delete",
"tableId": "document_rows",
"filters": {
"conditions": [
{
"keyName": "dataset_id",
"condition": "eq",
"keyValue": "={{ $('Set File ID').item.json.file_id }}"
}
]
}
},
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
320,
100
],
"id": "2af32d07-3866-4c69-9df1-329e6faf6291",
"name": "Delete Old Data Rows",
"alwaysOutputData": true,
"executeOnce": true,
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "upsert",
"schema": {
"__rl": true,
"mode": "list",
"value": "public"
},
"table": {
"__rl": true,
"value": "document_metadata",
"mode": "list",
"cachedResultName": "document_metadata"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"id": "={{ $('Set File ID').item.json.file_id }}",
"title": "={{ $('Set File ID').item.json.file_title }}",
"url": "={{ $('Set File ID').item.json.file_url }}"
},
"matchingColumns": [
"id"
],
"schema": [
{
"id": "id",
"displayName": "id",
"required": true,
"defaultMatch": true,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "title",
"displayName": "title",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": false
},
{
"id": "url",
"displayName": "url",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": false,
"removed": false
},
{
"id": "created_at",
"displayName": "created_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": false
},
{
"id": "schema",
"displayName": "schema",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": false,
"removed": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.5,
"position": [
480,
-40
],
"id": "f4a9b5e8-4b10-465b-8ea1-26bd53cd0001",
"name": "Insert Document Metadata",
"executeOnce": true,
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"schema": {
"__rl": true,
"mode": "list",
"value": "public"
},
"table": {
"__rl": true,
"value": "document_rows",
"mode": "list",
"cachedResultName": "document_rows"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"dataset_id": "={{ $('Set File ID').item.json.file_id }}",
"row_data": "={{ $json.toJsonString().replaceAll(/'/g, \"''\") }}"
},
"matchingColumns": [
"id"
],
"schema": [
{
"id": "id",
"displayName": "id",
"required": false,
"defaultMatch": true,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "dataset_id",
"displayName": "dataset_id",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "row_data",
"displayName": "row_data",
"required": false,
"defaultMatch": false,
"display": true,
"type": "object",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.5,
"position": [
1540,
220
],
"id": "f04f8bbd-c472-4e0a-865e-885a75d2c8b1",
"name": "Insert Table Rows",
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "upsert",
"schema": {
"__rl": true,
"mode": "list",
"value": "public"
},
"table": {
"__rl": true,
"value": "document_metadata",
"mode": "list",
"cachedResultName": "document_metadata"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"id": "={{ $('Set File ID').item.json.file_id }}",
"schema": "={{ $json.schema }}"
},
"matchingColumns": [
"id"
],
"schema": [
{
"id": "id",
"displayName": "id",
"required": true,
"defaultMatch": true,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "title",
"displayName": "title",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": false,
"removed": true
},
{
"id": "url",
"displayName": "url",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": false,
"removed": true
},
{
"id": "created_at",
"displayName": "created_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": false
},
{
"id": "schema",
"displayName": "schema",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": false,
"removed": false
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.5,
"position": [
2400,
-20
],
"id": "9c34aa16-b7d2-4b24-923a-f684e96fc936",
"name": "Update Schema for Document Metadata",
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
"typeVersion": 1,
"position": [
2080,
420
],
"id": "4d720760-cdbd-4704-99fd-7504ed97481a",
"name": "Embeddings Google Gemini",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"Default Data Loader": {
"ai_document": [
[
{
"node": "Insert into Supabase Vectorstore",
"type": "ai_document",
"index": 0
}
]
]
},
"Download File": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"File Created": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"File Updated": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Extract Document Text": {
"main": [
[
{
"node": "Insert into Supabase Vectorstore",
"type": "main",
"index": 0
}
]
]
},
"Delete Old Doc Rows": {
"main": [
[
{
"node": "Delete Old Data Rows",
"type": "main",
"index": 0
}
]
]
},
"Set File ID": {
"main": [
[
{
"node": "Delete Old Doc Rows",
"type": "main",
"index": 0
}
]
]
},
"Extract PDF Text": {
"main": [
[
{
"node": "Insert into Supabase Vectorstore",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Summarize",
"type": "main",
"index": 0
}
]
]
},
"Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Summarize": {
"main": [
[
{
"node": "Set Schema",
"type": "main",
"index": 0
},
{
"node": "Insert into Supabase Vectorstore",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Extract PDF Text",
"type": "main",
"index": 0
}
],
[
{
"node": "Extract from Excel",
"type": "main",
"index": 0
}
],
[
{
"node": "Extract from CSV",
"type": "main",
"index": 0
}
],
[
{
"node": "Extract Document Text",
"type": "main",
"index": 0
}
]
]
},
"Insert into Supabase Vectorstore": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Extract from Excel": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
},
{
"node": "Insert Table Rows",
"type": "main",
"index": 0
}
]
]
},
"Set Schema": {
"main": [
[
{
"node": "Update Schema for Document Metadata",
"type": "main",
"index": 0
}
]
]
},
"Extract from CSV": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
},
{
"node": "Insert Table Rows",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Set File ID",
"type": "main",
"index": 0
}
]
]
},
"Delete Old Data Rows": {
"main": [
[
{
"node": "Insert Document Metadata",
"type": "main",
"index": 0
}
]
]
},
"Insert Document Metadata": {
"main": [
[
{
"node": "Download File",
"type": "main",
"index": 0
}
]
]
},
"Embeddings Google Gemini": {
"ai_embedding": [
[
{
"node": "Insert into Supabase Vectorstore",
"type": "ai_embedding",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"staticData": null,
"meta": {
"templateCredsSetupCompleted": true
},
"versionId": "292f3a3b-1685-422d-adf1-84c80ad69bc6",
"triggerCount": 0,
"shared": [
{
"createdAt": "2025-10-13T10:29:43.656Z",
"updatedAt": "2025-10-13T10:29:43.656Z",
"role": "workflow:owner",
"workflowId": "5OuiZIQzm4A7nXRL",
"projectId": "FX62idw1VcxEmrbL"
}
],
"tags": []
}
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.
googleDriveOAuth2ApigooglePalmApipostgressupabaseApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
contoh-rag-embedding. Uses documentDefaultDataLoader, googleDrive, googleDriveTrigger, supabase. Event-driven trigger; 23 nodes.
Source: https://github.com/Cleign1/n8n-workflow/blob/a61ffba17b8c5342d4fbd06f89962a0fc22db3ce/contoh-rag-embedding-.json — 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.
My workflow 2529. Uses lmChatOpenAi, documentDefaultDataLoader, embeddingsOpenAi, googleDrive. Event-driven trigger; 54 nodes.
05. Base_To_Copy. Uses lmChatOpenAi, documentDefaultDataLoader, embeddingsOpenAi, googleDrive. Event-driven trigger; 54 nodes.
OIL Rag. Uses lmChatOpenAi, embeddingsOpenAi, agent, telegramTrigger. Event-driven trigger; 53 nodes.
Exact-Recall-Across-Collections. Uses supabase, postgres, documentDefaultDataLoader, textSplitterCharacterTextSplitter. Event-driven trigger; 49 nodes.
This n8n workflow automates the process of ingesting files from Google Drive into a Supabase database, preparing them for a knowledge base system. It supports text-based files (PDF, DOCX, TXT, etc.) a