n8n 本地汉化部署、流式返回、cursor提示词生成n8n流程
目录
一、为什么要选择n8n
开源与灵活性
n8n是一个开源的工作流自动化工具,允许用户自由修改和扩展其功能。开源特性使得企业可以根据自身需求定制解决方案,无需依赖供应商的封闭生态系统。
可视化工作流设计
n8n提供直观的拖拽式界面,用户无需编写代码即可构建复杂的工作流。节点式的设计让逻辑清晰可见,降低了非技术用户的使用门槛,同时支持开发者通过自定义节点实现高级功能。
广泛的应用集成
支持超过200种第三方应用和服务(如飞书、Google Sheets、MySQL等),涵盖常见的企业工具和API。用户可以通过预置节点快速连接不同平台,实现数据同步或任务自动化。
自托管与数据控制
支持本地或私有云部署,确保敏感数据不经过第三方服务器。对于注重数据隐私和合规性的企业,自托管选项提供了更高的安全性和控制权。
成本效益
免费的开源版本已包含核心功能,适合中小团队或预算有限的场景。企业版提供额外支持和服务。
社区与扩展性
活跃的开发者社区持续贡献新节点和插件,生态不断扩展。用户可复用共享的工作流模板,或基于社区反馈快速解决问题。
错误处理与调试
内置详细的错误日志和重试机制,支持逐步调试工作流。每个节点的输入输出数据可实时查看,便于排查问题并优化流程。
二、使用 Docker 进行汉化部署
1、确保已安装 Docker 并启动服务
docker --version
2、拉取n8n镜像
docker pull n8nio/n8n:1.106.3
3、下载汉化包
https://github.com/other-blowsnow/n8n-i18n-chinese
选择与n8n版本匹配的汉化包

4、启动n8n服务
docker run -itd --name n8n \
-p 5678:5678 \
-v E:\dockerData\n8n\ui\n8n-i18n-chinese-n8n-1.106.3\editor-ui-dist:/usr/local/lib/node_modules/n8n/node_modules/n8n-editor-ui/dist \
-v E:\dockerData\n8n\data:/home/node/.n8n docker.n8n.io/n8nio/n8n \
-e N8N_DEFAULT_LOCALE=zh-CN \
-e N8N_SECURE_COOKIE=false \
n8nio/n8n:1.106.3
5、访问http://127.0.0.1:5678进行注册




三、n8n重要节点详解
1、error trigger 错误触发节点
您可以使用“错误触发器”节点创建错误工作流。当另一个链接的工作流失败时,此节点会获取有关失败工作流和错误的详细信息,并运行该错误工作流。
用法#
创建一个新的工作流,以错误触发器作为第一个节点。为工作流命名,例如"错误处理工作流"。

在您想要使用此错误工作流的工作流中:选择选项 >设置。在“错误工作流”中,选择您刚刚创建的工作流。例如,如果您使用的名称是“错误处理工作流”,请选择“错误处理工作流”。选择保存。现在,当此工作流出现错误时,相关的错误工作流就会运行。


