RAG-System V2 - Dokumentaktualisierung
Experte
Dies ist ein Document Extraction, AI RAG-Bereich Automatisierungsworkflow mit 22 Nodes. Hauptsächlich werden If, Set, Limit, Switch, Supabase und andere Nodes verwendet. RAG-System in Supabase-Vektordatenbank durch Google Drive-Dateiänderungen aktuell halten
Voraussetzungen
- •Supabase URL und API Key
- •Google Drive API-Anmeldedaten
- •Möglicherweise sind Ziel-API-Anmeldedaten erforderlich
- •OpenAI API Key
Verwendete Nodes (22)
Kategorie
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
"id": "YVAwvooLBNvqFhyp",
"meta": {
"instanceId": "90587241b61f532dbe71be441310f86b24bd62a247fd87ce3f4b074464fa220d",
"templateCredsSetupCompleted": true
},
"name": "RAG System V2 - Update Doc",
"tags": [
{
"id": "X3XA7mO6MQZQ8uNT",
"name": "RAG",
"createdAt": "2024-12-23T14:38:50.002Z",
"updatedAt": "2024-12-23T14:38:50.002Z"
},
{
"id": "bQac7pgkCzmq5Nt5",
"name": "template",
"createdAt": "2025-01-14T11:43:47.391Z",
"updatedAt": "2025-01-14T11:43:47.391Z"
},
{
"id": "pms2jtgY49JCgVDW",
"name": "chatbot",
"createdAt": "2024-12-19T04:39:23.549Z",
"updatedAt": "2024-12-19T04:39:23.549Z"
}
],
"nodes": [
{
"id": "f57918de-1d00-432b-b352-b6013118664a",
"name": "Setzen File ID",
"type": "n8n-nodes-base.set",
"position": [
220,
2200
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "10646eae-ae46-4327-a4dc-9987c2d76173",
"name": "file_id",
"type": "string",
"value": "={{ $('File Updated').item.json.id }}"
},
{
"id": "f4536df5-d0b1-4392-bf17-b8137fb31a44",
"name": "file_type",
"type": "string",
"value": "={{ $('File Updated').item.json.mimeType }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "2899dfbc-2fba-4f35-9805-384dc30eebab",
"name": "Delete Old Doc Rows",
"type": "n8n-nodes-base.supabase",
"position": [
600,
2200
],
"parameters": {
"tableId": "documents",
"operation": "delete",
"filterType": "string",
"filterString": "=metadata->>file_id=like.*{{ $('Set File ID').item.json.file_id }}*"
},
"credentials": {
"supabaseApi": {
"id": "J5U7ge3sFHh1WYka",
"name": "Supabase API"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "aae30af6-491e-48f7-89cb-b6dd2ed5ed9e",
"name": "Datei herunterladen",
"type": "n8n-nodes-base.googleDrive",
"position": [
1540,
2360
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Set File ID').item.json.file_id }}"
},
"options": {
"googleFileConversion": {
"conversion": {
"docsToFormat": "text/plain"
}
}
},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "yGiuxvKzLUzVYa2d",
"name": "Google Drive account"
}
},
"executeOnce": true,
"typeVersion": 3
},
{
"id": "efdfe418-a0bc-4db1-87e2-5558f00a48ec",
"name": "If",
"type": "n8n-nodes-base.if",
"onError": "continueRegularOutput",
"position": [
380,
2200
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "928b5cae-77cd-48a2-81ef-2f76dc441b0a",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('File Updated').item.json.mimeType }}",
"rightValue": "application/vnd.google-apps.document"
},
{
"id": "6368b5ad-32b0-491d-a27d-5cc3ad5c2a11",
"operator": {
"type": "number",
"operation": "lt"
},
"leftValue": "={{ ((Date.now() - Date.parse($('File Updated').item.json.createdTime)) / 1000) }}",
"rightValue": 60
}
]
}
},
"typeVersion": 2.2
},
{
"id": "19edee69-a34b-48c7-8f2e-c2547fb226ff",
"name": "Aggregieren",
"type": "n8n-nodes-base.aggregate",
"position": [
2300,
2300
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData"
},
"typeVersion": 1
},
{
"id": "93ddcfd1-9320-4808-b636-ae28664f41a8",
"name": "Zusammenfassen",
"type": "n8n-nodes-base.summarize",
"position": [
2500,
2300
],
"parameters": {
"options": {},
"fieldsToSummarize": {
"values": [
{
"field": "data",
"aggregation": "concatenate"
}
]
}
},
"typeVersion": 1
},
{
"id": "f864d1f7-39a2-4d36-9dc5-d75fcc08ba7d",
"name": "Extract PDF Text1",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2100,
1960
],
"parameters": {
"options": {},
"operation": "pdf"
},
"typeVersion": 1
},
{
"id": "32d1f985-b143-451e-a6d1-bf3da9f568a1",
"name": "Extract from Excel1",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2100,
2300
],
"parameters": {
"options": {},
"operation": "xlsx"
},
"typeVersion": 1
},
{
"id": "2ea2790c-f4ab-4c59-b4b6-0a22e8047f48",
"name": "Convert to Google Doc2",
"type": "n8n-nodes-base.httpRequest",
"position": [
2100,
2500
],
"parameters": {
"url": "=https://www.googleapis.com/drive/v3/files/{{ $('Set File ID').item.json.file_id }}/copy",
"method": "POST",
"options": {},
"sendBody": true,
"authentication": "predefinedCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "name",
"value": "={{ $('Set File ID').item.json.name }}"
},
{
"name": "mimeType",
"value": "application/vnd.google-apps.document"
}
]
},
"nodeCredentialType": "googleDriveOAuth2Api"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "yGiuxvKzLUzVYa2d",
"name": "Google Drive account"
}
},
"typeVersion": 4.1
},
{
"id": "69166736-3369-4a33-8543-fae475344593",
"name": "Delete File1",
"type": "n8n-nodes-base.googleDrive",
"position": [
2300,
2500
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Set File ID').item.json.file_id }}"
},
"options": {},
"operation": "deleteFile"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "yGiuxvKzLUzVYa2d",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "e2574cdd-5d41-4be1-bca5-370d2a8e2ee2",
"name": "Recursive Character Text Splitter1",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
3080,
2420
],
"parameters": {
"options": {},
"chunkSize": 2000,
"chunkOverlap": 200
},
"typeVersion": 1
},
{
"id": "7dfe4ffd-0fda-4f7d-a005-4e4e9a62048e",
"name": "Einbettungen OpenAI2",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
2820,
2280
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "9SPpIIxBvgYPZlo8",
"name": "OpenAi account"
}
},
"typeVersion": 1.1
},
{
"id": "394d1238-bf7c-4882-b3ac-6db474140854",
"name": "Haftnotiz3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-120,
1820
],
"parameters": {
"color": 5,
"width": 3507,
"height": 1028,
"content": "# Watch Trigger (Drive) - Files Updated\n## Workflow ini jalan jika ada File yang diupdate/diedit/dimodifikasi.\n# Cara Kerja\n## Cek file yang barusan diupdate -> cek tipe/format file nya lalu konvert jika perlu -> exkstrak teksnya -> upload ke vectord database\n"
},
"typeVersion": 1
},
{
"id": "270a7c5d-b9e1-48c1-aa0d-76677c15ab34",
"name": "Enhanced Default Data Loader2",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
3000,
2200
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "=file_id",
"value": "={{ $('Set File ID').item.json.file_id }}"
},
{
"name": "=version",
"value": "={{ $('Set Version').item.json.message.content.version }}"
},
{
"name": "=creator",
"value": "={{ $('File Updated').item.json.owners[0].displayName }}"
},
{
"name": "=created_at",
"value": "={{ $('File Updated').item.json.createdTime }}"
},
{
"name": "=last_modified",
"value": "={{ $('File Updated').item.json.modifiedTime }}"
},
{
"name": "=folder_path",
"value": "DOCUMENTS"
},
{
"name": "=file_name",
"value": "={{ $('File Updated').item.json.name }}"
},
{
"name": "=file_extension",
"value": "={{ $('File Updated').item.json.mimeType }}"
}
]
}
},
"jsonData": "={{ $json.data || $json.text || $json.concatenated_data }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "a82a1191-9271-473a-b4b5-a57217c013b7",
"name": "Über Elemente schleifen1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1380,
2200
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "423cdd3c-a1a8-406f-abb3-5c6f0d04d669",
"name": "File Updated",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
40,
2200
],
"parameters": {
"event": "fileUpdated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "1M9h9OnDSWa0kV7_Yj7fdSFHhM57pMPX8",
"cachedResultUrl": "https://drive.google.com/drive/folders/1M9h9OnDSWa0kV7_Yj7fdSFHhM57pMPX8",
"cachedResultName": "DOCUMENTS"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "yGiuxvKzLUzVYa2d",
"name": "Google Drive account"
}
},
"typeVersion": 1
},
{
"id": "2fd0b826-577d-44d7-a3a9-2024bc4ec4cd",
"name": "Insert into Supabase Vectorstore",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
2780,
1960
],
"parameters": {
"mode": "insert",
"options": {
"queryName": "match_documents"
},
"tableName": {
"__rl": true,
"mode": "id",
"value": "documents"
}
},
"credentials": {
"supabaseApi": {
"id": "J5U7ge3sFHh1WYka",
"name": "Supabase API"
}
},
"typeVersion": 1
},
{
"id": "49523689-c6f0-444f-a8b3-ea6a1b4eda39",
"name": "Schalter",
"type": "n8n-nodes-base.switch",
"position": [
1800,
2180
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "PDF",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Set File ID').item.json.file_type }}",
"rightValue": "application/pdf"
}
]
},
"renameOutput": true
},
{
"outputKey": "Text File",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "fc193b06-363b-4699-a97d-e5a850138b0e",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Set File ID').item.json.file_type }}",
"rightValue": "application/vnd.google-apps.document"
}
]
},
"renameOutput": true
},
{
"outputKey": "Excel",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2ae7faa7-a936-4621-a680-60c512163034",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Set File ID').item.json.file_type }}",
"rightValue": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
]
},
"renameOutput": true
},
{
"outputKey": "Windows Doc(1)",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "7ddfa924-1c26-4ee3-9890-5c9d2b96717a",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Set File ID').item.json.file_type }}",
"rightValue": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
},
"renameOutput": true
},
{
"outputKey": "Windows Doc(2)",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "f53caf8b-7a8f-4d1e-98f4-deaf0e0171f0",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Set File ID').item.json.file_type }}",
"rightValue": "application/msword"
}
]
},
"renameOutput": true
},
{
"outputKey": "Windows Doc(3)",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "cd9ca627-d00d-4c30-903a-41f603c8e36f",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Set File ID').item.json.file_type }}",
"rightValue": "application/vnd.ms-word"
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": 2
}
},
"typeVersion": 3
},
{
"id": "c4ea8b5a-695e-438a-8764-96247168dc5b",
"name": "Extract from Text File1",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2100,
2120
],
"parameters": {
"options": {},
"operation": "text"
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "8632f57f-e05e-4cd6-a84e-4111c106702c",
"name": "Begrenzen",
"type": "n8n-nodes-base.limit",
"position": [
760,
2200
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0e1b5c79-46a7-49d6-a4ad-934a9f2441a8",
"name": "Setzen Version",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
980,
2200
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "GPT-4O-MINI"
},
"options": {},
"messages": {
"values": [
{
"role": "system",
"content": "Your goal is to take the incoming version number and add 1 to it. \n\n[Examples]\nInput: v1\nOutput: v2\n\nInput: v2\nOutput: v3\n\nInput: v4\nOutput: v5 \n\nThe output field should always be called \"version\""
},
{
"content": "=incoming version number: {{ $json.metadata.version }}"
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"id": "9SPpIIxBvgYPZlo8",
"name": "OpenAi account"
}
},
"typeVersion": 1.7
},
{
"id": "55b08438-df0c-4a13-98d0-bcb632d3d8be",
"name": "Haftnotiz",
"type": "n8n-nodes-base.stickyNote",
"position": [
-120,
2900
],
"parameters": {
"width": 560,
"content": "## CREDITS\n### This Workflow Is Originally by Nate Herk.\n[Check his community here](https://www.skool.com/ai-automation-society-plus/about)"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "fba7627e-45c8-4121-8f6a-123ca7d6c8d0",
"connections": {
"efdfe418-a0bc-4db1-87e2-5558f00a48ec": {
"main": [
[],
[
{
"node": "2899dfbc-2fba-4f35-9805-384dc30eebab",
"type": "main",
"index": 0
}
]
]
},
"Limit": {
"main": [
[
{
"node": "Set Version",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "f864d1f7-39a2-4d36-9dc5-d75fcc08ba7d",
"type": "main",
"index": 0
}
],
[
{
"node": "c4ea8b5a-695e-438a-8764-96247168dc5b",
"type": "main",
"index": 0
}
],
[
{
"node": "32d1f985-b143-451e-a6d1-bf3da9f568a1",
"type": "main",
"index": 0
}
],
[
{
"node": "2ea2790c-f4ab-4c59-b4b6-0a22e8047f48",
"type": "main",
"index": 0
}
],
[
{
"node": "2ea2790c-f4ab-4c59-b4b6-0a22e8047f48",
"type": "main",
"index": 0
}
],
[
{
"node": "2ea2790c-f4ab-4c59-b4b6-0a22e8047f48",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Summarize",
"type": "main",
"index": 0
}
]
]
},
"Summarize": {
"main": [
[
{
"node": "2fd0b826-577d-44d7-a3a9-2024bc4ec4cd",
"type": "main",
"index": 0
}
]
]
},
"Set File ID": {
"main": [
[
{
"node": "efdfe418-a0bc-4db1-87e2-5558f00a48ec",
"type": "main",
"index": 0
}
]
]
},
"Set Version": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"423cdd3c-a1a8-406f-abb3-5c6f0d04d669": {
"main": [
[
{
"node": "Set File ID",
"type": "main",
"index": 0
}
]
]
},
"Download File": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items1": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
],
[
{
"node": "Download File",
"type": "main",
"index": 0
}
]
]
},
"f864d1f7-39a2-4d36-9dc5-d75fcc08ba7d": {
"main": [
[
{
"node": "2fd0b826-577d-44d7-a3a9-2024bc4ec4cd",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI2": {
"ai_embedding": [
[
{
"node": "2fd0b826-577d-44d7-a3a9-2024bc4ec4cd",
"type": "ai_embedding",
"index": 0
}
]
]
},
"2899dfbc-2fba-4f35-9805-384dc30eebab": {
"main": [
[
{
"node": "Limit",
"type": "main",
"index": 0
}
]
]
},
"32d1f985-b143-451e-a6d1-bf3da9f568a1": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"2ea2790c-f4ab-4c59-b4b6-0a22e8047f48": {
"main": [
[
{
"node": "69166736-3369-4a33-8543-fae475344593",
"type": "main",
"index": 0
}
]
]
},
"c4ea8b5a-695e-438a-8764-96247168dc5b": {
"main": [
[
{
"node": "2fd0b826-577d-44d7-a3a9-2024bc4ec4cd",
"type": "main",
"index": 0
}
]
]
},
"270a7c5d-b9e1-48c1-aa0d-76677c15ab34": {
"ai_document": [
[
{
"node": "2fd0b826-577d-44d7-a3a9-2024bc4ec4cd",
"type": "ai_document",
"index": 0
}
]
]
},
"e2574cdd-5d41-4be1-bca5-370d2a8e2ee2": {
"ai_textSplitter": [
[
{
"node": "270a7c5d-b9e1-48c1-aa0d-76677c15ab34",
"type": "ai_textSplitter",
"index": 0
}
]
]
}
}
}Häufig gestellte Fragen
Wie verwende ich diesen Workflow?
Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.
Für welche Szenarien ist dieser Workflow geeignet?
Experte - Dokumentenextraktion, KI RAG
Ist es kostenpflichtig?
Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.
Verwandte Workflows
[Template] KI-Haustierladen v8
🐥 KI-Assistent für Tiernahrungsshops - Integriert GPT-4o, Google Kalender und WhatsApp/Instagram/Facebook
If
N8n
Set
+
If
N8n
Set
244 NodesAmanda Benks
Vertrieb
KI-Agent Restaurant [Vorlage]
🤖 KI-Restaurantassistent für WhatsApp, Instagram und Messenger
If
N8n
Set
+
If
N8n
Set
239 NodesAmanda Benks
Sonstiges
Kontextbasierte hybride RAG-KI-Texterstellung
Google Drive zu Supabase Kontext-Vektordatenbank-Synchronisierung für RAG-Anwendungen
If
Set
Code
+
If
Set
Code
76 NodesMichael Taleb
KI RAG
Haustierladen 4
🐥 KI-Terminassistent für Tierbedarfsgeschäfte
If
Set
Code
+
If
Set
Code
187 NodesBruno Dias
Künstliche Intelligenz
Lieferanten-Hamburger MVP
🤖 KI-angetriebener WhatsApp-Assistent für Restaurant- und Lieferautomaten
If
Set
Code
+
If
Set
Code
152 NodesBruno Dias
AI-Wissensdatenbank-Assistent mit OpenAI-, Supabase- und Google Drive-Dokumentensynchronisation
AI-Wissensdatenbank-Assistent mit OpenAI-, Supabase- und Google Drive-Dokumentensynchronisation
Set
Limit
Switch
+
Set
Limit
Switch
49 NodesAbdul Mir
Internes Wiki
Workflow-Informationen
Schwierigkeitsgrad
Experte
Anzahl der Nodes22
Kategorie2
Node-Typen18
Autor
edisantosa
@edsanExterne Links
Auf n8n.io ansehen →
Diesen Workflow teilen