This workflow corresponds to n8n.io template #9398 — we link there as the canonical source.
This workflow follows the Agent → Chat Trigger 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": "WNXcePvqmGEMi1Hv",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "RAG Agent",
"tags": [],
"nodes": [
{
"id": "f954e0ec-cb2b-46ca-9eeb-4d759aeb42a1",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-240,
-256
],
"parameters": {
"text": "={{ $json.chatInput }}",
"options": {
"systemMessage": "You are an intelligent and helpful company assistant at Thinkspire.ai a company that is engaged in offering product and AI automation services to small, medium and large enterprises.\n\nYou will respond to incoming messages in a thoughtful manner. You have access to a vector database which will have information about the company. \n\nBe smart about your responses and ask relevant question when necessary or when it's needed if you need more clarity to get information. Make sure you do not respond anything outside of the details within the vector database. That is your whole and only source of information. Do not go online and search other sources. When sourcing info vectors with the same \"file_id\" within the metadata are part of the same document.\n\nKeep your tone 50% casual and 50% business. Don't mention that you're an AI. Your conversations need to sound human.\n"
},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "f90a3e4a-061e-4e16-9ed3-588a065942bd",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-320,
-16
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "3539cd74-b7ba-494f-adcf-d31f5681c4e9",
"name": "Supabase Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
32,
-128
],
"parameters": {
"mode": "retrieve-as-tool",
"topK": 10,
"options": {},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
},
"toolDescription": "This will be used to get all the information about the company and open jobs and opportunities at the company"
},
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "d6f00a9e-d191-4c26-b77a-733b36812c35",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
160,
0
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "3d23aeec-7ca6-4206-b0b0-e6da0130587f",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
-576,
272
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b14c6659-851a-4f9a-8489-106ecd5511d4",
"name": "file_id",
"type": "string",
"value": "={{ $json.id }}"
},
{
"id": "1a3fe673-7491-4c3a-a1e6-3150f2c8daa5",
"name": "file_type",
"type": "string",
"value": "={{ $json.mimeType }}"
},
{
"id": "96d945fd-cc84-4636-9a6f-a4d2eda638d6",
"name": "source",
"type": "string",
"value": "\"Update File\""
}
]
}
},
"typeVersion": 3.4
},
{
"id": "cf07ce8a-b2e7-4172-9a12-a06ccfa2ef8b",
"name": "Download file",
"type": "n8n-nodes-base.googleDrive",
"position": [
320,
368
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.file_id }} "
},
"options": {
"googleFileConversion": {
"conversion": {}
}
},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3,
"alwaysOutputData": false
},
{
"id": "5b34dc6b-d9de-42da-8a2c-151767bc36e3",
"name": "Supabase Vector Store1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
1216,
368
],
"parameters": {
"mode": "insert",
"options": {
"queryName": "match_documents"
},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
}
},
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "cf86dcb2-82a1-41dd-9043-3d0be136959a",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1152,
576
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "837f40b1-c942-4bc6-a52f-6bd064f1625b",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
1328,
576
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "file_id",
"value": "={{ $json.file_id }}"
}
]
}
},
"jsonData": "={{ $json.data || $json.text || $json.concatenated_data }}",
"jsonMode": "expressionData"
},
"typeVersion": 1.1
},
{
"id": "6a8c893a-2eb3-4f18-9456-d88bcab012c2",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
544,
368
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "73ae0629-8dc6-47c3-ba72-27d4fba185c2",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.file_type }}",
"rightValue": "=application/pdf"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "1ede038a-5eb4-450e-81ed-e6b090f995e0",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.file_type }}",
"rightValue": "application/vnd.google-apps.document"
}
]
}
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "9bd7615a-b548-44cc-b562-a143d8405aa6",
"name": "Switch1",
"type": "n8n-nodes-base.switch",
"position": [
-544,
-240
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "File Attached",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "149a2b41-bb29-4221-be11-7979f6e84d67",
"operator": {
"type": "array",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.files }}",
"rightValue": ""
}
]
},
"renameOutput": true
},
{
"outputKey": "File Not Attached",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "1acc9d86-5b39-4a17-aa12-83b2f1acfbfd",
"operator": {
"type": "array",
"operation": "notExists",
"singleValue": true
},
"leftValue": "={{ $json.files }}",
"rightValue": ""
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "d111c777-4692-4c72-9f1c-0f7c21a9de78",
"name": "Edit Fields1",
"type": "n8n-nodes-base.set",
"position": [
0,
-672
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "d02930e8-6c25-4450-ad19-6655365c9c96",
"name": "name",
"type": "string",
"value": "={{ $json.text.split('\\n')[0] }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "81227c5e-88da-4867-a264-4105a2fe53d6",
"name": "Create folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
272,
-784
],
"parameters": {
"name": "={{ $json.name }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1WEiFm-7BKm3iHuvV_PP4Mn1EwDhLXXbD",
"cachedResultUrl": "https://drive.google.com/drive/folders/1WEiFm-7BKm3iHuvV_PP4Mn1EwDhLXXbD",
"cachedResultName": "N8N Flows"
},
"resource": "folder"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "c64affd4-a8b0-42d5-90b9-42f4cd7ba128",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
512,
-688
],
"parameters": {
"mode": "combine",
"options": {
"includeUnpaired": true
},
"combineBy": "combineByPosition"
},
"typeVersion": 3.2
},
{
"id": "b11c3b19-9530-40f6-b867-655b4a1460eb",
"name": "Upload file",
"type": "n8n-nodes-base.googleDrive",
"position": [
880,
-688
],
"parameters": {
"name": "={{ $json.name }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Create folder').item.json.id }}"
},
"inputDataFieldName": "=data0"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3,
"alwaysOutputData": false
},
{
"id": "d774e77e-1222-43a4-a295-4e5a2bbeb363",
"name": "Update File",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
-800,
272
],
"parameters": {
"event": "fileUpdated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "1XCttPim7xo6BnKQ_fxhzuSjjPVhibGwS",
"cachedResultUrl": "https://drive.google.com/drive/folders/1XCttPim7xo6BnKQ_fxhzuSjjPVhibGwS",
"cachedResultName": "RAG"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "cd75c7cd-5e72-4da2-a32c-fad1b7176c74",
"name": "New File",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
-128,
464
],
"parameters": {
"event": "fileCreated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "1XCttPim7xo6BnKQ_fxhzuSjjPVhibGwS",
"cachedResultUrl": "https://drive.google.com/drive/folders/1XCttPim7xo6BnKQ_fxhzuSjjPVhibGwS",
"cachedResultName": "RAG"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "ff28339d-2dcd-4307-ba3b-70282c193da3",
"name": "Delete a row",
"type": "n8n-nodes-base.supabase",
"position": [
-352,
272
],
"parameters": {
"tableId": "documents",
"operation": "delete",
"filterType": "string",
"filterString": "=metadata->>file_id=eq.{{ $json.file_id }}"
},
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
},
"executeOnce": false,
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "73592614-20c7-4761-9738-0720ff417f3f",
"name": "Remove Duplicates",
"type": "n8n-nodes-base.removeDuplicates",
"position": [
-128,
272
],
"parameters": {
"compare": "selectedFields",
"options": {},
"fieldsToCompare": "metadata.file_id"
},
"typeVersion": 2,
"alwaysOutputData": true
},
{
"id": "66e3701d-6e84-49cd-8e8b-23e892efb773",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-288,
-864
],
"parameters": {
"color": 4,
"width": 1408,
"height": 480,
"content": "### 4. Save Incoming PDF Files ###"
},
"typeVersion": 1
},
{
"id": "9a48ac99-bd5b-451b-88f4-f761147c5808",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-848,
-336
],
"parameters": {
"color": 5,
"width": 1472,
"height": 464,
"content": "### 1. RAG Agent with Chat Interface ###"
},
"typeVersion": 1
},
{
"id": "e0104821-7c02-4bc2-ba6c-f40ec382982c",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-848,
176
],
"parameters": {
"color": 6,
"width": 2400,
"height": 544,
"content": "### 2. Data Pipeline ###\n"
},
"typeVersion": 1
},
{
"id": "2de51cb7-7b18-41d0-91ba-21233c21180d",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-768,
880
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"minutesInterval": 15
}
]
}
},
"typeVersion": 1.2
},
{
"id": "7757ac2d-1758-4339-b2b3-c9ec1757cefb",
"name": "Search files and folders",
"type": "n8n-nodes-base.googleDrive",
"position": [
-544,
880
],
"parameters": {
"filter": {
"folderId": {
"__rl": true,
"mode": "list",
"value": "1XCttPim7xo6BnKQ_fxhzuSjjPVhibGwS",
"cachedResultUrl": "https://drive.google.com/drive/folders/1XCttPim7xo6BnKQ_fxhzuSjjPVhibGwS",
"cachedResultName": "RAG"
}
},
"options": {},
"resource": "fileFolder"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "96263b53-3d53-4220-afb1-ac45ee17e0f4",
"name": "Get many rows",
"type": "n8n-nodes-base.supabase",
"position": [
-320,
768
],
"parameters": {
"tableId": "documents",
"operation": "getAll",
"returnAll": true,
"filterType": "none"
},
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "635ae043-99fa-4071-86a4-813831c45177",
"name": "Merge1",
"type": "n8n-nodes-base.merge",
"position": [
-96,
864
],
"parameters": {
"mode": "combine",
"options": {},
"advanced": true,
"joinMode": "keepNonMatches",
"mergeByFields": {
"values": [
{
"field1": "metadata.file_id",
"field2": "id"
}
]
}
},
"typeVersion": 3.2
},
{
"id": "930056fb-692a-41f6-8af9-19a035105f46",
"name": "Delete a row1",
"type": "n8n-nodes-base.supabase",
"position": [
176,
864
],
"parameters": {
"tableId": "documents",
"operation": "delete",
"filterType": "string",
"filterString": "=metadata->>file_id=eq.{{ $json.metadata.file_id }}"
},
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "c39def47-78ee-478c-9bc2-d4ea488a116f",
"name": "Edit Fields2",
"type": "n8n-nodes-base.set",
"position": [
96,
464
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b14c6659-851a-4f9a-8489-106ecd5511d4",
"name": "file_id",
"type": "string",
"value": "={{ $json.id }}"
},
{
"id": "3df22051-814d-4f40-8790-2dbf147712f1",
"name": "file_type",
"type": "string",
"value": "={{ $json.mimeType }}"
},
{
"id": "9937f785-85b1-4b5c-b968-fa647dc9fc06",
"name": "source",
"type": "string",
"value": "\"New File\""
}
]
}
},
"typeVersion": 3.4
},
{
"id": "54b5e4b4-c7e1-4023-8dc5-ae353925cae6",
"name": "Edit Fields3",
"type": "n8n-nodes-base.set",
"position": [
992,
368
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a82e0661-78e0-4c8b-a775-b3bd5bfd3d1f",
"name": "file_id",
"type": "string",
"value": "={{ $('Download file').item.json.file_id }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "7537c93d-a1bd-450f-8128-75565c25a3b8",
"name": "Edit Fields4",
"type": "n8n-nodes-base.set",
"position": [
96,
272
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e0234bdb-7409-44bc-99ce-8cbdfcc3b634",
"name": "file_id",
"type": "string",
"value": "={{ $json.metadata.file_id }}"
},
{
"id": "36b4bef1-eded-4abd-a785-68c1dde6fdea",
"name": "file_type",
"type": "string",
"value": "={{ $('Edit Fields').item.json.file_type }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "2caf4053-ae32-4109-b359-ef170f10be83",
"name": "Chat",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-816,
-240
],
"parameters": {
"options": {
"allowFileUploads": true
}
},
"typeVersion": 1.3
},
{
"id": "41bbbdd3-e06b-4705-bcc6-78de6c5f1f38",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-848,
752
],
"parameters": {
"width": 1248,
"height": 304,
"content": "### 3. Vector Store Cleanup ###"
},
"typeVersion": 1
},
{
"id": "8389e70f-b386-41a2-a58a-1f7b6a6dc5f4",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1776,
-192
],
"parameters": {
"color": 4,
"width": 800,
"height": 1264,
"content": "### What is this?\nThis RAG workflow allows you to build a smart chat assistant that can answer user questions based on any collection of documents you provide. It automatically imports and processes files from Google Drive, stores their content in a searchable vector database, and retrieves the most relevant information to generate accurate, context-driven responses. The workflow manages chat sessions and keeps the document database current, making it adaptable for use cases like customer support, internal knowledge bases, or educational resources.\n\n**Author:** Jainik Sheth (https://www.thinkspire.ai/)\n\n### 1. Chat RAG Agent\n- Handles chat interactions as an HR assistant.\n- Uses OpenAI for responses, referencing only specific data from the vector store (data that is uploaded on google drive folder).\n- Maintains chat history in Postgres using a session key from the chat input.\n\n### 2. Data Pipeline (File Ingestion)\n- Monitors Google Drive for new/updated files and automatically updates them in vector store\n- Downloads, extracts, and processes file content (PDFs, Google Docs).\n- Generates embeddings and stores them in the Supabase vector store for retrieval.\n\n### 3. Vector Store Cleanup\n- Scheduled and manual routines to remove duplicate or outdated entries from the Supabase vector store.\n- Ensures only the latest and unique documents are available for retrieval.\n\n### 4. File Management\n- Handles folder and file creation, upload, and metadata assignment in Google Drive.\n- Ensures files are organized and linked with their corresponding vector store entries.\n\n## Getting Started\n- Create and connect all relevant credentials\n - Google Drive\n - Postgres\n - Supabase\n - OpenAI\n- Run the table creation nodes first to set up your database tables in Postgres\n- Upload your documents through Google Drive (or swap out for a different file storage solution)\n- The agent will process them automatically (chunking text, storing tabular data in Postgres)\n- Start asking questions that leverage the agent's multiple reasoning approaches\n\n## Customization\nThis template provides a solid foundation that you can extend by:\n- Tuning the system prompt for your specific use case\n- Adding document metadata like summaries\n- Implementing more advanced RAG techniques\n- Optimizing for larger knowledge bases\n- Note, if you're using a different nodes eg. file storage, vector store etc the integration may vary a little\n\n\n## Prerequisites\n- Google account (google drive)\n- Supabase account\n- OpenAI APIs\n- Postgres account"
},
"typeVersion": 1
},
{
"id": "c4037172-7d28-4469-bcd0-efdc2731b016",
"name": "Chat Memory",
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
"position": [
-144,
-32
],
"parameters": {
"sessionKey": "={{ $('Chat').item.json.sessionId }}",
"sessionIdType": "customKey"
},
"credentials": {
"postgres": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "7a590db0-a5a6-402d-b2a0-e71d1e4e3149",
"name": "Extract from PDF",
"type": "n8n-nodes-base.extractFromFile",
"position": [
768,
272
],
"parameters": {
"options": {},
"operation": "pdf"
},
"typeVersion": 1
},
{
"id": "42202c9f-6c71-446e-9b0b-d8e3568fd2f5",
"name": "Extract from Binary File",
"type": "n8n-nodes-base.extractFromFile",
"position": [
768,
464
],
"parameters": {
"options": {},
"operation": "text"
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "9f2de02c-842b-4e80-bc82-2855b2a5aae6",
"name": "Extract From PDF",
"type": "n8n-nodes-base.extractFromFile",
"position": [
-240,
-672
],
"parameters": {
"options": {
"keepSource": "binary"
},
"operation": "pdf",
"binaryPropertyName": "=data0"
},
"typeVersion": 1,
"alwaysOutputData": true
}
],
"active": false,
"settings": {
"callerPolicy": "workflowsFromSameOwner",
"executionOrder": "v1"
},
"versionId": "b01d4064-f1ed-45c1-86fa-7afb0f271768",
"connections": {
"Chat": {
"main": [
[
{
"node": "Switch1",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Upload file",
"type": "main",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Delete a row1",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Extract from PDF",
"type": "main",
"index": 0
}
],
[
{
"node": "Extract from Binary File",
"type": "main",
"index": 0
}
]
]
},
"Switch1": {
"main": [
[
{
"node": "Extract From PDF",
"type": "main",
"index": 0
},
{
"node": "AI Agent",
"type": "main",
"index": 0
}
],
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[]
]
},
"New File": {
"main": [
[
{
"node": "Edit Fields2",
"type": "main",
"index": 0
}
]
]
},
"Chat Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Delete a row",
"type": "main",
"index": 0
}
]
]
},
"Update File": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Delete a row": {
"main": [
[
{
"node": "Remove Duplicates",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[
{
"node": "Create folder",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Edit Fields2": {
"main": [
[
{
"node": "Download file",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields3": {
"main": [
[
{
"node": "Supabase Vector Store1",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields4": {
"main": [
[
{
"node": "Download file",
"type": "main",
"index": 0
}
]
]
},
"Create folder": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Download file": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Get many rows": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"Extract From PDF": {
"main": [
[
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
},
"Extract from PDF": {
"main": [
[
{
"node": "Edit Fields3",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Search files and folders",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Remove Duplicates": {
"main": [
[
{
"node": "Edit Fields4",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Supabase Vector Store1",
"type": "ai_document",
"index": 0
}
]
]
},
"Supabase Vector Store": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Extract from Binary File": {
"main": [
[
{
"node": "Edit Fields3",
"type": "main",
"index": 0
}
]
]
},
"Search files and folders": {
"main": [
[
{
"node": "Get many rows",
"type": "main",
"index": 0
},
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
}
}
}
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.
googleDriveOAuth2ApiopenAiApipostgressupabaseApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This RAG workflow allows you to build a smart chat assistant that can answer user questions based on any collection of documents you provide. It automatically imports and processes files from Google Drive, stores their content in a searchable vector database, and retrieves the…
Source: https://n8n.io/workflows/9398/ — 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.
Your AI workforce is ready. Are you?
This n8n template automatically classifies incoming emails (Sales, Support, Internal, Finance, Promotions) and routes them to a dedicated OpenAI LLM Agent for processing. Depending on the category, th
Automate Outreach Prospect automates finding, enriching, and messaging potential partners (like restaurants, malls, and bars) using Apify Google Maps scraping, Perplexity enrichment, OpenAI LLMs, Goog
Chat with docs - 5minAI New version. Uses httpRequest, documentDefaultDataLoader, textSplitterRecursiveCharacterTextSplitter, embeddingsOpenAi. Event-driven trigger; 62 nodes.
I prepared a detailed guide that illustrates the entire process of building an AI agent using Supabase and Google Drive within N8N workflows.