AI智能助手:与Supabase存储和Google Drive文件对话
高级
这是一个Engineering, AI, IT Ops领域的自动化工作流,包含 62 个节点。主要使用 If, Set, Wait, Merge, Switch 等节点,结合人工智能技术实现智能自动化。 AI智能助手:与Supabase存储和Google Drive文件对话
前置要求
- •HTTP Webhook 端点(n8n 会自动生成)
- •Supabase URL 和 API Key
- •Google Drive API 凭证
- •可能需要目标 API 的认证凭证
- •OpenAI API Key
使用的节点 (62)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "6a2a7715680b8313f7cb4676321c5baa46680adfb913072f089f2766f42e43bd",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "003915bb-a2e9-42b0-b81f-5bb5bf0c8cb4",
"name": "获取所有文件",
"type": "n8n-nodes-base.httpRequest",
"position": [
1180,
1280
],
"parameters": {
"url": "=https://<project_id>.supabase.co/storage/v1/object/list/private",
"method": "POST",
"options": {},
"jsonBody": "={\n \"prefix\": \"\",\n \"limit\": 100,\n \"offset\": 0,\n \"sortBy\": {\n \"column\": \"name\",\n \"order\": \"asc\"\n }\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "supabaseApi"
},
"credentials": {
"supabaseApi": {
"id": "t8AQJzvZvrOMDLec",
"name": "Supabase account info@ Demo"
}
},
"typeVersion": 4.2
},
{
"id": "f46e056d-8311-4951-ad38-21759fabdaf7",
"name": "默认数据加载器",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
3500,
1820
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "=file_id",
"value": "={{ $json.id }}"
}
]
}
},
"jsonData": "={{ $('Merge Text').item.json.text }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "3cfdcacb-d0ef-422b-9048-a64e5f0dac66",
"name": "递归字符文本分割器",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
3520,
1960
],
"parameters": {
"options": {},
"chunkSize": 500,
"chunkOverlap": 200
},
"typeVersion": 1
},
{
"id": "3056ea0a-b788-43c7-a070-f40bd1ad3356",
"name": "OpenAI 嵌入",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
3320,
1800
],
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "fLfRtaXbR0EVD0pl",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "e6ad8067-0468-440d-a322-2a3de8851431",
"name": "创建文件记录2",
"type": "n8n-nodes-base.supabase",
"position": [
3260,
1620
],
"parameters": {
"tableId": "files",
"fieldsUi": {
"fieldValues": [
{
"fieldId": "name",
"fieldValue": "={{ $('Loop Over Items').item.json.name }}"
},
{
"fieldId": "storage_id",
"fieldValue": "={{ $('Loop Over Items').item.json.id }}"
}
]
}
},
"credentials": {
"supabaseApi": {
"id": "t8AQJzvZvrOMDLec",
"name": "Supabase account info@ Demo"
}
},
"typeVersion": 1
},
{
"id": "53ac0d69-d935-48a0-8fb8-5cc8f591dbb8",
"name": "条件判断",
"type": "n8n-nodes-base.if",
"position": [
1500,
1280
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "9b14e306-a04d-40f7-bc5b-b8eda8d8f7f2",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ \n !$('Aggregate').item.json.data || \n !Array.isArray($('Aggregate').item.json.data) || \n !$('Aggregate').item.json.data.some(item => \n item.storage_id === $('Loop Over Items').item.json.id \n ) \n}}",
"rightValue": ""
},
{
"id": "c3c0af88-9aea-4539-8948-1b69e601c27c",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.name }}",
"rightValue": ".emptyFolderPlaceholder"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "f57e857a-094f-470c-ad27-9fc29466ab0e",
"name": "获取所有文件",
"type": "n8n-nodes-base.supabase",
"position": [
800,
1280
],
"parameters": {
"tableId": "files",
"operation": "getAll"
},
"credentials": {
"supabaseApi": {
"id": "t8AQJzvZvrOMDLec",
"name": "Supabase account info@ Demo"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "4484ca47-6879-43b7-8879-261f409014e1",
"name": "下载",
"type": "n8n-nodes-base.httpRequest",
"position": [
1660,
1280
],
"parameters": {
"url": "=https://<project_id>.supabase.co/storage/v1/object/private/{{ $json.name }}",
"options": {},
"authentication": "predefinedCredentialType",
"nodeCredentialType": "supabaseApi"
},
"credentials": {
"supabaseApi": {
"id": "t8AQJzvZvrOMDLec",
"name": "Supabase account info@ Demo"
}
},
"typeVersion": 4.2
},
{
"id": "f81d2f91-d665-4217-8955-a308ef2b37be",
"name": "遍历项目",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1340,
1280
],
"parameters": {
"options": {},
"batchSize": "=1"
},
"typeVersion": 3
},
{
"id": "8857a553-37aa-4ac2-ac4d-e5402849cb2e",
"name": "点击“测试工作流”时",
"type": "n8n-nodes-base.manualTrigger",
"disabled": true,
"position": [
620,
1280
],
"parameters": {},
"typeVersion": 1
},
{
"id": "e967af7e-43bd-47cb-8b04-eb431a82c93b",
"name": "聚合",
"type": "n8n-nodes-base.aggregate",
"position": [
1000,
1280
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData"
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "8abdb8f6-e31d-48cf-8189-831adf7d4889",
"name": "当收到聊天消息时",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
1420,
300
],
"webhookId": "3c40d311-7996-4ed4-b2fa-c73bea5f4cf5",
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "75cf7f9e-d8f6-4a7a-b464-d152fd025188",
"name": "插入到 Supabase Vectorstore",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
3420,
1620
],
"parameters": {
"mode": "insert",
"options": {
"queryName": "match_documents"
},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
}
},
"credentials": {
"supabaseApi": {
"id": "t8AQJzvZvrOMDLec",
"name": "Supabase account info@ Demo"
}
},
"typeVersion": 1
},
{
"id": "b3ceb557-53c6-4d19-ac97-c999ba87c7f5",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
1120,
1160
],
"parameters": {
"height": 89.3775420487804,
"content": "### 替换存储名称、数据库 ID 和凭据。"
},
"typeVersion": 1
},
{
"id": "a81fe332-86ea-46aa-b140-ee5745f0b0e0",
"name": "便签 1",
"type": "n8n-nodes-base.stickyNote",
"position": [
760,
1160
],
"parameters": {
"height": 80,
"content": "### 替换凭据。"
},
"typeVersion": 1
},
{
"id": "44070cd1-0f4d-48ea-8ce0-8d59f94133e7",
"name": "便签 2",
"type": "n8n-nodes-base.stickyNote",
"position": [
3260,
1500
],
"parameters": {
"height": 80,
"content": "### 替换凭据。"
},
"typeVersion": 1
},
{
"id": "3fed931d-69de-4c1b-a951-5e49c683f551",
"name": "便签 3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1620,
1160
],
"parameters": {
"height": 89.3775420487804,
"content": "### 替换存储名称、数据库 ID 和凭据。"
},
"typeVersion": 1
},
{
"id": "d462978c-7ea3-4b92-a940-64756377c461",
"name": "便签 4",
"type": "n8n-nodes-base.stickyNote",
"position": [
3220,
1940
],
"parameters": {
"height": 80,
"content": "### 替换凭据。"
},
"typeVersion": 1
},
{
"id": "6f0a219d-4258-4982-b912-784a850ef308",
"name": "便签 5",
"type": "n8n-nodes-base.stickyNote",
"position": [
2080,
800
],
"parameters": {
"height": 80,
"content": "### 替换凭据。"
},
"typeVersion": 1
},
{
"id": "469b3caf-c9a8-4f8b-a745-c672e2b1089f",
"name": "便签7",
"type": "n8n-nodes-base.stickyNote",
"position": [
560,
40
],
"parameters": {
"color": 7,
"width": 636.2128494576581,
"height": 497.1532689930921,
"content": ""
},
"typeVersion": 1
},
{
"id": "cb6664f2-0a05-4abb-818d-d72536b57bac",
"name": "便签8",
"type": "n8n-nodes-base.stickyNote",
"position": [
1360,
40
],
"parameters": {
"color": 5,
"width": 1112,
"height": 890,
"content": "## 场景 2 - AI 代理"
},
"typeVersion": 1
},
{
"id": "a825794d-e7f3-41ba-a113-8503ebaf2be7",
"name": "便签 10",
"type": "n8n-nodes-base.stickyNote",
"position": [
540,
1000
],
"parameters": {
"color": 5,
"width": 3285,
"height": 1139,
"content": "## 场景 1 - 从 Supabase 存储添加新文件的流程"
},
"typeVersion": 1
},
{
"id": "1d44ef3b-b1d9-481c-8078-2f0d8d586247",
"name": "AI Agent1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1960,
260
],
"parameters": {
"text": "={{ $('Merge').item.json.message }}",
"options": {
"systemMessage": "You are a helpful assistant.\n\nIMPORTANT Always use knowledge base to respond users.",
"passthroughBinaryImages": false
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "d1da58a8-e6c0-4a6d-aa53-88c223a97f0a",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1880,
480
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "SphXAX7rlwRLkiox",
"name": "Test club key"
}
},
"typeVersion": 1.2
},
{
"id": "acb2de9b-a9fa-4934-9759-b84b067dc26a",
"name": "简单记忆",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
2020,
480
],
"parameters": {
"sessionKey": "={{ $('Merge').item.json.session_id }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.3
},
{
"id": "4d91a4e9-e381-485a-847e-50b5dcc43f6b",
"name": "OpenAI1 嵌入",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
2160,
660
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "SphXAX7rlwRLkiox",
"name": "Test club key"
}
},
"typeVersion": 1.2
},
{
"id": "19b5a9a8-7407-4a1c-822f-3000b67da99b",
"name": "Supabase 向量存储",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
2160,
500
],
"parameters": {
"mode": "retrieve-as-tool",
"options": {},
"toolName": "knowledge_base",
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
},
"toolDescription": "Gather facts from knowledge base to respond user."
},
"credentials": {
"supabaseApi": {
"id": "t8AQJzvZvrOMDLec",
"name": "Supabase account info@ Demo"
}
},
"typeVersion": 1.1
},
{
"id": "0b48a55c-9b47-4913-9aec-264d3932c533",
"name": "文件已创建",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
600,
2480
],
"parameters": {
"event": "fileCreated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "1rFIHlWMlbt0vAh1CWjcmNOmJYk_8jUIb",
"cachedResultUrl": "https://drive.google.com/drive/folders/1rFIHlWMlbt0vAh1CWjcmNOmJYk_8jUIb",
"cachedResultName": "Case - dentist"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "1Irxryx1yQ3upU2i",
"name": "Google Drive account"
}
},
"typeVersion": 1
},
{
"id": "fd7a9260-7d85-4129-bf2d-f7700781091b",
"name": "下载文件",
"type": "n8n-nodes-base.googleDrive",
"position": [
1200,
2580
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Set File ID').last().json.file_id }}"
},
"options": {
"googleFileConversion": {
"conversion": {
"docsToFormat": "application/pdf",
"sheetsToFormat": "application/pdf",
"slidesToFormat": "application/pdf",
"drawingsToFormat": "application/pdf"
}
}
},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "1Irxryx1yQ3upU2i",
"name": "Google Drive account"
}
},
"executeOnce": true,
"typeVersion": 3
},
{
"id": "e17a7bc1-6483-439b-acb0-2b13f66466e5",
"name": "文件已更新",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
620,
2660
],
"parameters": {
"event": "fileUpdated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "1rFIHlWMlbt0vAh1CWjcmNOmJYk_8jUIb",
"cachedResultUrl": "https://drive.google.com/drive/folders/1rFIHlWMlbt0vAh1CWjcmNOmJYk_8jUIb",
"cachedResultName": "Case - dentist"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "1Irxryx1yQ3upU2i",
"name": "Google Drive account"
}
},
"typeVersion": 1
},
{
"id": "b0e5b639-cf0e-4289-8ce7-96e6fd1e831f",
"name": "删除旧文档行",
"type": "n8n-nodes-base.supabase",
"position": [
1020,
2580
],
"parameters": {
"tableId": "documents",
"operation": "delete",
"filterType": "string",
"filterString": "=metadata->>drive_file_id=like.*{{ $json.file_id }}*"
},
"credentials": {
"supabaseApi": {
"id": "QBhcokohbJHfQZ9A",
"name": "Supabase club"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "c583b665-b756-4b8c-8150-34f559df9007",
"name": "设置文件 ID",
"type": "n8n-nodes-base.set",
"position": [
860,
2580
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "10646eae-ae46-4327-a4dc-9987c2d76173",
"name": "file_id",
"type": "string",
"value": "={{ $json.id }}"
},
{
"id": "7d0b3a5e-9dfa-46d3-bf16-f6fc1d44f242",
"name": "extension",
"type": "string",
"value": "={{ $json.fileExtension }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "558473fe-cc06-41d8-ab06-cc6c03a8c40e",
"name": "创建文件记录1",
"type": "n8n-nodes-base.supabase",
"position": [
2380,
2780
],
"parameters": {
"tableId": "files",
"fieldsUi": {
"fieldValues": [
{
"fieldId": "name",
"fieldValue": "={{ $('Download File').item.binary.data.fileName }}"
},
{
"fieldId": "google_drive_id",
"fieldValue": "={{ $('Set File ID').item.json.file_id }}"
}
]
}
},
"credentials": {
"supabaseApi": {
"id": "t8AQJzvZvrOMDLec",
"name": "Supabase account info@ Demo"
}
},
"typeVersion": 1
},
{
"id": "87e490c4-f9cb-4821-a234-a9c9d2c93836",
"name": "默认数据加载器1",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
2640,
2980
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "=file_id",
"value": "={{ $json.id }}"
},
{
"name": "drive_file_id",
"value": "={{ $('Set File ID').item.json.file_id }}"
}
]
}
},
"jsonData": "={{ $('Set Text3').item.json.text }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "373efd3c-f7dd-4efc-a268-ed05d8b2e309",
"name": "OpenAI3 嵌入",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
2480,
2960
],
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "fLfRtaXbR0EVD0pl",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "17daf2dd-1d4c-498e-8404-7cc371f81894",
"name": "递归字符文本分割器1",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
2660,
3180
],
"parameters": {
"options": {},
"chunkSize": 500,
"chunkOverlap": 200
},
"typeVersion": 1
},
{
"id": "afcfc728-9798-4703-998d-edc535eb859e",
"name": "插入到 Supabase Vectorstore1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
2580,
2780
],
"parameters": {
"mode": "insert",
"options": {
"queryName": "match_documents"
},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
}
},
"credentials": {
"supabaseApi": {
"id": "t8AQJzvZvrOMDLec",
"name": "Supabase account info@ Demo"
}
},
"typeVersion": 1
},
{
"id": "78e7d15c-5797-488c-b869-bb887878e930",
"name": "便签11",
"type": "n8n-nodes-base.stickyNote",
"position": [
540,
2240
],
"parameters": {
"color": 5,
"width": 2465,
"height": 1139,
"content": "## 场景 3 - 从 Supabase 存储添加新文件的流程"
},
"typeVersion": 1
},
{
"id": "f572511d-6374-4b0b-8907-9f6c82179feb",
"name": "编辑字段",
"type": "n8n-nodes-base.set",
"position": [
1600,
300
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "ad3055e5-41eb-4e00-9f55-dbcde47a03c7",
"name": "session_id",
"type": "string",
"value": "={{ $('When chat message received').item.json.sessionId }}"
},
{
"id": "56126e31-5fe0-4a9c-b9c9-d62fcb8bd469",
"name": "message",
"type": "string",
"value": "={{ $('When chat message received').item.json.chatInput }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "be2de117-410c-49c2-b95c-45b4a0e036d6",
"name": "编辑字段1",
"type": "n8n-nodes-base.set",
"position": [
1600,
140
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "5e5fbeb0-d866-40fe-8c1b-66b946bd1cec",
"name": "session_id",
"type": "string",
"value": "={{ $('Webhook').item.json.body.session_id }}"
},
{
"id": "28ec27a5-f814-435c-a5bf-df92160eee3e",
"name": "message",
"type": "string",
"value": "={{ $('Webhook').item.json.body.message }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ce8790a1-55a5-4583-8301-03bbde363ee2",
"name": "上传文件",
"type": "n8n-nodes-base.httpRequest",
"position": [
2040,
1280
],
"parameters": {
"url": "https://api.cloud.llamaindex.ai/api/parsing/upload",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "multipart-form-data",
"sendHeaders": true,
"authentication": "genericCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "file",
"parameterType": "formBinaryData",
"inputDataFieldName": "data"
},
{
"name": "do_not_cache",
"value": "=true"
}
]
},
"genericAuthType": "httpHeaderAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "AkhbJSroTy15x6o9",
"name": "Llama parse bqman"
}
},
"typeVersion": 4.2
},
{
"id": "10b8cf52-4301-40a2-a27d-9952f1d3bcda",
"name": "获取处理状态",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
2240,
1280
],
"parameters": {
"url": "=https://api.cloud.llamaindex.ai/api/parsing/job/{{ $json.id }}",
"options": {},
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "AkhbJSroTy15x6o9",
"name": "Llama parse bqman"
}
},
"typeVersion": 4.2
},
{
"id": "c0fc7854-1d04-492d-9541-389356333efd",
"name": "等待以保持在服务限制内",
"type": "n8n-nodes-base.wait",
"position": [
2660,
1040
],
"webhookId": "17a96ed6-b5ff-47bb-a8a2-39c1eb40185a",
"parameters": {
"amount": 7
},
"typeVersion": 1.1
},
{
"id": "971b40d2-a320-4815-9ccc-27de52b58bbd",
"name": "作业是否就绪?",
"type": "n8n-nodes-base.switch",
"position": [
2420,
1280
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "PENDING",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "0fa97d86-432a-409a-917e-5f1a002b1ab9",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "PENDING"
}
]
},
"renameOutput": true
},
{
"outputKey": "ERROR",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e6058aa0-a3e2-4ce3-9bed-6ff41a5be052",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "ERROR"
}
]
},
"renameOutput": true
},
{
"outputKey": "CANCELED",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "ceb6338f-4261-40ac-be11-91f61c7302ba",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "CANCELED"
}
]
},
"renameOutput": true
},
{
"outputKey": "SUCCESS",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "300fce8c-b19a-4d0c-86e8-f62853c70ce2",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "SUCCESS"
}
]
},
"renameOutput": true
}
]
},
"options": {
"allMatchingOutputs": true
}
},
"typeVersion": 3
},
{
"id": "c8f65cc5-e67a-47ae-b43a-fc065fb4900e",
"name": "停止并报错",
"type": "n8n-nodes-base.stopAndError",
"position": [
2660,
1300
],
"parameters": {
"errorMessage": "Problem with Llamaparser. Error during parsing."
},
"typeVersion": 1
},
{
"id": "90658f0a-7236-493d-8dd0-fdad64196753",
"name": "获取解析数据",
"type": "n8n-nodes-base.httpRequest",
"position": [
2660,
1480
],
"parameters": {
"url": "=https://api.cloud.llamaindex.ai/api/parsing/job/{{ $json.id }}/result/markdown",
"options": {
"redirect": {
"redirect": {}
}
},
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "AkhbJSroTy15x6o9",
"name": "Llama parse bqman"
}
},
"typeVersion": 4.2
},
{
"id": "810aad96-7677-4c27-b3b2-25106b70083a",
"name": "便签 12",
"type": "n8n-nodes-base.stickyNote",
"position": [
2060,
1460
],
"parameters": {
"width": 280,
"height": 80,
"content": "### 添加 Llamaparse 头部认证"
},
"typeVersion": 1
},
{
"id": "a0fd62b8-219e-4eb7-b274-1344b0042fac",
"name": "合并",
"type": "n8n-nodes-base.merge",
"position": [
1800,
260
],
"parameters": {},
"typeVersion": 3.1
},
{
"id": "e5356266-5e4a-41a2-8151-95f994435560",
"name": "条件判断1",
"type": "n8n-nodes-base.if",
"position": [
1820,
1280
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "f05d708d-f36e-4c6d-8753-81a61ae42546",
"operator": {
"type": "string",
"operation": "notExists",
"singleValue": true
},
"leftValue": "={{ $json.data }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "c04fa3f9-74c6-4c7c-ae2a-46a797db0e55",
"name": "设置文本",
"type": "n8n-nodes-base.set",
"position": [
2060,
1600
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e9bbecd9-3d40-4a6a-9401-94daab15cde0",
"name": "text",
"type": "string",
"value": "={{ $('If1').item.json.data }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "2f41ef18-6229-4d3c-9a3c-8b02ec3c60b2",
"name": "设置文本1",
"type": "n8n-nodes-base.set",
"position": [
2840,
1480
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e9bbecd9-3d40-4a6a-9401-94daab15cde0",
"name": "text",
"type": "string",
"value": "={{ $('Get Parsed Data').item.json.markdown }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "9c92b25b-7762-4465-878f-6568073ba521",
"name": "合并文本",
"type": "n8n-nodes-base.merge",
"position": [
3060,
1620
],
"parameters": {},
"typeVersion": 3.1
},
{
"id": "4a523ad6-d74d-4207-8347-facc7f313fdd",
"name": "上传文件1",
"type": "n8n-nodes-base.httpRequest",
"position": [
1380,
2580
],
"parameters": {
"url": "https://api.cloud.llamaindex.ai/api/parsing/upload",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "multipart-form-data",
"sendHeaders": true,
"authentication": "genericCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "file",
"parameterType": "formBinaryData",
"inputDataFieldName": "data"
},
{
"name": "do_not_cache",
"value": "=true"
}
]
},
"genericAuthType": "httpHeaderAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "AkhbJSroTy15x6o9",
"name": "Llama parse bqman"
}
},
"typeVersion": 4.2
},
{
"id": "c0a43e5e-ec2b-49f5-bbc0-cef914c68c4c",
"name": "获取处理状态1",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
1580,
2580
],
"parameters": {
"url": "=https://api.cloud.llamaindex.ai/api/parsing/job/{{ $json.id }}",
"options": {},
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "AkhbJSroTy15x6o9",
"name": "Llama parse bqman"
}
},
"typeVersion": 4.2
},
{
"id": "68cc70a4-dba0-4ec9-8506-88bb20b37e87",
"name": "等待以保持在服务限制内1",
"type": "n8n-nodes-base.wait",
"position": [
2000,
2340
],
"webhookId": "17a96ed6-b5ff-47bb-a8a2-39c1eb40185a",
"parameters": {
"amount": 7
},
"typeVersion": 1.1
},
{
"id": "aef3b805-166e-47a8-a81c-900f999ae045",
"name": "作业是否就绪?1",
"type": "n8n-nodes-base.switch",
"position": [
1760,
2580
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "PENDING",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "0fa97d86-432a-409a-917e-5f1a002b1ab9",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "PENDING"
}
]
},
"renameOutput": true
},
{
"outputKey": "ERROR",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e6058aa0-a3e2-4ce3-9bed-6ff41a5be052",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "ERROR"
}
]
},
"renameOutput": true
},
{
"outputKey": "CANCELED",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "ceb6338f-4261-40ac-be11-91f61c7302ba",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "CANCELED"
}
]
},
"renameOutput": true
},
{
"outputKey": "SUCCESS",
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "300fce8c-b19a-4d0c-86e8-f62853c70ce2",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "SUCCESS"
}
]
},
"renameOutput": true
}
]
},
"options": {
"allMatchingOutputs": true
}
},
"typeVersion": 3
},
{
"id": "5233be31-2ecf-4ddd-96e2-b0fd614f535f",
"name": "停止并报错1",
"type": "n8n-nodes-base.stopAndError",
"position": [
2000,
2600
],
"parameters": {
"errorMessage": "Problem with Llamaparser. Error during parsing."
},
"typeVersion": 1
},
{
"id": "09283faa-4ab9-4d59-a610-3491d7f2daf8",
"name": "获取解析数据1",
"type": "n8n-nodes-base.httpRequest",
"position": [
2000,
2780
],
"parameters": {
"url": "=https://api.cloud.llamaindex.ai/api/parsing/job/{{ $json.id }}/result/markdown",
"options": {
"redirect": {
"redirect": {}
}
},
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "AkhbJSroTy15x6o9",
"name": "Llama parse bqman"
}
},
"typeVersion": 4.2
},
{
"id": "5ef6959d-1eb4-49cd-9b19-3b0e1aaa0eb7",
"name": "便签 13",
"type": "n8n-nodes-base.stickyNote",
"position": [
1400,
2760
],
"parameters": {
"width": 280,
"height": 80,
"content": "### 添加 Llamaparse 头部认证"
},
"typeVersion": 1
},
{
"id": "18fd1d0f-664e-4584-8154-794ca8aad768",
"name": "设置文本3",
"type": "n8n-nodes-base.set",
"position": [
2180,
2780
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e9bbecd9-3d40-4a6a-9401-94daab15cde0",
"name": "text",
"type": "string",
"value": "={{ $('Get Parsed Data1').item.json.markdown }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "337b8593-8f5a-47b2-8b75-f5b3b4195fe8",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
1420,
140
],
"webhookId": "05979e87-19bc-4e8b-adbb-7e04808f8b21",
"parameters": {
"path": "05979e87-19bc-4e8b-adbb-7e04808f8b21",
"options": {},
"httpMethod": "POST",
"responseMode": "lastNode"
},
"typeVersion": 2
},
{
"id": "7911c133-f998-4efd-a9c8-9c52c8e545c4",
"name": "便签14",
"type": "n8n-nodes-base.stickyNote",
"position": [
2380,
2660
],
"parameters": {
"width": 480,
"height": 80,
"content": "### 替换凭据。"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"If": {
"main": [
[
{
"node": "Download",
"type": "main",
"index": 0
}
],
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "Upload File",
"type": "main",
"index": 0
}
],
[
{
"node": "Set Text",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "AI Agent1",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
},
"Download": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"Set Text": {
"main": [
[
{
"node": "Merge Text",
"type": "main",
"index": 1
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Get All files",
"type": "main",
"index": 0
}
]
]
},
"Set Text1": {
"main": [
[
{
"node": "Merge Text",
"type": "main",
"index": 0
}
]
]
},
"Set Text3": {
"main": [
[
{
"node": "Create File record1",
"type": "main",
"index": 0
}
]
]
},
"Merge Text": {
"main": [
[
{
"node": "Create File record2",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Set File ID": {
"main": [
[
{
"node": "Delete Old Doc Rows",
"type": "main",
"index": 0
}
]
]
},
"Upload File": {
"main": [
[
{
"node": "Get Processing Status",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"File Created": {
"main": [
[
{
"node": "Set File ID",
"type": "main",
"index": 0
}
]
]
},
"File Updated": {
"main": [
[
{
"node": "Set File ID",
"type": "main",
"index": 0
}
]
]
},
"Upload File1": {
"main": [
[
{
"node": "Get Processing Status1",
"type": "main",
"index": 0
}
]
]
},
"Download File": {
"main": [
[
{
"node": "Upload File1",
"type": "main",
"index": 0
}
]
]
},
"Get All Files": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Get All files": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Is Job Ready?": {
"main": [
[
{
"node": "Wait to stay within service limits",
"type": "main",
"index": 0
}
],
[
{
"node": "Stop and Error",
"type": "main",
"index": 0
}
],
[
{
"node": "Stop and Error",
"type": "main",
"index": 0
}
],
[
{
"node": "Get Parsed Data",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent1",
"type": "ai_memory",
"index": 0
}
]
]
},
"Is Job Ready?1": {
"main": [
[
{
"node": "Wait to stay within service limits1",
"type": "main",
"index": 0
}
],
[
{
"node": "Stop and Error1",
"type": "main",
"index": 0
}
],
[
{
"node": "Stop and Error1",
"type": "main",
"index": 0
}
],
[
{
"node": "Get Parsed Data1",
"type": "main",
"index": 0
}
]
]
},
"Get Parsed Data": {
"main": [
[
{
"node": "Set Text1",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Get Parsed Data1": {
"main": [
[
{
"node": "Set Text3",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Insert into Supabase Vectorstore",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Embeddings OpenAI3": {
"ai_embedding": [
[
{
"node": "Insert into Supabase Vectorstore1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Create File record1": {
"main": [
[
{
"node": "Insert into Supabase Vectorstore1",
"type": "main",
"index": 0
}
]
]
},
"Create File record2": {
"main": [
[
{
"node": "Insert into Supabase Vectorstore",
"type": "main",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Insert into Supabase Vectorstore",
"type": "ai_document",
"index": 0
}
]
]
},
"Delete Old Doc Rows": {
"main": [
[
{
"node": "Download File",
"type": "main",
"index": 0
}
]
]
},
"Default Data Loader1": {
"ai_document": [
[
{
"node": "Insert into Supabase Vectorstore1",
"type": "ai_document",
"index": 0
}
]
]
},
"Get Processing Status": {
"main": [
[
{
"node": "Is Job Ready?",
"type": "main",
"index": 0
}
],
[
{
"node": "Stop and Error",
"type": "main",
"index": 0
}
]
]
},
"Supabase Vector Store": {
"ai_tool": [
[
{
"node": "AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get Processing Status1": {
"main": [
[
{
"node": "Is Job Ready?1",
"type": "main",
"index": 0
}
],
[
{
"node": "Stop and Error1",
"type": "main",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Insert into Supabase Vectorstore": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "Get All Files",
"type": "main",
"index": 0
}
]
]
},
"Recursive Character Text Splitter1": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader1",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Wait to stay within service limits": {
"main": [
[
{
"node": "Get Processing Status",
"type": "main",
"index": 0
}
]
]
},
"Wait to stay within service limits1": {
"main": [
[
{
"node": "Get Processing Status1",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 工程, 人工智能, IT 运维
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
与Supabase存储中文件对话的AI智能体
与Supabase存储中文件对话的AI智能体
If
Merge
Switch
+15
33 节点Mark Shcherbakov
工程
宠物店 4
🐶 宠物店预约 AI 代理
If
Set
Code
+41
187 节点Bruno Dias
人工智能
[模板] AI宠物店 v8
🐶 AI宠物店助手 - 集成GPT-4o、Google日历和WhatsApp/Instagram/Facebook
If
N8n
Set
+38
244 节点Amanda Benks
销售
AI 代理餐厅 [模板]
🤖 WhatsApp、Instagram 和 Messenger 的 AI 餐厅助手
If
N8n
Set
+37
239 节点Amanda Benks
其他
上下文混合RAG AI文案
Google Drive到Supabase上下文向量数据库同步用于RAG应用
If
Set
Code
+25
76 节点Michael Taleb
AI RAG 检索增强
🤖 WhatsApp AI个人助手:GPT-4o、记忆和日程安排功能
AI个人助手:集成GPT-4o、RAG和语音功能,使用Supabase的WhatsApp助手
If
Set
Wait
+22
76 节点Amanda Benks
人工智能
工作流信息
难度等级
高级
节点数量62
分类3
节点类型23
作者
Mark Shcherbakov
@lowcodingdevI am a business analyst with a development background, dedicated to helping small businesses and entrepreneurs leverage cloud services for increased efficiency. My expertise lies in automating manual workflows, integrating data from multiple cloud service providers, creating insightful dashboards, and building custom CRM systems. https://www.linkedin.com/in/marklowcoding/
外部链接
在 n8n.io 查看 →
分享此工作流