RAG 시스템 V2 - 문서 업데이트
고급
이것은Document Extraction, AI RAG분야의자동화 워크플로우로, 22개의 노드를 포함합니다.주로 If, Set, Limit, Switch, Supabase 등의 노드를 사용하며. Google Drive 파일 변경을 통해 Supabase 벡터 데이터베이스에서 RAG 시스템을 업데이트 유지
사전 요구사항
- •Supabase URL과 API Key
- •Google Drive API 인증 정보
- •대상 API의 인증 정보가 필요할 수 있음
- •OpenAI API Key
사용된 노드 (22)
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 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": "파일 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": "기존 문서 행 삭제",
"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": "파일 다운로드",
"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": "조건문",
"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": "집계",
"type": "n8n-nodes-base.aggregate",
"position": [
2300,
2300
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData"
},
"typeVersion": 1
},
{
"id": "93ddcfd1-9320-4808-b636-ae28664f41a8",
"name": "요약",
"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": "PDF 텍스트 추출1",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2100,
1960
],
"parameters": {
"options": {},
"operation": "pdf"
},
"typeVersion": 1
},
{
"id": "32d1f985-b143-451e-a6d1-bf3da9f568a1",
"name": "Excel에서 추출1",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2100,
2300
],
"parameters": {
"options": {},
"operation": "xlsx"
},
"typeVersion": 1
},
{
"id": "2ea2790c-f4ab-4c59-b4b6-0a22e8047f48",
"name": "Google 문서로 변환2",
"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": "파일 삭제1",
"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": "재귀적 문자 텍스트 분할기1",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
3080,
2420
],
"parameters": {
"options": {},
"chunkSize": 2000,
"chunkOverlap": 200
},
"typeVersion": 1
},
{
"id": "7dfe4ffd-0fda-4f7d-a005-4e4e9a62048e",
"name": "OpenAI 임베딩2",
"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": "스티키 노트3",
"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": "향상된 기본 데이터 로더2",
"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": "항목 순환1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1380,
2200
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "423cdd3c-a1a8-406f-abb3-5c6f0d04d669",
"name": "파일 업데이트됨",
"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": "Supabase 벡터스토어에 삽입",
"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": "스위치",
"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": "텍스트 파일에서 추출1",
"type": "n8n-nodes-base.extractFromFile",
"position": [
2100,
2120
],
"parameters": {
"options": {},
"operation": "text"
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "8632f57f-e05e-4cd6-a84e-4111c106702c",
"name": "제한",
"type": "n8n-nodes-base.limit",
"position": [
760,
2200
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0e1b5c79-46a7-49d6-a4ad-934a9f2441a8",
"name": "버전 설정",
"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": "스티키 노트",
"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
}
]
]
},
"8632f57f-e05e-4cd6-a84e-4111c106702c": {
"main": [
[
{
"node": "0e1b5c79-46a7-49d6-a4ad-934a9f2441a8",
"type": "main",
"index": 0
}
]
]
},
"49523689-c6f0-444f-a8b3-ea6a1b4eda39": {
"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
}
]
]
},
"19edee69-a34b-48c7-8f2e-c2547fb226ff": {
"main": [
[
{
"node": "93ddcfd1-9320-4808-b636-ae28664f41a8",
"type": "main",
"index": 0
}
]
]
},
"93ddcfd1-9320-4808-b636-ae28664f41a8": {
"main": [
[
{
"node": "2fd0b826-577d-44d7-a3a9-2024bc4ec4cd",
"type": "main",
"index": 0
}
]
]
},
"f57918de-1d00-432b-b352-b6013118664a": {
"main": [
[
{
"node": "efdfe418-a0bc-4db1-87e2-5558f00a48ec",
"type": "main",
"index": 0
}
]
]
},
"0e1b5c79-46a7-49d6-a4ad-934a9f2441a8": {
"main": [
[
{
"node": "a82a1191-9271-473a-b4b5-a57217c013b7",
"type": "main",
"index": 0
}
]
]
},
"423cdd3c-a1a8-406f-abb3-5c6f0d04d669": {
"main": [
[
{
"node": "f57918de-1d00-432b-b352-b6013118664a",
"type": "main",
"index": 0
}
]
]
},
"aae30af6-491e-48f7-89cb-b6dd2ed5ed9e": {
"main": [
[
{
"node": "a82a1191-9271-473a-b4b5-a57217c013b7",
"type": "main",
"index": 0
}
]
]
},
"a82a1191-9271-473a-b4b5-a57217c013b7": {
"main": [
[
{
"node": "49523689-c6f0-444f-a8b3-ea6a1b4eda39",
"type": "main",
"index": 0
}
],
[
{
"node": "aae30af6-491e-48f7-89cb-b6dd2ed5ed9e",
"type": "main",
"index": 0
}
]
]
},
"f864d1f7-39a2-4d36-9dc5-d75fcc08ba7d": {
"main": [
[
{
"node": "2fd0b826-577d-44d7-a3a9-2024bc4ec4cd",
"type": "main",
"index": 0
}
]
]
},
"7dfe4ffd-0fda-4f7d-a005-4e4e9a62048e": {
"ai_embedding": [
[
{
"node": "2fd0b826-577d-44d7-a3a9-2024bc4ec4cd",
"type": "ai_embedding",
"index": 0
}
]
]
},
"2899dfbc-2fba-4f35-9805-384dc30eebab": {
"main": [
[
{
"node": "8632f57f-e05e-4cd6-a84e-4111c106702c",
"type": "main",
"index": 0
}
]
]
},
"32d1f985-b143-451e-a6d1-bf3da9f568a1": {
"main": [
[
{
"node": "19edee69-a34b-48c7-8f2e-c2547fb226ff",
"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
}
]
]
}
}
}자주 묻는 질문
이 워크플로우를 어떻게 사용하나요?
위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.
이 워크플로우는 어떤 시나리오에 적합한가요?
고급 - 문서 추출, AI RAG
유료인가요?
이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.
관련 워크플로우 추천
[템플릿] AI 반려동물 가게 v8
🐶 AI 펫 샵 어시스턴트 - GPT-4o, Google 캘린더 및 WhatsApp/Instagram/Facebook 통합
If
N8n
Set
+
If
N8n
Set
244 노드Amanda Benks
영업
AI 대리인 레스토랑 [템플릿]
🤖 WhatsApp, 인스타그램, 메신저의 AI 레스토랑 도우미
If
N8n
Set
+
If
N8n
Set
239 노드Amanda Benks
기타
컨텍스트 혼합 RAG AI 콘텐츠
Google Drive에서 Supabase 상황 벡터 데이터베이스로 동기화, RAG 애플리케이션 사용
If
Set
Code
+
If
Set
Code
76 노드Michael Taleb
AI RAG
반려동물 가게 4
🐶 펫 샵 예약 AI 대리자
If
Set
Code
+
If
Set
Code
187 노드Bruno Dias
인공지능
배달 햄버거점 MVP
🤖 레스토랑과 배달 자동화의 AI 드라이브 WhatsApp 도우미
If
Set
Code
+
If
Set
Code
152 노드Bruno Dias
AI知识库어시스턴트与OpenAI、Supabase及Google Drive文档동기화
AI知识库어시스턴트与OpenAI、Supabase及Google Drive文档동기화
Set
Limit
Switch
+
Set
Limit
Switch
49 노드Abdul Mir
내부 위키