导出_dian-memo_03
高级
这是一个AI RAG, Multimodal AI领域的自动化工作流,包含 30 个节点。主要使用 If, Set, Code, Switch, Webhook 等节点。 AI语音与文本笔记 - 集成LINE消息、Supabase向量数据库和Gmail
前置要求
- •HTTP Webhook 端点(n8n 会自动生成)
- •Google 账号和 Gmail API 凭证
- •可能需要目标 API 的认证凭证
- •OpenAI API Key
- •PostgreSQL 数据库连接信息
- •Supabase URL 和 API Key
使用的节点 (30)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "0G6evny3MkWG2m0e",
"meta": {
"instanceId": "9101df148a9ab5ba09dd343a0c584806dbd6c3b74e74be8e97699184269b6877",
"templateCredsSetupCompleted": true
},
"name": "导出_dian-memo_03",
"tags": [],
"nodes": [
{
"id": "c871501d-7ec4-43ee-8717-5fcd710386d7",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-224,
416
],
"parameters": {
"text": "={{ $json.text }}",
"options": {
"systemMessage": "=# Overview\nYou are an AI assistant. Your job is to route the user's requests to the appropriate tool. \n## Current date and time: {{ $now }}\n\n## Tools\n- SupabaseVectorStore: Use this tool to search the stored note contents"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "371356c4-2517-4f0d-9246-cad3c1109afd",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-224,
256
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-5",
"cachedResultName": "gpt-5"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "mO23EZGRXh9cFi9G",
"name": "OpenAi account 2"
}
},
"typeVersion": 1.2
},
{
"id": "26940193-c90a-413e-9636-0eba2fb94975",
"name": "条件分支",
"type": "n8n-nodes-base.switch",
"position": [
-976,
336
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "490a2e00-427a-4e64-b843-d3ab5132cf7a",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.events[0].message.type }}",
"rightValue": "text"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "90a70d6a-b520-424b-8ee0-d5934d0aa527",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.events[0].message.type }}",
"rightValue": "audio"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "942105a4-fd50-455b-a55f-04dfb9e396f0",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.events[0].message.type }}",
"rightValue": "image"
}
]
}
}
]
},
"options": {
"fallbackOutput": "extra"
}
},
"typeVersion": 3.2,
"alwaysOutputData": false
},
{
"id": "1102bedb-9d07-438c-9065-2a283a54a509",
"name": "编辑字段",
"type": "n8n-nodes-base.set",
"position": [
496,
416
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "07546a45-4cc5-44fa-b1c8-0121fddca393",
"name": "output",
"type": "string",
"value": "={{ $json.output }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "7755e26b-363f-4e22-82ab-5330f5fa7472",
"name": "条件判断",
"type": "n8n-nodes-base.if",
"position": [
-1200,
384
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c2c0b91e-6d91-4fae-87b4-287f02c77447",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.events[0].source.userId }}",
"rightValue": "{{ YOUR_USERID }}"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "a18e2b30-fb73-4923-b119-b861a3d0d6a2",
"name": "下载",
"type": "n8n-nodes-base.httpRequest",
"position": [
-752,
304
],
"parameters": {
"url": "=https://api-data.line.me/v2/bot/message/{{ $json.body.events[0].message.id }}/content",
"options": {},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer {{ LINE_CHANNELACCESS_TOKEN }}"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "61564b93-cd7d-41ff-a9ee-5fb880974aa6",
"name": "转录",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-608,
304
],
"parameters": {
"options": {},
"resource": "audio",
"operation": "transcribe"
},
"credentials": {
"openAiApi": {
"id": "mO23EZGRXh9cFi9G",
"name": "OpenAi account 2"
}
},
"typeVersion": 1.6
},
{
"id": "5c96a89b-fa79-4594-8f77-51e8e46d3f3b",
"name": "条件判断1",
"type": "n8n-nodes-base.if",
"position": [
-432,
64
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "5369dda9-dfe5-4f04-b5b7-10fbbd5ea6c0",
"operator": {
"type": "string",
"operation": "startsWith"
},
"leftValue": "={{ $json.text }}",
"rightValue": "Diane"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "4d49e76a-7f84-4267-ada8-b4c0739ca53d",
"name": "OpenAI 嵌入",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
48,
-96
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "mO23EZGRXh9cFi9G",
"name": "OpenAi account 2"
}
},
"typeVersion": 1.2
},
{
"id": "667176b3-1cd5-41e4-9e54-9267e460dea7",
"name": "默认数据加载器",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
240,
-96
],
"parameters": {
"options": {},
"jsonData": "={{ $json.text }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "6a0109e0-87cb-4907-b067-9dd7548c9234",
"name": "递归字符文本分割器",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
240,
96
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "0c9bd4fa-f561-4ffc-9d51-897fc51c0360",
"name": "添加到 Supabase 表",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
96,
-304
],
"parameters": {
"mode": "insert",
"options": {},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
}
},
"credentials": {
"supabaseApi": {
"id": "WHJLoIOqiBxwQBqZ",
"name": "Supabase account"
}
},
"typeVersion": 1
},
{
"id": "a6882f89-e938-44a1-9e2d-b64efcb84023",
"name": "Postgres 聊天记忆",
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
"position": [
-96,
256
],
"parameters": {
"sessionKey": "={{ $('LINE input').item.json.body.events[0].source.userId }}",
"sessionIdType": "customKey",
"contextWindowLength": 50
},
"credentials": {
"postgres": {
"id": "hsZ51SvdDZSndg0C",
"name": "Postgres supabase"
}
},
"typeVersion": 1.3
},
{
"id": "f3e11c30-dcd6-46f2-9e5e-ccc4058c41b5",
"name": "Supabase 向量存储",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
-112,
640
],
"parameters": {
"mode": "retrieve-as-tool",
"options": {},
"toolName": "SupabaseVectorStore",
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
},
"toolDescription": "Use this to get information about the AI Voice Agent Framework"
},
"credentials": {
"supabaseApi": {
"id": "WHJLoIOqiBxwQBqZ",
"name": "Supabase account"
}
},
"typeVersion": 1
},
{
"id": "65cc8d2b-8bb5-46f4-b192-86af6527ad53",
"name": "嵌入",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
-112,
784
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "mO23EZGRXh9cFi9G",
"name": "OpenAi account 2"
}
},
"typeVersion": 1.2
},
{
"id": "13a0a059-2f76-4788-b921-ec4256bdc55d",
"name": "编辑字段1",
"type": "n8n-nodes-base.set",
"position": [
464,
-304
],
"parameters": {
"mode": "raw",
"options": {},
"jsonOutput": "{\n \"output\": \"Notes saved.\"\n}\n"
},
"typeVersion": 3.4
},
{
"id": "d1d214df-c319-4d2f-b8f2-6e60b36bc877",
"name": "代码",
"type": "n8n-nodes-base.code",
"position": [
-272,
0
],
"parameters": {
"jsCode": "// JavaScript for n8n Code node\n\n// Get input data (in n8n, usually use $input.all())\nconst items = $input.all();\n\n// Define the list of prefixes to remove\nconst prefixesToRemove = ['Diane'];\n\n// Process each item\nconst processedItems = items.map(item => {\n // Retrieve the message (adjust the field name according to your structure)\n let message = item.json.message || item.json.text || item.json.body;\n \n if (message && typeof message === 'string') {\n // Check each prefix and remove if it matches\n for (const prefix of prefixesToRemove) {\n // If the message starts with the prefix\n if (message.startsWith(prefix)) {\n // Remove the prefix\n message = message.substring(prefix.length);\n \n // If the next character is \"、\", remove it\n if (message.startsWith('、')) {\n message = message.substring(1);\n }\n \n // Exit loop after handling one prefix\n break;\n }\n }\n \n // Set the processed message\n return {\n json: {\n text: message.trim() // Also remove leading and trailing spaces\n }\n };\n }\n \n // If the message is not a string, return it as is\n return item;\n});\n\nreturn processedItems;"
},
"typeVersion": 2
},
{
"id": "72e08acb-4781-4e81-9b7e-51ecd8cdef94",
"name": "计划触发器",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-1408,
880
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 7
}
]
}
},
"typeVersion": 1.2
},
{
"id": "bf9dfb91-0728-417c-977a-8f4355510596",
"name": "编辑字段2",
"type": "n8n-nodes-base.set",
"position": [
-1200,
880
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "25573dfc-1794-40c7-8848-080142d8da12",
"name": "text",
"type": "string",
"value": "最新のメモ内容を3件拾って内容をメールしてください。"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "5f6097d3-a767-42a9-8139-7c480722a8d5",
"name": "AI Agent1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-912,
880
],
"parameters": {
"text": "={{ $json.text }}",
"options": {
"systemMessage": "=# Overview\nYou are an AI assistant. Your job is to route the user's requests to the appropriate tool. \n## Current date and time: {{ $now }}\n\n## Tools\n- Send a message in Gmail: Use this tool to perform actions via email \n- SupabaseVectorStore: Use this tool to search the stored note contents\n"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "c7ea4fbc-4ca4-49ba-946e-4452722d3267",
"name": "OpenAI 聊天模型1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-912,
720
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-5",
"cachedResultName": "gpt-5"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "mO23EZGRXh9cFi9G",
"name": "OpenAi account 2"
}
},
"typeVersion": 1.2
},
{
"id": "b0afd9ab-c39f-465f-ab1c-c4a7a15f6688",
"name": "Supabase 向量存储1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
-768,
1136
],
"parameters": {
"mode": "retrieve-as-tool",
"options": {},
"toolName": "SupabaseVectorStore",
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
},
"toolDescription": "Use this to get information about the AI Voice Agent Framework"
},
"credentials": {
"supabaseApi": {
"id": "WHJLoIOqiBxwQBqZ",
"name": "Supabase account"
}
},
"typeVersion": 1
},
{
"id": "30130269-f1be-4efb-b215-3cc822f373de",
"name": "嵌入1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
-768,
1280
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "mO23EZGRXh9cFi9G",
"name": "OpenAi account 2"
}
},
"typeVersion": 1.2
},
{
"id": "169693f6-4e54-4e34-8192-f789393765b3",
"name": "在 Gmail1 中发送消息",
"type": "n8n-nodes-base.gmailTool",
"position": [
-896,
1088
],
"webhookId": "5a600cd1-4f5d-4456-9732-c95fdc84f72a",
"parameters": {
"sendTo": "{{ YOUR_EMAIL_ADDRESS }}",
"message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
"options": {},
"subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "JgLizpUVskDjX9xs",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "d289fb3a-c425-4f00-809c-7018f7778e9c",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
560
],
"parameters": {
"color": 4,
"width": 1264,
"height": 848,
"content": "## 笔记邮件递送"
},
"typeVersion": 1
},
{
"id": "4e09bcb3-afa3-47a2-93a0-90345592a88f",
"name": "便签 1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-496,
-352
],
"parameters": {
"width": 384,
"height": 544,
"content": "## 触发关键词"
},
"typeVersion": 1
},
{
"id": "5fac0f47-1960-4bc4-86f0-14db86822ced",
"name": "便签 2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1680,
-592
],
"parameters": {
"color": 3,
"width": 800,
"height": 800,
"content": "## Diane 备忘录(AI 语音和文本笔记记录智能体,支持 RAG)"
},
"typeVersion": 1
},
{
"id": "ba1c0ada-8c94-4bc3-b8c7-a32a06a0134d",
"name": "LINE 输入",
"type": "n8n-nodes-base.webhook",
"position": [
-1408,
384
],
"webhookId": "9010aea3-7129-4700-b79c-314b4e9f989b",
"parameters": {
"path": "9010aea3-7129-4700-b79c-314b4e9f989b",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2
},
{
"id": "20f99fcd-0187-44db-a172-6b5b7aec0a0b",
"name": "LINE 输出",
"type": "n8n-nodes-base.httpRequest",
"position": [
800,
48
],
"parameters": {
"url": "https://api.line.me/v2/bot/message/reply",
"method": "POST",
"options": {},
"jsonBody": "={\n\"replyToken\": \"{{ $('LINE input').item.json.body.events[0].replyToken }}\",\n\"messages\": [\n{\n\"type\": \"text\",\n\"text\": {{ JSON.stringify($json.output) }}\n}\n]\n} ",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer {{ LINE_CHANNELACCESS_TOKEN }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "7808031c-67ca-4e6d-9d01-7f803410c22b",
"name": "仅消息",
"type": "n8n-nodes-base.set",
"position": [
-656,
112
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "19d5cd1e-8e1c-448d-8cef-ee18f015682c",
"name": "text",
"type": "string",
"value": "={{ $json.body.events[0].message.text }}"
}
]
}
},
"typeVersion": 3.4
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "b45a00a8-19ce-46f1-8f21-018547eabd6b",
"connections": {
"If": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
],
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Add to Supabase Table",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "only message",
"type": "main",
"index": 0
}
],
[
{
"node": "Download",
"type": "main",
"index": 0
}
],
[]
]
},
"AI Agent": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Download": {
"main": [
[
{
"node": "Transcribe",
"type": "main",
"index": 0
}
]
]
},
"AI Agent1": {
"main": [
[]
]
},
"Embeddings": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"LINE input": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Transcribe": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "LINE output",
"type": "main",
"index": 0
}
]
]
},
"Embeddings1": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[
{
"node": "LINE output",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields2": {
"main": [
[
{
"node": "AI Agent1",
"type": "main",
"index": 0
}
]
]
},
"only message": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Edit Fields2",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Add to Supabase Table",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "AI Agent1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Add to Supabase Table",
"type": "ai_document",
"index": 0
}
]
]
},
"Postgres Chat Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Add to Supabase Table": {
"main": [
[
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
},
"Supabase Vector Store": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Supabase Vector Store1": {
"ai_tool": [
[
{
"node": "AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
},
"Send a message in Gmail1": {
"ai_tool": [
[
{
"node": "AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - AI RAG 检索增强, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
宠物店 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
其他
Telegram AI支持聊天机器人(多模态输入)
使用GPT-4和Supabase RAG创建多模态Telegram支持机器人
If
Set
Code
+17
51 节点Ezema Kingsley Chibuzo
客服机器人
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+93
113 节点I versus AI
其他
上下文混合RAG AI文案
Google Drive到Supabase上下文向量数据库同步用于RAG应用
If
Set
Code
+25
76 节点Michael Taleb
AI RAG 检索增强
工作流信息
难度等级
高级
节点数量30
分类2
节点类型17
作者
kote2
@kote2I share practical examples and ideas for AI automation using tools like n8n, explained in a way that’s easy for beginners to understand. While Dify is currently more well-known in Japan, n8n complements it and is expected to gain even more attention in the future. This channel aims to be a practical guide you can rely on when that wave of popularity arrives. That said, I’m still learning too—so let’s learn and grow together!
外部链接
在 n8n.io 查看 →
分享此工作流