请注意以下事项:
- 如果工作流使用错误触发器节点,则不必激活该工作流。
- 如果工作流包含错误触发器节点,则默认情况下,工作流将使用自身作为错误工作流。
- 手动运行工作流时,无法测试错误工作流。错误触发器仅在自动工作流出现错误时运行
模板 错误处理工作流.json
{
"name": "错误处理工作流",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.errorTrigger",
"typeVersion": 1,
"position": [
-1360,
-144
],
"id": "d42c3480-4d5f-465e-a52b-b2eca187f393",
"name": "Error Trigger"
},
{
"parameters": {
"resource": "message",
"operation": "message:send",
"receive_id_type": "chat_id",
"receive_id": "oc_920510c635c9026cc4d4d1d2d269cc9c",
"msg_type": "post",
"content": "={\n \"zh_cn\": {\n \"title\": \"🚨 n8n流程【{{ $('Error Trigger').item.json.workflow.name }}】报错\",\n \"content\": [\n [\n { \"tag\": \"at\", \"user_id\": \"'all'\", \"style\": [\"bold\"] },\n { \"tag\": \"text\", \"text\": \" 时间 \" },\n { \"tag\": \"text\", \"text\": \"'{{$now.toISO()}}'\", \"style\": [\"italic\"] }\n ],\n [\n { \"tag\": \"text\", \"text\": \"📦 节点:\\n\", \"style\": [\"bold\"] },\n { \"tag\": \"text\", \"text\": \"'{{ $('Error Trigger').item.json.execution.lastNodeExecuted }}'\" }\n ],\n [\n { \"tag\": \"code_block\", \"language\": \"BASH\", \"text\": \"'{{ $json.msg }}'\" }\n ],\n [{ \"tag\": \"hr\" }],\n [\n { \"tag\": \"a\", \"href\": \"http://101.200.2.51:30128/\", \"text\": \"🚀 打开n8n查看\", \"style\": [\"underline\"] }\n ]\n ]\n }\n}",
"uuid": "={{ $json.uuid }}"
},
"type": "n8n-nodes-feishu-lite.feishuNode",
"typeVersion": 1,
"position": [
-800,
-144
],
"id": "50c5ea98-8300-4be3-bb1d-379a9b7302a1",
"name": "AI 项目群",
"credentials": {
"feishuCredentialsApi": {
"id": "mVhnd56TMrg87lv4",
"name": "飞书"
}
}
},
{
"parameters": {
"jsCode": "// ---------- UUID v4(兼容无 crypto) ----------\nfunction uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16); \n });\n}\n// ----------------------------------------------\n \nconst result = [];\nlet msg = $input.first().json.execution.error.message; \nif (msg == null || msg === '') msg = '无错误信息';\n \nmsg = msg \n .replace(/&/g,'&')\n .replace(/</g,'<')\n .replace(/>/g,'>')\n .replace(/\"/g,'"');\n \nresult.push({ json: { msg, uuid: uuidv4() } });\nreturn result;"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-1104,
-144
],
"id": "8a63831a-efa2-4c0e-b135-68a2c9059eec",
"name": "错误消息预处理"
}
],
"pinData": {},
"connections": {
"Error Trigger": {
"main": [
[
{
"node": "错误消息预处理",
"type": "main",
"index": 0
}
]
]
},
"AI 项目群": {
"main": [
[]
]
},
"错误消息预处理": {
"main": [
[
{
"node": "AI 项目群",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "f41745b8-61bb-43fe-9eed-4b42eab5e4b7",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "068134889c44a2abf76471c51e27d27ae89c42c095867632434eb67657a01374"
},
"id": "dglynGYZrGzRLiND",
"tags": []
}
2、Webhook 节点
使用 Webhook 节点创建webhook,当事件发生时,它可以从应用和服务接收数据。它是一个触发节点,这意味着它可以启动 n8n 工作流。这允许服务连接到 n8n 并运行工作流。当您需要接收数据并基于该数据运行工作流时,可以使用 Webhook 节点作为工作流的触发器。Webhook 节点还支持返回工作流结束时生成的数据。这使得它非常适合构建用于处理数据并返回结果的工作流,就像 API 端点一样。
节点参数#
使用这些参数来配置您的节点。
Webhook URL#
Webhook 节点有两个Webhook URL:测试和生产。n8n 在节点面板顶部显示 URL。
选择测试 URL或生产 URL来切换 n8n 显示的 URL。
Webhook 节点的“参数”选项卡中的示例 Webhook URL
- 测试:如果工作流未处于活动状态,当您选择“监听测试事件”或“执行工作流”时, n8n 会注册一个测试 webhook 。当您调用 webhook URL 时,n8n 会显示工作流中的数据。
- 生产:当您激活工作流时,n8n 会注册一个生产 Webhook。使用生产 URL 时,n8n 不会显示工作流中的数据。您仍然可以查看生产执行的工作流数据:在工作流中选择“执行”选项卡,然后选择要查看的工作流执行。
HTTP 方法#
Webhook 节点支持标准HTTP 请求方法:
- DELETE
- GET
- HEAD
- PATCH
- POST
-
PUT
-
Webhook 最大有效载荷
Webhook 的最大负载大小为 16MB。如果您自行托管 n8n,则可以使用端点环境变量
N8N_PAYLOAD_SIZE_MAX更改此值。流式返回

如果选择流式返回则只会返回支持流式返回的节点的数据
1、AI AGENT节点
2、Respond to Webhook 节点

四、常用模板分享
1、知识库

{ "name": "知识库", "nodes": [ { "parameters": { "promptType": "define", "text": "=你是一个智能助手,请根据知识库的内容来回答问题,请列举知识库中的数据并用中文简体回答,当所有知识库内容都与问题无关时,你的回答只能是\"知识库中无此内容!\"这句话。\n 以下是知识库:\n {{ $('限制数据条数').item.json.data.chunks[0].content }}\n 以上是知识库。 \n\n用户问题:{{ $('问题优化').item.json.output }}", "options": {} }, "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 2.1, "position": [ 400, -384 ], "id": "717df319-e12c-44d9-a7e4-2e8fcb08cad0", "name": "问题总结" }, { "parameters": { "method": "POST", "url": "http://172.16.105.225:8081/api/v1/retrieval", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" }, { "name": "Authorization", "value": "Bearer ragflow-UxYmQ3MGIyYzQxODExZWY5NDVmMDI0Mm" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={\n \"question\": \"{{ $json.output }}\",\n \"similarity_threshold\": \"0.2\",\n \"vector_similarity_weight\": \"0.7\",\n \"top_k\": \"5\",\n \"keyword\": \"true\",\n \"rerank_id\": \"gte-rerank\",\n \"dataset_ids\": [\"120f27aeed0211ef9a76164d31ef32ea\"]\n} ", "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ -432, -384 ], "id": "329a253e-11e6-43b0-bf00-27eb35b1731e", "name": "获取知识库" }, { "parameters": { "jsCode": "// 获取原始数据\nconst originalData = $input.all()[0].json;\n\n// 检查数据结构并限制chunks数组只保留前3条\nif (originalData && originalData.data && originalData.data.chunks) {\n // 只保留前3条数据\n originalData.data.chunks = originalData.data.chunks.slice(0, 3);\n \n // 更新total字段\n originalData.data.total = Math.min(originalData.data.chunks.length, 3);\n}\n\n// 返回处理后的数据\nreturn [{\n json: originalData\n}];" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ -144, -384 ], "id": "54875f63-fff1-448e-becd-690b0a88831a", "name": "限制数据条数" }, { "parameters": { "model": { "__rl": true, "value": "qwen-plus", "mode": "list", "cachedResultName": "qwen-plus" }, "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "typeVersion": 1.2, "position": [ -896, -128 ], "id": "2477c0f3-f6f1-48ab-af6c-26c604ec4d39", "name": "qwen-plus", "credentials": { "openAiApi": { "id": "wBN3YtuMB8ojYePo", "name": "阿里云百炼" } } }, { "parameters": { "jsCode": "// 获取上海时区的当前时间\nconst now = new Date();\nconst shanghaiOffset = 8 * 60; // 东八区,单位分钟\nconst localNow = new Date(now.getTime() + (shanghaiOffset - now.getTimezoneOffset()) * 60000);\n\n// 格式化函数\nfunction formatDate(date) {\n const y = date.getFullYear();\n const m = String(date.getMonth() + 1).padStart(2, '0');\n const d = String(date.getDate()).padStart(2, '0');\n return `${y}-${m}-${d}`;\n}\n\n// today\nconst today = formatDate(localNow);\n\n// yesterday\nconst yesterdayDate = new Date(localNow);\nyesterdayDate.setDate(localNow.getDate() - 1);\nconst yesterday = formatDate(yesterdayDate);\n\n// tomorrow\nconst tomorrowDate = new Date(localNow);\ntomorrowDate.setDate(localNow.getDate() + 1);\nconst tomorrow = formatDate(tomorrowDate);\n\n// 返回到后续节点\nreturn [\n {\n json: {\n today,\n yesterday,\n tomorrow,\n }\n }\n];" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ -1488, -384 ], "id": "02ad24d5-0e70-4670-a74d-8f5ed59d530b", "name": "获取日期", "executeOnce": false, "alwaysOutputData": false }, { "parameters": { "model": { "__rl": true, "value": "qwen-plus", "mode": "list", "cachedResultName": "qwen-plus" }, "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "typeVersion": 1.2, "position": [ 400, -112 ], "id": "337f4f6b-ca46-4bbc-bc77-68d53f105376", "name": "大模型", "notesInFlow": false, "credentials": { "openAiApi": { "id": "wBN3YtuMB8ojYePo", "name": "阿里云百炼" } } }, { "parameters": { "promptType": "define", "text": "=Role: A helpful assistant\n\nTask and steps: \n 1. Generate a full user question that would follow the conversation.\n 2. If the user's question involves relative date, you need to convert it into absolute date based on the current date, which is {{ $json.today }}. For example: 'yesterday' would be converted to {{ $json.yesterday }}.\n \nRequirements & Restrictions:\n - Text generated MUST be in the same language of the original user's question.\n - If the user's latest question is completely, don't do anything, just return the original question.\n - DON'T generate anything except a refined question.\n - If the user's latest question is unrelated to the previous question and answer, do nothing and just return the original question.\n - If the user suddenly shifts to another topic while asking a question, do nothing and simply return the user's question.\n - You are here to help me optimize my questions, not to ask me what I want to ask. When you don't understand what I'm asking, simply return my question as it is.\n\n######################\n-Examples-\n######################\n\n# Example 1\n## Conversation\nUSER: What is the name of Donald Trump's father?\nASSISTANT: Fred Trump.\nUSER: And his mother?\n###############\nOutput: What's the name of Donald Trump's mother?\n\n------------\n# Example 2\n## Conversation\nUSER: What is the name of Donald Trump's father?\nASSISTANT: Fred Trump.\nUSER: And his mother?\nASSISTANT: Mary Trump.\nUser: What's her full name?\n###############\nOutput: What's the full name of Donald Trump's mother Mary Trump?\n\n------------\n# Example 3\n## Conversation\nUSER: What's the weather today in London?\nASSISTANT: Cloudy.\nUSER: What's about tomorrow in Rochester?\n###############\nOutput: What's the weather in Rochester on {{ $json.tomorrow }}?\n######################\n\n------------\n# Example 4\n## Conversation\nUser: Can you tell me who the author of \"One Hundred Years of Solitude\" is?\nAssistant: Gabriel García Márquez.\nUser: What's your favorite color?\n###############\nOutput: What's your favorite color?\n######################\n# Real Data\n## Conversation\n{{ $('When chat message received').item.json.chatInput }}\n###############\n ", "options": {} }, "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 2.1, "position": [ -896, -384 ], "id": "4e02ca76-746e-47a0-872d-56ba8dfc51c4", "name": "问题优化" }, { "parameters": {}, "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "typeVersion": 1.3, "position": [ -768, -128 ], "id": "64c1d8cd-591e-446f-93b2-dcc4b70d405b", "name": "Simple Memory" }, { "parameters": { "options": {} }, "type": "@n8n/n8n-nodes-langchain.chatTrigger", "typeVersion": 1.1, "position": [ -1760, -384 ], "id": "06827fc0-1359-4705-a01c-160c1af0bbb8", "name": "When chat message received", "webhookId": "ce7cb297-23ef-467d-b66f-b34250abe8b7" }, { "parameters": { "assignments": { "assignments": [ { "id": "a7de982c-29cb-453c-a703-de4d6df44a13", "name": "sessionId", "value": "={{ $('When chat message received').item.json.sessionId }}", "type": "string" } ] }, "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ -1184, -384 ], "id": "b3430529-7cbe-49f5-8682-f6c10e343c74", "name": "设置sessionID" }, { "parameters": {}, "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "typeVersion": 1.3, "position": [ 528, -112 ], "id": "e9b9bc36-90fa-4bb4-888a-580addc52909", "name": "Simple Memory1" }, { "parameters": { "assignments": { "assignments": [ { "id": "ec611279-16e2-434d-9715-0fc8f2f4b893", "name": "sessionId", "value": "={{ $('When chat message received').item.json.sessionId }}", "type": "string" } ] }, "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 144, -384 ], "id": "1580fe82-c0f0-46b7-9ae8-4dd9978df04c", "name": "设置sessionID1" } ], "pinData": {}, "connections": { "获取知识库": { "main": [ [ { "node": "限制数据条数", "type": "main", "index": 0 } ] ] }, "限制数据条数": { "main": [ [ { "node": "设置sessionID1", "type": "main", "index": 0 } ] ] }, "qwen-plus": { "ai_languageModel": [ [ { "node": "问题优化", "type": "ai_languageModel", "index": 0 } ] ] }, "问题总结": { "main": [ [] ] }, "获取日期": { "main": [ [ { "node": "设置sessionID", "type": "main", "index": 0 } ] ] }, "大模型": { "ai_languageModel": [ [ { "node": "问题总结", "type": "ai_languageModel", "index": 0 } ] ] }, "问题优化": { "main": [ [ { "node": "获取知识库", "type": "main", "index": 0 } ] ] }, "Simple Memory": { "ai_memory": [ [ { "node": "问题优化", "type": "ai_memory", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "获取日期", "type": "main", "index": 0 } ] ] }, "设置sessionID": { "main": [ [ { "node": "问题优化", "type": "main", "index": 0 } ] ] }, "Simple Memory1": { "ai_memory": [ [ { "node": "问题总结", "type": "ai_memory", "index": 0 } ] ] }, "设置sessionID1": { "main": [ [ { "node": "问题总结", "type": "main", "index": 0 } ] ] } }, "active": true, "settings": { "executionOrder": "v1", "timezone": "Asia/Shanghai", "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": "AycN9E49X0d83ylA" }, "versionId": "27c14bae-3eca-48e1-9656-6b416ce4ef1c", "meta": { "templateCredsSetupCompleted": true, "instanceId": "7397109f4ef37219f1a9d66e443871054ef9b9d60cf344bb22a5fd67ffa1b68b" }, "id": "9srTjxCl46hTVt3Y", "tags": [ { "createdAt": "2025-08-07T06:31:05.184Z", "updatedAt": "2025-08-07T06:31:05.184Z", "id": "wftKEUvrsuiyNTav", "name": "知识库" } ] }知识库我选择是的ragflow
2、定时获取新闻推送飞书

{ "name": "AI新闻定时获取", "nodes": [ { "parameters": { "values": { "string": [ { "name": "keywords", "value": "AI,人工智能,大模型,agent,ragflow,ag-ui,LLM,AIGC,智能体,生成式AI,AI工具,AI平台" } ] }, "options": {} }, "id": "d11fc1c3-d7fd-45c4-8e0b-f8b0625c7c93", "name": "关键词组参数", "type": "n8n-nodes-base.set", "typeVersion": 2, "position": [ 928, 384 ] }, { "parameters": { "jsCode": "const raw = ($input.first().json.keywords || '').trim();\nconst parts = raw.split(',').map(k => k.trim()).filter(Boolean);\n// 对包含空格的关键词加引号,避免被拆分\nconst normalized = parts.map(k => (k.includes(' ') ? `\"${k}\"` : k));\nconst orQuery = `(${normalized.join(' OR ')})`;\nreturn [{ keyword: orQuery }];" }, "id": "dd5c1474-e289-4af1-a526-e2b9f61796c2", "name": "关键词展开", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1184, 384 ] }, { "parameters": { "jsCode": "const data = $input.first().json || {};\nconst results = [];\n\nif (Array.isArray(data.organic)) {\n for (const item of data.organic) {\n if (item && item.title && item.link) {\n results.push({ textContent: String(item.title).trim(), href: String(item.link).trim() });\n }\n }\n}\n\nif (Array.isArray(data.topStories)) {\n for (const item of data.topStories) {\n if (item && item.title && item.link) {\n results.push({ textContent: String(item.title).trim(), href: String(item.link).trim() });\n }\n }\n}\n\nreturn { results: results.slice(0, 10) };" }, "id": "a0b05d3d-e409-4094-96cc-f0466b27b46d", "name": "谷歌新闻提取", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1792, 384 ] }, { "parameters": { "jsCode": "// 合并所有关键词的新闻结果\nconst allNews = [];\n\n// 从所有输入中收集新闻\nfor (const item of $input.all()) {\n if (item.json && item.json.results) {\n for (const result of item.json.results) {\n if (result && result.textContent && result.href) {\n allNews.push({\n title: result.textContent.trim().replace(/\\n/g, ''),\n url: result.href\n });\n }\n }\n }\n}\n\n// 去重,按标题去重\nconst uniqueNews = [];\nconst seenTitles = new Set();\n\nfor (const news of allNews) {\n if (!seenTitles.has(news.title)) {\n seenTitles.add(news.title);\n uniqueNews.push(news);\n }\n}\n\n// 取前20条新闻\nconst mergedNews = uniqueNews.slice(0, 20);\n\nreturn {\n mergedNews,\n totalFound: allNews.length,\n uniqueCount: uniqueNews.length,\n finalCount: mergedNews.length\n};" }, "id": "99195de6-f24f-4644-a909-54ae36de2a08", "name": "合并新闻结果", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 2064, 384 ] }, { "parameters": { "resource": "chat", "model": "qwen-plus", "prompt": { "messages": [ { "role": "system", "content": "你是资深AI新闻编辑。请基于用户提供的新闻标题与链接列表,生成中文AI晨报:\n- 主题聚类与小结\n- 关键事件与影响\n- 重要链接清单(保留原文链接)\n要求:精炼、中文输出、条理清晰。" }, { "content": "={{ JSON.stringify($json.mergedNews) }}" } ] }, "options": {}, "requestOptions": {} }, "id": "f6b7541f-d880-4e9f-ac4d-1c5a4239d5a3", "name": "AIAgent智能分析", "type": "n8n-nodes-base.openAi", "typeVersion": 1, "position": [ 2336, 384 ], "credentials": { "openAiApi": { "id": "wBN3YtuMB8ojYePo", "name": "阿里云百炼" } } }, { "parameters": { "resource": "message", "operation": "message:send", "receive_id_type": "user_id", "receive_id": "KF875", "content": "={{ (function() {\n function extractText(json) {\n if (!json) return '';\n // Prefer OpenAI-style choices[0].message.content\n if (json.choices && json.choices[0] && json.choices[0].message) {\n const c = json.choices[0].message.content;\n if (Array.isArray(c)) {\n return c.map(p => (p && (p.text || p.content || ''))).join('');\n }\n return String(c || '');\n }\n // n8n unified message.content\n if (json.message && json.message.content) {\n const mc = json.message.content;\n if (Array.isArray(mc)) {\n return mc.map(p => (p && (p.text || p.content || ''))).join('');\n }\n return String(mc || '');\n }\n // fallback common fields\n return String(json.text || json.content || json.data || '')\n }\n const text = extractText($json) || '';\n return JSON.stringify({ text });\n})() }}" }, "type": "n8n-nodes-feishu-lite.feishuNode", "typeVersion": 1, "position": [ 2624, 384 ], "id": "82f9f2a2-5c9b-47eb-a26a-821a3d62639e", "name": "Message:send message", "credentials": { "feishuCredentialsApi": { "id": "oLXbtYiT3kKMbqV5", "name": "飞书账号-测试" } } }, { "parameters": { "triggerTimes": { "item": [ {} ] } }, "id": "b1ae4ae2-8369-4b97-b296-11e5aa756161", "name": "定时触发1", "type": "n8n-nodes-base.cron", "typeVersion": 1, "position": [ 688, 384 ] }, { "parameters": { "method": "POST", "url": "https://google.serper.dev/search11111", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "X-API-KEY", "value": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX" }, { "name": "Content-Type", "value": "application/json" } ] }, "sendBody": true, "bodyParameters": { "parameters": [ { "name": "q", "value": "={{ $json.keyword }}" } ] }, "options": { "redirect": { "redirect": {} } } }, "id": "082acb5a-5b52-4cf9-88b7-72469a037da9", "name": "谷歌新闻获取", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.1, "position": [ 1488, 384 ] } ], "pinData": {}, "connections": { "关键词组参数": { "main": [ [ { "node": "关键词展开", "type": "main", "index": 0 } ] ] }, "关键词展开": { "main": [ [ { "node": "谷歌新闻获取", "type": "main", "index": 0 } ] ] }, "谷歌新闻提取": { "main": [ [ { "node": "合并新闻结果", "type": "main", "index": 0 } ] ] }, "合并新闻结果": { "main": [ [ { "node": "AIAgent智能分析", "type": "main", "index": 0 } ] ] }, "AIAgent智能分析": { "main": [ [ { "node": "Message:send message", "type": "main", "index": 0 } ] ] }, "定时触发1": { "main": [ [ { "node": "关键词组参数", "type": "main", "index": 0 } ] ] }, "谷歌新闻获取": { "main": [ [ { "node": "谷歌新闻提取", "type": "main", "index": 0 } ] ] } }, "active": true, "settings": { "executionOrder": "v1", "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": "AycN9E49X0d83ylA" }, "versionId": "279209cd-aa56-45ad-8a68-1af63aa6c096", "meta": { "instanceId": "7397109f4ef37219f1a9d66e443871054ef9b9d60cf344bb22a5fd67ffa1b68b" }, "id": "1CYAr12V65e1JUQc", "tags": [] }3、后续再补充
五、使用cursor生成n8n工作流
1、创建一个n8n文件夹,文件夹下创建一个文件.cursorrules,其中提示词如下
- Role: AI产品经理 - Background: 用户需要一个可立即导入n8n平台运行的完整AIAgent工作流,以实现特定的自动化任务,提高工作效率,减少手动操作的繁琐性。 - Profile: 你是一名拥有5年以上经验的AI产品经理,精通n8n工作流和AIAgent设计,熟悉400+节点配置、数据流设计、API集成和性能优化。 - Skills: AI Agent架构专家,专精AIAgent稳定架构设计,具备需求建模能力,能够快速将业务需求转化为AIAgent自动化方案,精通核心节点配置,擅长数据流优化,熟练处理API认证、数据转换、错误处理,能够生成符合n8n导入规范的完整AIAgent工作流文件。 - Goals: 1. 快速分析用户需求,识别最佳AIAgent自动化方案。 2. 设计基于AIAgent的稳定架构,规划节点布局和数据流向。 3. 生成标准JSON文件,支持一键导入n8n平台。 4. 提供完整的架构设计文档。 - Constrains: 严格按照流程执行提示词,确保每个步骤的完整性。每次输出的内容必须遵循对话流程,每个工作流必须包含AIAgent节点作为核心,除非用户明确指出使用其他大模型。默认使用OpenAI v3作为语言模型。README.md文件仅创建一个实时更新其内容以反映最新项目状态。用户提供反馈后立即更新相关文档和json代码。JSON输出必须符合n8n导入标准,确保一键可用。所有与用户的对话,包括节点名称和技术说明必须使用中文。 - OutputFormat: 提供自然语言需求收集的引导语,等待用户描述需求。 - Workflow: 1. 自然语言需求收集:引导用户详细描述他们想要自动化的场景。 2. 需求分析与方案识别:根据用户描述,快速分析需求,识别最佳AIAgent自动化方案。 3. 架构设计与节点布局:设计基于AIAgent的稳定架构,规划节点布局和数据流向。 4. JSON文件生成:生成标准JSON文件,支持一键导入n8n平台。 5. 架构设计文档编写:提供完整的架构设计文档。2、跟agent对话生成n8n工作流

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)