打开 “懒猫微服客户端” 下载应用

n8n

公平代码许可工作流自动化工具

872 次下载
3 次点赞
5 条评论
0 次催更
872

安装次数

3

点赞

5

应用评论

0

催更次数

桌面端

应用描述

免费且源代码可用的公平代码许可工作流自动化工具。轻松实现跨不同服务的任务自动化。 该应用未接入懒猫账户,第一个注册的用户将成为管理员账户,其他账户由管理员分配/邀请

相关攻略

n8n 实操攻略 11:如何搭建 AI 解压视频工作流

最近经常刷到 ai 生成的解压视频,就是那种 用刀子切苹果的视频,今天用 n8n 实操演练一下如何搭建。 https://appstore.lazycat.cloud/#/shop/detail/cloud.lazycat.app.n8n 先简单看下流程图: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/ad275def-e666-48f1-8c21-24f0fde465ab.png "image.png") ### 快速搭建节点 新建一个 ai 解压的工作流 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/4f183071-9538-478a-8b42-ed38fc82999e.png "image.png") 新建一个手动触发的节点 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/26e27e48-4213-4271-b089-88ab2f4df0e0.png "image.png") 接下来,让 ai 生成视频的内容,要给它 prompt,所以要新建一个 ai agent ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/2fd789fe-074e-43f0-b925-e7a68678fb9e.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/43ef506b-c78b-48ad-8045-afc845894f4f.png "image.png") 它默认会生成一个chat message 节点,我们不需要,把它删掉即可 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/75f26c1b-2feb-476b-a33c-5fee4e709a09.png "image.png") 删掉之后: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/0d8b5540-6a80-489c-af05-67a08dafa604.png "image.png") 新建 http 请求视频的生成 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7dfe896c-0aa3-4557-b0cc-82ce02ed88ae.png "image.png") 生成视频比较慢,所以加一个等待 wait ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/bcf10f10-806e-4428-b18c-b2e645f70ef2.png "image.png") 比如等待 10s 之后,再添加一个 http,去查询是否生成成功 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/bc942fcf-9143-468e-a942-2b70fda6dff4.png "image.png") 所以要加一个 if 判断节点 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/9756d32b-b2ee-44a6-9739-8958abb6ca20.png "image.png") 如果还没生成,就继续等待,如果生成成功,才进行下一步,所以把 false 流程拖到 wait 前面 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/510d050f-798e-4d1e-892d-11dcdcd60ac5.png "image.png") 如果生成成功,我们记录一下当前时间 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/32ed85f0-af07-45cb-be27-fc6f499674a7.png "image.png") 选第 4 个 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/aee11e6f-c306-4ecb-a4d0-02282042c2da.png "image.png") 最后一步是将记录保存到 GoogleSheets 里面 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8a2e9a94-83e4-4bdf-95d6-1fb5f1dd768a.png "image.png") 以上就是完整的流程。接下来详细讲解每一步的配置。 ### ai agent 在左下角的+ 是选择大模型, ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/f4b74543-f298-4022-a53a-1cdb58e2a8c7.png "image.png") 我用 DeepSeek 演示 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/f93d5a45-ab55-4b34-b941-34cb5b5b036c.png "image.png") 配置上你的 DeepSeek 的 APIkey 就可以了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7443e9cf-9789-4a5f-9c43-cf8017c7b924.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/0fd2d135-1c26-424d-93e4-20144fbaf2f1.png "image.png") 双击进入节点,我们是自己输入 prompt,所以选第 2 个 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/73d393d4-8d4f-4fd1-8051-cace3b33dfe9.png "image.png") 发送的 prompt 填写: ``` Generate a new "Oddly Satisfying" slicing video concept. ``` 增加一个系统身份 prompt,参考提示词: ``` You are a viral content strategist specializing in Oddly Satisfying 3D animation ASMR. Your task is to generate a single, complete, and original video concept designed for maximum virality and loop-watching. The concept must feature an unconventional tool flawlessly slicing a hyper-realistic object to reveal a completely unexpected and visually stunning interior. You must invent and concisely describe these three core elements: 1. **The Object:** A familiar item with a unique, impossible quality. 2. **The Tool:** A visually interesting cutting instrument, not a simple knife. 3. **The Surprise Interior:** The key to virality—a mesmerizing material or miniature scene. Reference exaple:A highly realistic ultra-8K ASMR video shows a human using his handsto cut a detailed lava cake sculpture on a slate cutting board, cuttingquickly, and the hot magma touches the gap at the moment ofcutting.The cake resembles volcanic rock - obsidian, slightly burntwith cracks clearly visible inside and emitting light. The camera uses ashallow depth of field close-up to capture the cinematic light anddetailed glass texture. Each cut is precise and lifelike. The sound ofmetal rubbing against rock, the sound of magma erupting, and thesound of cutting This paragraph must be written as a direct, usable prompt. It must describe the unconventional tool flawlessly slicing the hyper-realistic object, revealing its unexpected interior. The description must also detail the crisp, high-fidelity ASMR sounds and the clean, satisfying physics of the interaction. Your entire output must be ONLY this single paragraph, which will be assigned to a "prompt" variable. Do not add any extra words, formatting, labels, or explanations. ``` 效果如图,把 output 验证开关打开 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7d46ef2a-1924-44a0-a283-e702ec243b01.png "image.png") 我们希望它输出 json 的结果 ``` { "prompt": "ASMR idea" } ``` ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/4ede3885-cf56-4886-b33d-596f95ebe980.png "image.png") 执行步骤,如果 output 能看到内容,说明成功了。点击右上角 pin 一下,方便调试 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/9cfed6aa-69f1-4fa6-8021-c3ff2618a413.png "image.png") ### http request 这个节点是生成视频的节点。这里我用的 API 是这个https://kie.ai/ Veo3 Fast 20积分/次,大概是 7 毛钱,充值之后就能用它的 API 了 这里可以看到 apikey ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/413661ad-1255-4cb7-8429-098b66d0797e.png "image.png") 获取方法为参考API文档,复制网址进去,下为API文档地址 https://docs.kie.ai/veo3-api/generate-veo-3-video ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/a2d50420-2a0a-49dd-a232-9f96a170096e.png "image.png") 选择 post 方法,地址粘贴到这里 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/562933f0-744e-4b00-9774-f8de800fdc51.png "image.png") 授权方式,选择通用授权,hearder auth 的方式 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8b22ad74-6070-43c9-9596-e640c93f0c11.png "image.png") 创建密钥,看官方文档 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/ec9c21fb-25e9-4dbd-a3b2-e39b35190409.png "image.png") 所以这里这样填 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b74663f1-fb1c-47f6-b29f-d4c2c66febd8.png "image.png") 打开 send body 开关 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/2f170c12-80cf-4e78-b33d-9835c58dd461.png "image.png") 根据官方文档要求,要配置这么几个参数 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/cbcd53f1-c81e-416a-a10a-b684b90543ca.png "image.png") name 填 prompt,value 直接把左侧的 prompt 拖过来 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/0271d5d1-b9eb-4453-b771-97303f93e431.png "image.png") 再添加一个参数,model,vao3_fast ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/ee7faf7a-5a36-409f-a7f1-13e24261251f.png "image.png") 执行一下,如果输出 200,说明配置成功了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7e669df6-5d59-4a61-9501-a539783fad13.png "image.png") 将右上角 pin 住,不然又生成一遍的话,又要花钱 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7dae9a6d-565d-4cdc-ba08-7da190544317.png "image.png") ### wait wait 节点设置成 10 秒就行,不用特殊配置 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/4bd35080-cb0d-4c7d-8c5c-07fbf450c10b.png "image.png") ### 查询视频结果 这个节点是查询视频结果,根据文档,是这个接口: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/e5a3e2c7-12b0-4ca9-ae84-a14e512f777b.png "image.png") 它需要传一个 taskid 获取数据 刚才生成的视频,我们是 post 请求,send body,而这里我们是 get 请求,所以是 send query ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/17199d04-8532-4e8f-b427-5fa9fb36aea9.png "image.png") 执行一下,右侧可以看到结果了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/e89194b6-7653-4b75-b21b-98c26e3afb74.png "image.png") 根据文档说明,如果这个 successFlag=1,就说明视频成功了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7e15acec-95ac-4e01-b9e0-ae9f905e3dc7.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/82622f2a-5aa2-461a-aae2-a9739e337af9.png "image.png") 我们 pin 一下,继续下一步if 节点 这里默认是字符串,要改成 number,是否=1 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7192ec30-c03e-4170-be98-c2752139b476.png "image.png") 最后一步是把结果存储到 Google 表格里,可参考我之前的攻略,有详细的讲解 我在 Google sheet 里新建了一个空白表格 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/a5562c2c-516f-49aa-8215-b7dee65fc87a.png "image.png") 表头可以参考: ``` Data Idea Status Video Url ``` 其实就去把你想要的字段保存下来 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/c1d21c0c-06b4-487d-bb6c-d271fd64ce52.png "image.png") 然后在 n8n 里,把对应的字段,拖动相应的列的位置 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/25661872-ce28-44d3-9c71-4d935fc68beb.png "image.png") 点击执行,可以看到结果了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/54d6204a-e0ef-4166-8a8b-1f7952d8dd2b.png "image.png") 在 Google sheets 里,可以看到插入了一条数据: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/ec4226cd-80be-4ab3-af89-b7e8fa4c60ab.png "image.png") 点击链接,可以看到视频: https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/c5fb91bf-6098-4d41-94d3-6ec06ab90642.mp4 整个工作流就完成了。 最难的点,在于 **API 文档发送 post 和 get 请求的配置**,如果一点没有配好,就可能有莫名其妙的问题。 完整 json 如下,同理改成你的相关配置就可以了: ``` { "name": "n8n航海-案例1", "nodes": [ { "parameters": { "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek", "typeVersion": 1, "position": [ -464, 192 ], "id": "2a4bfaeb-02ca-41c9-b428-0bb0965908a8", "name": "DeepSeek Chat Model", "credentials": { "deepSeekApi": { "id": "r8dE74Igj9x0N0Zo", "name": "Deepseek API key" } } }, { "parameters": { "jsonSchemaExample": "{\n\t\"prompt\": \"ASMR idea\"\n}" }, "type": "@n8n/n8n-nodes-langchain.outputParserStructured", "typeVersion": 1.3, "position": [ -336, 192 ], "id": "8746f7d9-84a9-42d9-80be-7c52367c6ce7", "name": "Structured Output Parser" }, { "parameters": { "options": {} }, "type": "n8n-nodes-base.dateTime", "typeVersion": 2, "position": [ 800, -48 ], "id": "b522d1ba-23d2-4b6f-b352-3a18b7aac3fe", "name": "Date & Time" }, { "parameters": {}, "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ -720, -48 ], "id": "9433411a-6f87-4fb4-a3d0-8e61e7b06bbc", "name": "When clicking ‘Execute workflow’" }, { "parameters": { "promptType": "define", "text": "Generate a new \"Oddly Satisfying\" slicing video concept.", "hasOutputParser": true, "options": { "systemMessage": "=You are a viral content strategist specializing in Oddly Satisfying 3D animation ASMR. Your task is to generate a single, complete, and original video concept designed for maximum virality and loop-watching.\n\nThe concept must feature an unconventional tool flawlessly slicing a hyper-realistic object to reveal a completely unexpected and visually stunning interior.\n\nYou must invent and concisely describe these three core elements:\n1. **The Object:** A familiar item with a unique, impossible quality.\n2. **The Tool:** A visually interesting cutting instrument, not a simple knife.\n3. **The Surprise Interior:** The key to virality—a mesmerizing material or miniature scene.\n\nReference exaple:A highly realistic ultra-8K ASMR video shows a human using his handsto cut a detailed lava cake sculpture on a slate cutting board, cuttingquickly, and the hot magma touches the gap at the moment ofcutting.The cake resembles volcanic rock - obsidian, slightly burntwith cracks clearly visible inside and emitting light. The camera uses ashallow depth of field close-up to capture the cinematic light anddetailed glass texture. Each cut is precise and lifelike. The sound ofmetal rubbing against rock, the sound of magma erupting, and thesound of cutting\n\nThis paragraph must be written as a direct, usable prompt. It must describe the unconventional tool flawlessly slicing the hyper-realistic object, revealing its unexpected interior. The description must also detail the crisp, high-fidelity ASMR sounds and the clean, satisfying physics of the interaction.\n\nYour entire output must be ONLY this single paragraph, which will be assigned to a \"prompt\" variable. Do not add any extra words, formatting, labels, or explanations." } }, "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 2.1, "position": [ -496, -48 ], "id": "c7b7ca25-165d-4550-a136-e6d51855c4a9", "name": "AI agent" }, { "parameters": { "operation": "append", "documentId": { "__rl": true, "value": "1GcD1GI8kNpqmSUd1Fp_0i-RWovoN-L56hmEDouYmqEM", "mode": "list", "cachedResultName": "0817演示", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1GcD1GI8kNpqmSUd1Fp_0i-RWovoN-L56hmEDouYmqEM/edit?usp=drivesdk" }, "sheetName": { "__rl": true, "value": "gid=0", "mode": "list", "cachedResultName": "案例1", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1GcD1GI8kNpqmSUd1Fp_0i-RWovoN-L56hmEDouYmqEM/edit#gid=0" }, "columns": { "mappingMode": "defineBelow", "value": { "Date": "={{ $json.currentDate }}", "Idea": "={{ $('AI agent').item.json.output.prompt }}", "Status": "done", "Video Url": "={{ $('Video Request 2').item.json.data.response.resultUrls[0] }}" }, "matchingColumns": [], "schema": [ { "id": "Date", "displayName": "Date", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "Idea", "displayName": "Idea", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "Status", "displayName": "Status", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "Video Url", "displayName": "Video Url", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true } ], "attemptToConvertTypes": false, "convertFieldsToString": false }, "options": {} }, "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.6, "position": [ 1024, -48 ], "id": "7c1171db-7699-4b0a-b73a-046877bf0621", "name": "Append row in sheet", "credentials": { "googleSheetsOAuth2Api": { "id": "drez7unFeg8epr1r", "name": "Google Sheets account" } } }, { "parameters": { "method": "POST", "url": "https://api.kie.ai/api/v1/veo/generate", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" } ] }, "sendBody": true, "bodyParameters": { "parameters": [ { "name": "prompt", "value": "={{ $json.output.prompt }}" }, { "name": "model", "value": "veo3_fast" } ] }, "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ -96, -48 ], "id": "974cb631-51e8-448e-8106-0a7414535ffb", "name": "Video Request 1", "credentials": { "httpHeaderAuth": { "id": "dQQIMrAGnD98HwUq", "name": "Kie API Key" } } }, { "parameters": { "url": "https://api.kie.ai/api/v1/veo/record-info", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "taskId", "value": "={{ $json.data.taskId }}" } ] }, "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 352, -112 ], "id": "5e6e773e-79cf-4b55-9af0-589fa1d52372", "name": "Video Request 2", "credentials": { "httpHeaderAuth": { "id": "dQQIMrAGnD98HwUq", "name": "Kie API Key" } } }, { "parameters": { "amount": 10 }, "type": "n8n-nodes-base.wait", "typeVersion": 1.1, "position": [ 128, -48 ], "id": "1be05b24-8725-499e-befc-5be0fd7e698a", "name": "Wait", "webhookId": "4bff9f7b-f87d-4481-ab1d-437ae7d45f2b" }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose", "version": 2 }, "conditions": [ { "id": "1e03bbe0-00b3-4cec-a8c7-e582e4b0af6f", "leftValue": "={{ $json.data.successFlag }}", "rightValue": "=1", "operator": { "type": "number", "operation": "equals" } } ], "combinator": "and" }, "looseTypeValidation": true, "options": {} }, "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [ 576, -48 ], "id": "80be1450-bd5d-4bd9-86c3-20ce5173bb1a", "name": "If1" } ], "pinData": {}, "connections": { "DeepSeek Chat Model": { "ai_languageModel": [ [ { "node": "AI agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Structured Output Parser": { "ai_outputParser": [ [ { "node": "AI agent", "type": "ai_outputParser", "index": 0 } ] ] }, "Date & Time": { "main": [ [ { "node": "Append row in sheet", "type": "main", "index": 0 } ] ] }, "When clicking ‘Execute workflow’": { "main": [ [ { "node": "AI agent", "type": "main", "index": 0 } ] ] }, "AI agent": { "main": [ [ { "node": "Video Request 1", "type": "main", "index": 0 } ] ] }, "Video Request 1": { "main": [ [ { "node": "Wait", "type": "main", "index": 0 } ] ] }, "Video Request 2": { "main": [ [ { "node": "If1", "type": "main", "index": 0 } ] ] }, "Wait": { "main": [ [ { "node": "Video Request 2", "type": "main", "index": 0 } ] ] }, "If1": { "main": [ [ { "node": "Date & Time", "type": "main", "index": 0 } ], [ { "node": "Wait", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "versionId": "19bc5f15-0a03-4444-b98b-57d3373cb8e2", "meta": { "templateCredsSetupCompleted": true, "instanceId": "14d1b60adc749fc2cf1cd98b4578d0a33025456b1da4b4d0870fea8f29b05222" }, "id": "yIWRjigHw5ut2NoW", "tags": [] } ```

n8n 实操攻略 15:如何自动化运营 X

[上一篇攻略](https://lazycat.cloud/playground/guideline/1309)我们讲了 X 的相关配置,这篇我们实现如何自动化发送 X 推文。 这里主要用 Google Sheets,把提前准备好的内容都写到表格里,然后让 n8n 去读取,发送 X 就可以了。各节点的配置都是之前讲过的,上手应该很快。 流程图: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/c8019f46-8af8-4e36-8188-e15d32ee9e7e.png "image.png") https://appstore.lazycat.cloud/#/shop/detail/cloud.lazycat.app.n8n ### 工作流搭建 新建一个定时触发器 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/ead1dd4c-e277-468b-8617-fdc3f415882c.png "image.png") 设置你想定时触发的时间 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/17c9cbe9-7eeb-47d0-9403-1b0024934587.png "image.png") 接下来在 Google 表格中,我提前建了一个表格,并写了 2 条记录。 第一列是推文内容,第 2 列是是否发送成功的标记 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/c528fb30-1bc0-4c00-a64e-5d3815e38cbe.png "image.png") 添加 Google sheet 节点 我们是要读取,所以选这个: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/03e45d55-a6ab-40a3-a746-8148733befe5.png "image.png") 这里选择 IsSend 是 0,也就是还没发送的数据 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/997d8d39-f37e-4e2b-82a5-09f9fe4d14a4.png "image.png") 选择返回 1 行数据 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/bc618170-3a98-4b3b-baf4-c580a6e38fd1.png "image.png") 点击执行,可以看到它读取到了我的第 1 条数据 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/c441a8de-3784-4826-97c3-cdca34376394.png "image.png") 接下来添加 X 节点,可以参考上篇攻略的配置 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/acd81302-a97d-4f05-a752-c5e4249eaf7d.png "image.png") 把左侧的 XData 拖到 Text 里 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/0b8fd73e-0ffc-4d27-9baa-3fd9c74d7677.png "image.png") 点击执行一下,可以看到输出结果,pin 一下 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/a8097380-8e02-43f4-bab5-191d89871740.png "image.png") 增加个 if 判断,如果返回结果有值,说明发送成功了, ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/0e408a71-a659-4b18-893a-834506ae1cdd.png "image.png") 我们要更新 Google sheet 里的 is send 字段 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/f2309205-9df8-4ee7-81ae-fd0136670370.png "image.png") 执行一下,可以看到效果了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/a21af232-5015-449b-8c0a-75d7e8f81ad5.png "image.png") Google 表格中的数据也更新了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/168a99e2-3215-435c-acdd-5ddc51f6a5c6.png "image.png") X 也是没问题的 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/1f5bee79-b4ed-4b11-afff-ed58e7f400e8.png "image.png") 有了这个工作流,就可以定时发送 X 了,平时有一些产品公告,不用守着点发送了,非常方便。

n8n 实操攻略 5:如何配置 Notion 节点

很多人用 Notion 来做笔记、管理项目、写博客,但有时需要在不同应用间同步数据,手动操作太麻烦了。 n8n 就是来解决这个问题的,它可以让 Notion 自动和其他应用联动起来,省时又省力。今天咱们就来聊聊怎么在 n8n 里配置 Notion 节点,让你的工作流程飞起来! https://appstore.lazycat.cloud/#/shop/detail/cloud.lazycat.app.n8n ## 第一步:在 Notion 创建 Integration 很多人卡在这一步,其实超简单的: ### 1. 创建 Notion Integration 打开 [Notion Integration 页面](https://www.notion.so/my-integrations) 点击 **"+ New integration"** 按钮 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/1fcd8748-a5d0-4217-a6ab-4af0da3f367c.png "image.png") 给你的集成起个名字,比如 "n8n 自动化助手" 选择你要关联的工作区 点击 **Save** 创建 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b51b1b38-e757-475a-8c76-043be38a28f5.png "image.png") ### 2. 配置权限(别跳过这步) 创建后,进入 **Capabilities** 标签页,把这些权限都勾上: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/5b765f34-9edd-49ad-8517-9e044ebaf5fa.png "image.png") - Read content(读取内容) - Update content(更新内容) - Insert content(插入内容) - Read comments(读取评论) - 如果你需要操作用户信息,也把 Read user information 勾上 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/05b05a5e-a26c-4315-8ed8-9b4eff76285f.png "image.png") 记得点 **Save** 保存! ### 3. 复制你的密钥 你会看到一个 **Internal Integration Token**,这个就是你的钥匙,复制下来待会儿要用。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8c5ed6c6-62b6-4f7e-859f-a5dda1e945c5.png "image.png") ## 第二步:把 Integration 连接到你的 Notion 页面 这步超多人忘记做,然后一直报错说没权限! 在Notion 新建一个数据库 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/1ea521be-af54-4356-9d73-8b80cc597158.png "image.png") 点击右上角的 **"..."** 三个点菜单 找到 **Connections** 区域 点击 **"Connect to"** 或 **"添加连接"** 搜索并选择你刚创建的 Integration 确认授权 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/148ec033-3eb1-46fa-bbc3-c6abe3ab31a1.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/70e87c1c-449e-4696-acbf-0298b043bbb8.png "image.png") 如果你要操作多个数据库,每个都要重复这个步骤哦! ## 第三步:在 n8n 中配置 Notion 节点 好了,现在来到 n8n 这边: ### 1. 添加 Notion 节点 在你的工作流中点击 **"+"** 号,搜索 "Notion",你会看到两种节点: - **Notion Trigger**:当 Notion 有变化时触发(比如新增页面) - **Notion**:主动操作 Notion(创建、更新、查询等) ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/baf28cb0-d3cb-4ffa-87f6-8c7f7611486d.png "image.png") ### 2. 配置认证 点击节点后,在 **Credential** 部分: 点击 **"Create New Credential"** ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/c1e56d78-3ad0-4e61-8207-6bf2f34be225.png "image.png") 选择 **API Token** 认证方式 把刚才复制的 **Internal Integration Token** 粘贴进去 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/a7290c59-0c44-4571-b5cf-b61ba2a8e40c.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/d18d735d-a908-45e3-88f4-d46d157ea01a.png "image.png") 点击 **Save** 保存 ### 3. 选择你要的操作 Notion 节点支持超多操作,列几个最常用的: #### 创建数据库页面(最常用!) - **Resource**: Database Page - **Operation**: Create - **Database**: 选择你的数据库(如果看不到,检查第二步的授权) - **Properties**: 配置各个字段的值 #### 查询数据库 - **Resource**: Database - **Operation**: Search - 可以设置筛选条件、排序规则 #### 添加内容块 - **Resource**: Block - **Operation**: Append After - 支持添加段落、标题、待办事项、列表等 ## 最后的话 配置 Notion 节点真的不难,关键是理解这三步:创建 Integration → 授权给页面 → 在 n8n 中配置。 刚开始可能会遇到一些小问题,但相信我,搞定之后你会发现自动化真的太香了! --- **相关资源:** - [n8n 官方文档](https://docs.n8n.io) - [Notion API 文档](https://developers.notion.com) - [n8n 社区模板](https://n8n.io/workflows) - [n8n 中文社区](https://n8n.akashio.com)

n8n 实操攻略 21:一键生成爆款视频-动物跳水

先看一下最终生成的视频效果: https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/72e078eb-109a-47ef-b39e-1fd4c20636bf.mp4 工作流主要分为 4 部分:生图、图生视频、配音、保存数据。其实每一部分,在前面的攻略里都有涉及,这个就是把上面的部分都串联起来了。 https://appstore.lazycat.cloud/#/shop/detail/cloud.lazycat.app.n8n ### 生图 在 Google sheet 中先准备好一个表格 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/84420df6-1f9b-4401-ba93-b1029f67368c.png "image.png") 添加一个 get row 节点 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/bc4d6c29-bd96-4331-ac5c-643bc8d584a8.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/fc2040be-b076-42d7-b1e8-809184b9d50c.png "image.png") 只取找到的第一行待完成的数据 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/4afb32e6-055e-432f-8caa-11bad5d4d796.png "image.png") 第 2 步添加一个 llm节点,提示词参考: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/901867c9-b59d-4357-a2bf-005513801d8c.png "image.png") ``` 你现在是一个专业的AI绘画提示词(Prompt)生成器。请你根据我提供的固定场景描述,生成1条独立的、可用于AI绘画的提示词。 固定场景要求如下: 视角与构图: 一个从侧面拍摄的中景镜头,构图稳定。焦点清晰地落在主体 {{ $json['动物'] }} 身上。 地点与核心元素: 场景为一个光线明亮的室内奥运会跳水场馆。主体 {{ $json['动物'] }} 正从右向左走在一块浅蓝色的跳水板上。 背景细节: 背景是一面纯净的蓝色墙壁,墙壁左上方印有清晰的白色奥运五环标志。在主体动物的后方,可以看到一名坐在高脚椅上、身穿红色上衣的模糊工作人员,以及更远处的模糊观众席。在画面的右侧,可以看到跳水台的银色金属扶手/楼梯结构。 你的任务: 在上述固定场景中,将核心主体设定为:一只 {{ $json['动物'] }}。 输出要求: 生成1条独立的提示词。 最终输出的提示词要完整、流畅地融合所有场景描述。 注意!!!只输出最终生成的提示词内容,不要包含任何其他无关文字。 生成的动物要面冲着泳池 ``` 模型配置上 Gemini2.5flash ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8374cdfb-5bdd-41e1-b41a-c5697dea23ab.png "image.png") 执行后,我们拿到了提示词 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/cc4c0461-a65a-427e-8c64-edae96fcec5a.png "image.png") 接下来,我要根据提示词,去生成图片。这里我用到了这个第三方的 API 接口https://api.apicore.ai/ 它的模型比较多,而且便宜 添加一个令牌 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/71ce25d6-78f3-4119-a581-4a015cb43af2.png "image.png") 回到 n8n 创建一个令牌,Name 填:Authorization 密钥是:Bearer 你的密钥 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/fd25d3b9-ab0b-4a62-a13a-09e2da24a77d.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7821dd01-faeb-4595-9d93-93335864d0e4.png "image.png") 执行之后,可以在看到图片url,不过它好像给我生成反了,猫走错方向了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/323ebb62-dbf9-4c30-83f1-f2a75d0728bd.png "image.png") 但是生成数据都在 data 里,我们需要处理一下,拿到 url ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/007818aa-b657-4240-935d-187ce3cb4728.png "image.png") 添加一个 Code 字段,最终格式化成了右侧的效果 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/93fa4520-bcd6-4bae-9d0e-774fafeb40db.png "image.png") 不用费脑子琢磨中间的代码是怎么写的,记得问 AI。把左侧代码复制、给它说你的要求,让ai 自动给你代码。 ### 生视频 经过上面的步骤,图片已经生成了,接下来生成视频。 这次用到的是海螺2的 API,它的特点是动作幅度大,需要用到 fal平台的 API 官方文档在[这里](https://fal.ai/models/fal-ai/minimax/hailuo-02/standard/image-to-video/api) ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b903bdd2-d682-4109-be54-5327ba0191b6.png "image.png") 新建一个 http request 节点,post 请求, url 填:https://queue.fal.run/fal-ai/minimax/hailuo-02/standard/image-to-video fal 是比较费钱的,不过初次用的话,绑完卡会送给你 10 刀的积分 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/03021dd2-475c-429c-b732-f4d2b542ffb3.png "image.png") 在 apikey 里新建一个密钥 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/3e8092a9-544b-41a6-868d-206aad9c3e1d.png "image.png") 回到n8n 创建一个 fal 的凭证,注意这里的 value,是 Key 空格+你的密钥,和上面的 Bearer 的方式前缀不一样 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/92893399-85ac-42e0-aaf9-49730bc08735.png "image.png") 这里用的提示词: ``` The animal leaped from the diving platform, performed a forward three-and-a-half somersault pike in mid-air, executed an elegant dive, and finally plunged into the pool. ``` ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/62c3fc40-44b3-4487-b629-1fe6147741a9.png "image.png") image_url 是左侧上一步的 url,直接拖过来 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/eb11c317-8b7e-4d24-b1be-0fbe7c047d82.png "image.png") 执行之后,可以看到它的状态是在等待队列中 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/24f711bf-ec07-4421-8afa-84b542eafd2a.png "image.png") 图生视频是比较耗时的,所以有必要加个等待,去轮询获取数据结果 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/88b5f5ec-7888-4a9e-a8f8-cfb06655a99c.png "image.png") 这里注意,在 Setting 里如果错了,就继续获取数据 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/dba9f0e9-bca9-4b5d-924d-eecd1fb5ddcd.png "image.png") 这个视频花了 0.27 刀,大概 2 块钱 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/e1bd2af0-7a94-4e00-ba47-3aecd9a50151.png "image.png") https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/f51924fc-4756-4d37-bb9a-46de98c08d56.mp4 看了视频给我整笑了,猫猫直接给我来了 两 个后空翻,然后跳水了。好吧,我开始还觉得它走错方向了。 ### 配音 上面的视频是没有声音的,要配音需要用到另外的接口。 添加 http request 节点,url 填写:https://queue.fal.run/fal-ai/thinksound ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/a478edd5-66bf-4cdb-894f-b80c3b70e776.png "image.png") 配音的提示词: ``` The animal leaped from the diving platform, performed a forward three-and-a-half somersault pike in mid-air, executed an elegant dive, and finally plunged into the pool. ``` ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/780b63fa-318d-4dab-a808-a5aaf4e3196c.png "image.png") 执行后可以看到输出 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/cd7f2f5a-d1c5-4933-9d36-4a9b7523ce47.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/97d63714-28ac-4cf0-9905-3ac0b73f3c95.png "image.png") 保存视频url数据到 Google sheet,添加一个 update row 节点 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/45316623-b2dd-4877-8706-e8db8dc4241a.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/ce2ffa94-2bec-4e93-b0cf-df939f0a9318.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/82b0f3d5-1ce8-4d9b-8b2c-3fbf00b19919.png "image.png") 以上就完成了视频的制作,难点在于 fal 的请求配置,它是异步出结果,中间细节没处理好反复了好几次。 另外生视频还是挺花钱的,还没体验过算力仓,不过起码不用花钱还是挺好的。

n8n 初始体验 1:小白也能轻松玩转的自动化神器

## 什么是 n8n? 简单来说:n8n 是一个开源的、可视化的自动化平台。它让你无需写代码,就能像搭积木一样连接不同的应用和服务(如邮件、表格、文档、数据库、AI 模型、甚至你公司的内部系统),创建自动执行任务的「工作流」(Workflow)。 n8n 能够连接任何有 API 的应用,并且几乎不需要编程知识就能操作数据。简单来说,就是让不同的软件"自动对话"。 https://appstore.lazycat.cloud/#/shop/detail/cloud.lazycat.app.n8n ## 快速上手 应用安装后,先注册一个用户 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/aceaae18-794e-4e74-85ff-d4f505ad5b7e.png "image.png") 进入主页面 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/60bfac67-246c-4c79-b4d3-d94be2e78bd0.png "image.png") Overview (概览): 这里会显示一些关键数据,比如: Prod. executions (生产执行次数): 过去 7 天内成功运行了多少次工作流。 Failed prod. executions (失败的生产执行次数): 过去 7 天内有多少次工作流运行失败了。 Failure rate (失败率): 失败的百分比,让你快速掌握流程的稳定性。 Time saved (节省的时间): 这个功能很酷,能帮你估算通过自动化节省了多少时间。 Run time (avg.) (平均运行时间): 每次工作流运行平均需要多长时间。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/ef9e6147-0797-472b-b38f-b39868c44e6b.png "image.png") 点击 Create WorkFlow 按钮,创建一个工作流 顶部是工具栏,包含工作流名称、开启关闭工作流、保存工作流、共享和导入导出……等功能按钮。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/482f35cf-e082-43b1-9787-5d09a7454c47.png "image.png") 中间是白板工作区,绘制、建立工作流的主要区域,可以在此放置和连接不同的节点,还有利用便利贴(Sticky Notes)撰写备注。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/631e494a-4c3c-45c7-b89f-df8ecb3672fe.png "image.png") 点击 Add first step,会出现右侧的弹窗 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/85df822d-8477-46bd-9d7b-5eacfadf1395.png "image.png") 一些核心节点解释: 触发节点 (Trigger Nodes):Manual Trigger:手动测试 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/55976b92-3d3d-49e3-a5c8-8d64600fc222.png "image.png") Schedule Trigger:Cron定时任务 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/6bbbf526-d658-4e18-be56-204602a88cac.png "image.png") Webhook:接收HTTP请求 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/fc14d088-7ba9-492c-8079-1102cb17e145.png "image.png") 聊天对话框触发 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b759db64-2c40-48c6-8c2f-1124ecd9ed90.png "image.png") ### 工作流实操案例 我们利用聊天对话框触发,实现一个n8n版本的AI对话机器人 用到三个节点:On chat message , AI Agent , DeepSeek Chat Model 先添加一个on chat message ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b9c2f7e6-0074-4c34-8af2-587a4227a83f.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/cde26198-d036-44db-9de9-61d7beee4cd0.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/14a6a8a6-70cb-48ef-b985-516448d99d76.png "image.png") 在输入框输入一个“你好”,点击运行 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8c586c1f-2b08-4cd9-9a75-8acb20b6ddf1.png "image.png") AI Agent 节点配置 ,需要将On chat message节点的chatInput 作为 Prompt ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/3149a3d0-a66f-48e0-8f5c-9ff16ad1fc5f.png "image.png") 选择模型选择DeepSeek Chat Model ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/1b19dd2e-db73-4bab-9599-b2cb582b621f.png "image.png") 第一次涉及到了配置Credential ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/2857d7c5-2fca-48f8-9821-04166de7b541.png "image.png") 我们需要到https://platform.deepseek.com/api_keys 创建一个API Key ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/6ebdce2d-41bb-4fc4-a250-1ee36ce85ebe.png "image.png") 将创建的 key 填到这里 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/bfcdaa5a-fd71-4e7a-ab12-2c388021a715.png "image.png") 保存一下,连接成功会有提示 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/e326c64f-ae0f-41e9-b9dc-86fde920a466.png "image.png") 配置好之后,我们可以到左下角的对话框,输入我们的内容,可以看到正确的回复了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/3c11d2dc-9f6f-44e8-a077-e1e103236897.png "image.png") 添加【记忆】让AI能够根据上下文回答 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/77529724-0734-4044-aeb5-f620701a4f58.png "image.png") 默认是 5,我改成了 30 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/5e1bf08a-1494-4a7f-90a5-443c258b10e2.png "image.png") 配置RSS,让AI助手能够访问指定网络 RSS(Really Simple Syndication)是一种用于订阅网站内容的技术。它允许用户方便地获取和阅读他们感兴趣的网站的最新更新,而无需逐个访问这些网站。 我创建一个RSS读取工具,然后进行配置。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b1a2131f-3af1-4611-a959-053cade8a895.png "image.png") 以老王博客为例,https://manateelazycat.github.io/feed.xml ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/d62e49bc-97cf-439e-ae55-b058819e86e9.png "image.png") 全部配置完成之后,我们在下方点击【打开聊天】测试一下。 我让这个Agent给我一些如何使用 ai 的建议,可以看到没有问题,调用DeepSeek和RSS联网后,输出了一篇文章。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b3e5d950-00b0-425e-aab5-40aa945b89b1.png "image.png") 至此,我们创建的第一个工作流就顺利跑通了! ## 学习资源推荐 ### 官方资源 - 官方文档:https://docs.n8n.io/ - 工作流模板:https://n8n.io/workflows/ - GitHub 项目:https://github.com/n8n-io/n8n ## 总结 n8n的本质就是:数据从一个节点流向另一个节点,你要做的就是控制这个流动过程。理解了数据流,其他都是细节。 最重要的是,n8n 的学习曲线很平缓,即使是编程小白也能快速上手。你只需要有一个想法——"我想让A和B自动连接",然后动手试试,很快就能做出实用的自动化流程。 相信我,一旦你体验过自动化带来的便利,就再也回不去手动操作的时代了。

n8n 实操攻略 10:搭建发票处理机器人(下)

上一篇我们已经拿到了发票的信息,并且保存到了 Google 表格中,接下来,我们要把关键信息,发送到我们的邮箱中。 https://appstore.lazycat.cloud/#/shop/detail/cloud.lazycat.app.n8n ### 提取邮箱地址 这一步需要把第一步中,我们输入的邮箱提取出来,参考代码 ``` const raw = $('When chat message received').first().json.chatInput|| ""; // 匹配第一个邮箱格式 const match = raw.match(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/); return [ { json: { email: match ? match[0] : null } } ]; ``` 执行后,可以看到能正常提取 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/e9af0e91-e540-48e9-adfc-1682744419c1.png "image.png") ### if判断 这一步,如果我们识别出来了邮箱,并且不为空的话,就执行下一步 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/6bbf6c97-415d-4ca1-95b7-f446330e3b2c.png "image.png") ### 发邮件 发邮件之前,可以把我们前面的节点名称改一下,方便我们看 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/35d4ce75-717a-4c9d-adfa-fa7ddf3285d7.png "image.png") 回到 Google [控制台](https://console.cloud.google.com) 点击 API 和服务 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/704755d3-3637-463a-b467-3d0b3e3a1dd5.png "image.png") 在这里搜索 Gmail ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/d1cbe02c-55d1-4dff-b7f1-9c735ff66c70.png "image.png") 启用 API 的权限 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/e26e8263-aade-4da8-aedc-0e13084c07f3.png "image.png") 这时候,回到 n8n,新建一个凭证 输入客户端 id 和密钥 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/99bd6296-f639-4fce-b141-e4029a1c9ec0.png "image.png") 授权成功会有提示 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/c59afaf1-6027-4375-b2bf-18280fe5f27c.png "image.png") 操作选择 send,邮箱就是我们识别出来的邮箱 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/3351cf06-41cb-4949-b9c8-9ffe559f8a4d.png "image.png") 邮件类型选择 html,message 参考下面的代码 ``` <div style="font-family: Arial, Helvetica, sans-serif; color:#222; line-height:1.6; max-width:720px; margin:0 auto; border:1px solid #eee; border-radius:8px; overflow:hidden;"> <!-- 顶部标题 --> <div style="background:#f6f8fa; padding:16px 20px; border-bottom:1px solid #eee;"> <div style="font-size:18px; font-weight:700;"> {{ $('GoogleSheets').first().json["发票标题"] || "发票" }} </div> <div style="font-size:13px; color:#666;"> 发票号码:{{ $('GoogleSheets').first().json["发票号码"] || "" }}  开票日期:{{ $('GoogleSheets').first().json["开票日期"] || "" }} </div> </div> <!-- 购方/销方 --> <table role="presentation" cellspacing="0" cellpadding="0" style="width:100%; border-collapse:collapse;"> <tr> <td style="padding:16px 20px; width:50%; vertical-align:top; border-right:1px solid #f0f0f0;"> <div style="font-weight:700; margin-bottom:6px;">购方信息</div> <div>名称:{{ $('GoogleSheets').first().json["购方名称"] || "" }}</div> <div>税号:{{ $('GoogleSheets').first().json["购方税号"] || "" }}</div> <div style="color:#666;">备注:{{ $('GoogleSheets').first().json["购方备注"] || "" }}</div> </td> <td style="padding:16px 20px; width:50%; vertical-align:top;"> <div style="font-weight:700; margin-bottom:6px;">销方信息</div> <div>名称:{{ $('GoogleSheets').first().json["销方名称"] || "" }}</div> <div>税号:{{ $('GoogleSheets').first().json["销方税号"] || "" }}</div> </td> </tr> </table> <!-- 行项目 --> <div style="padding:0 20px 16px 20px;"> <div style="font-weight:700; margin:6px 0 8px;">商品 / 服务明细</div> <table role="presentation" cellspacing="0" cellpadding="0" style="width:100%; border-collapse:collapse; border:1px solid #eee;"> <thead> <tr style="background:#fafbfc;"> <th style="text-align:left; padding:10px; border-bottom:1px solid #eee;">商品名称</th> <th style="text-align:left; padding:10px; border-bottom:1px solid #eee;">规格型号</th> <th style="text-align:center; padding:10px; border-bottom:1px solid #eee;">单位</th> <th style="text-align:right; padding:10px; border-bottom:1px solid #eee;">数量</th> <th style="text-align:right; padding:10px; border-bottom:1px solid #eee;">单价</th> <th style="text-align:right; padding:10px; border-bottom:1px solid #eee;">不含税金额</th> <th style="text-align:right; padding:10px; border-bottom:1px solid #eee;">税率</th> <th style="text-align:right; padding:10px; border-bottom:1px solid #eee;">税额</th> </tr> </thead> <tbody> <tr> <td style="padding:10px; border-bottom:1px solid #f5f5f5;">{{ $('GoogleSheets').first().json["商品名称"] || "" }}</td> <td style="padding:10px; border-bottom:1px solid #f5f5f5;">{{ $('GoogleSheets').first().json["规格型号"] || "" }}</td> <td style="padding:10px; text-align:center; border-bottom:1px solid #f5f5f5;">{{ $('GoogleSheets').first().json["单位"] || "" }}</td> <td style="padding:10px; text-align:right; border-bottom:1px solid #f5f5f5;">{{ $('GoogleSheets').first().json["数量"] || "" }}</td> <td style="padding:10px; text-align:right; border-bottom:1px solid #f5f5f5;">¥{{ parseFloat($('GoogleSheets').first().json["单价"] || 0).toFixed(2) }}</td> <td style="padding:10px; text-align:right; border-bottom:1px solid #f5f5f5;">¥{{ parseFloat($('GoogleSheets').first().json["不含税金额"] || 0).toFixed(2) }}</td> <td style="padding:10px; text-align:right; border-bottom:1px solid #f5f5f5;"> {{ $('GoogleSheets').first().json["税率显示"] || (parseFloat($('GoogleSheets').first().json["税率"] || 0)*100).toFixed(0) + "%" }} </td> <td style="padding:10px; text-align:right; border-bottom:1px solid #f5f5f5;">¥{{ parseFloat($('GoogleSheets').first().json["税额"] || 0).toFixed(2) }}</td> </tr> </tbody> </table> </div> <!-- 合计 --> <div style="padding:0 20px 20px 20px;"> <table role="presentation" cellspacing="0" cellpadding="0" style="margin-left:auto; border-collapse:collapse;"> <tr> <td style="padding:6px 12px; color:#666;">合计不含税金额:</td> <td style="padding:6px 12px; text-align:right; font-weight:700;"> ¥{{ parseFloat($('GoogleSheets').first().json["合计不含税金额"] || 0).toFixed(2) }} </td> </tr> <tr> <td style="padding:6px 12px; color:#666;">合计税额:</td> <td style="padding:6px 12px; text-align:right; font-weight:700;"> ¥{{ parseFloat($('GoogleSheets').first().json["合计税额"] || 0).toFixed(2) }} </td> </tr> <tr> <td style="padding:6px 12px; color:#666;">合计价税合计金额:</td> <td style="padding:6px 12px; text-align:right; font-weight:700;"> ¥{{ parseFloat($('GoogleSheets').first().json["合计价税合计金额"] || 0).toFixed(2) }} </td> </tr> </table> </div> <!-- 底部 --> <div style="padding:10px 20px; background:#f9fafb; border-top:1px solid #eee; font-size:13px; color:#555;"> 开票人:{{ $('GoogleSheets').first().json["开票人"] || "" }} </div> </div> ``` 点开看一下,如果不飙红并且能看到数据,说明是正常的 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b632e975-a783-48a7-b5cd-b82a4c74929e.png "image.png") 点击执行,输出结果是正常的 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/617f619b-d986-4a13-b44c-7178f4fad423.png "image.png") 邮件也收到了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/bd6eab1a-0a71-4fbe-a10c-ac2fb6b462fd.png "image.png") 打开邮件可以看到内容: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/178d60e3-79a6-4f4d-8c70-f61de80c1393.png "image.png") 以上就是发票机器人的完整流程。 如果你想偷懒,可以直接导入我的 json 文件,再参考攻略,配置自己的节点就可以了 ``` { "name": "analyze image and send email", "nodes": [ { "parameters": { "jsCode": "// n8n Code 节点 - 发票数据解析\n// 获取输入数据(处理可能的字符串格式)\nconst inputData = $input.first().json.choices[0].message.content;\n\n// 如果输入是字符串,先解析为 JSON\nlet invoiceData;\nif (typeof inputData === 'string') {\n // 移除可能的 markdown 代码块标记\n const cleanData = inputData.replace(/^```json\\s*/, '').replace(/\\s*```$/, '').trim();\n invoiceData = JSON.parse(cleanData);\n} else {\n invoiceData = inputData;\n}\n\n// 提取发票数据\nconst invoice = invoiceData.invoice;\n\n// 返回扁平化的 JSON 数据\nreturn [{\n json: {\n title: invoice.title,\n invoiceNumber: invoice.number,\n issueDate: invoice.issue_date,\n currency: invoice.currency,\n issuer: invoice.issuer,\n buyerName: invoice.buyer.name,\n buyerTaxId: invoice.buyer.tax_id,\n buyerNote: invoice.buyer.note,\n sellerName: invoice.seller.name,\n sellerTaxId: invoice.seller.tax_id,\n itemName: invoice.items[0].name,\n itemSpec: invoice.items[0].spec,\n itemUnit: invoice.items[0].unit,\n quantity: invoice.items[0].quantity,\n unitPrice: invoice.items[0].unit_price,\n amountWithoutTax: invoice.items[0].amount_without_tax,\n taxRate: invoice.items[0].tax_rate,\n taxRateDisplay: invoice.items[0].tax_rate_display,\n taxAmount: invoice.items[0].tax_amount,\n subtotal: invoice.totals.amount_without_tax,\n totalTax: invoice.totals.tax_total,\n grandTotal: invoice.totals.amount_with_tax\n }\n}];" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 0, 200 ], "id": "70bef82b-f44f-4389-adc2-d1e41a1ef12a", "name": "Code" }, { "parameters": { "operation": "append", "documentId": { "__rl": true, "value": "1M6GJAC6j3fvzZd2EImGSyugzLRKwa_Ok5ODnL6q4PWo", "mode": "list", "cachedResultName": "发票", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1M6GJAC6j3fvzZd2EImGSyugzLRKwa_Ok5ODnL6q4PWo/edit?usp=drivesdk" }, "sheetName": { "__rl": true, "value": "gid=0", "mode": "list", "cachedResultName": "Sheet1", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1M6GJAC6j3fvzZd2EImGSyugzLRKwa_Ok5ODnL6q4PWo/edit#gid=0" }, "columns": { "mappingMode": "defineBelow", "value": { "发票标题": "={{ $json.title }}", "发票号码": "={{ $json.invoiceNumber }}", "开票日期": "={{ $json.issueDate }}", "购方名称": "={{ $json.buyerName }}", "购方税号": "={{ $json.buyerTaxId }}", "购方备注": "={{ $json.buyerNote }}", "销方名称": "={{ $json.sellerName }}", "商品名称": "={{ $json.itemName }}", "销方税号": "={{ $json.sellerTaxId }}", "规格型号": "={{ $json.itemSpec }}", "单位": "={{ $json.itemUnit }}", "数量": "={{ $json.quantity }}", "单价": "={{ $json.unitPrice }}", "不含税金额": "={{ $json.amountWithoutTax }}", "税率": "={{ $json.taxRate }}", "税率显示": "={{ $json.taxRateDisplay }}", "税额": "={{ $json.taxAmount }}", "合计不含税金额": "={{ $json.subtotal }}", "合计税额": "={{ $json.totalTax }}", "合计价税合计金额": "={{ $json.grandTotal }}", "开票人": "={{ $json.issuer }}" }, "matchingColumns": [], "schema": [ { "id": "发票标题", "displayName": "发票标题", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "发票号码", "displayName": "发票号码", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "开票日期", "displayName": "开票日期", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "购方名称", "displayName": "购方名称", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "购方税号", "displayName": "购方税号", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "购方备注", "displayName": "购方备注", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "销方名称", "displayName": "销方名称", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "销方税号", "displayName": "销方税号", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "商品名称", "displayName": "商品名称", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "规格型号", "displayName": "规格型号", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "单位", "displayName": "单位", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "数量", "displayName": "数量", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "单价", "displayName": "单价", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "不含税金额", "displayName": "不含税金额", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "税率", "displayName": "税率", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "税率显示", "displayName": "税率显示", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "税额", "displayName": "税额", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "合计不含税金额", "displayName": "合计不含税金额", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "合计税额", "displayName": "合计税额", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "合计价税合计金额", "displayName": "合计价税合计金额", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "开票人", "displayName": "开票人", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true } ], "attemptToConvertTypes": false, "convertFieldsToString": false }, "options": {} }, "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.6, "position": [ 260, 80 ], "id": "9a9b3088-7722-4dd5-b2b7-28726fd64f8f", "name": "Google Sheets", "credentials": { "googleSheetsOAuth2Api": { "id": "jflKNS6HMBOKZok2", "name": "Google Sheets account" } } }, { "parameters": { "jsCode": "const raw = $('When chat message received').first().json.chatInput|| \"\";\n\n// 匹配第一个邮箱格式\nconst match = raw.match(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}/);\n\nreturn [\n {\n json: {\n email: match ? match[0] : null\n }\n }\n];\n" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 420, -80 ], "id": "5e71f0be-bebb-42ac-9d64-413d98b4e5db", "name": "Code1" }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 2 }, "conditions": [ { "id": "a44e6c17-4473-4dfe-bab9-5c98caa8fa31", "leftValue": "={{ $json.email }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [ 640, -80 ], "id": "e50264b2-51e1-4c2a-bb0d-66447b6f3b0d", "name": "If" }, { "parameters": { "sendTo": "={{ $json.email }}", "subject": "发票", "message": "=<div style=\"font-family: Arial, Helvetica, sans-serif; color:#222; line-height:1.6; max-width:720px; margin:0 auto; border:1px solid #eee; border-radius:8px; overflow:hidden;\">\n <!-- 顶部标题 -->\n <div style=\"background:#f6f8fa; padding:16px 20px; border-bottom:1px solid #eee;\">\n <div style=\"font-size:18px; font-weight:700;\">\n {{ $('Google Sheets').item.json[\"发票标题\"] || \"发票\" }}\n </div>\n <div style=\"font-size:13px; color:#666;\">\n 发票号码:{{ $('Google Sheets').item.json[\"发票号码\"] || \"\" }} \n 开票日期:{{ $('Google Sheets').item.json[\"开票日期\"] || \"\" }} \n \n </div>\n </div>\n\n <!-- 购方/销方 -->\n <table role=\"presentation\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%; border-collapse:collapse;\">\n <tr>\n <td style=\"padding:16px 20px; width:50%; vertical-align:top; border-right:1px solid #f0f0f0;\">\n <div style=\"font-weight:700; margin-bottom:6px;\">购方信息</div>\n <div>名称:{{ $('Google Sheets').item.json[\"购方名称\"] || \"\" }}</div>\n <div>税号:{{ $('Google Sheets').item.json[\"购方税号\"] || \"\" }}</div>\n <div style=\"color:#666;\">备注:{{ $('Google Sheets').item.json[\"购方备注\"] || \"\" }}</div>\n </td>\n <td style=\"padding:16px 20px; width:50%; vertical-align:top;\">\n <div style=\"font-weight:700; margin-bottom:6px;\">销方信息</div>\n <div>名称:{{ $('Google Sheets').item.json[\"销方名称\"] || \"\" }}</div>\n <div>税号:{{ $('Google Sheets').item.json[\"销方税号\"] || \"\" }}</div>\n </td>\n </tr>\n </table>\n\n <!-- 行项目 -->\n <div style=\"padding:0 20px 16px 20px;\">\n <div style=\"font-weight:700; margin:6px 0 8px;\">商品 / 服务明细</div>\n <table role=\"presentation\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%; border-collapse:collapse; border:1px solid #eee;\">\n <thead>\n <tr style=\"background:#fafbfc;\">\n <th style=\"text-align:left; padding:10px; border-bottom:1px solid #eee;\">商品名称</th>\n <th style=\"text-align:left; padding:10px; border-bottom:1px solid #eee;\">规格型号</th>\n <th style=\"text-align:center; padding:10px; border-bottom:1px solid #eee;\">单位</th>\n <th style=\"text-align:right; padding:10px; border-bottom:1px solid #eee;\">数量</th>\n <th style=\"text-align:right; padding:10px; border-bottom:1px solid #eee;\">单价</th>\n <th style=\"text-align:right; padding:10px; border-bottom:1px solid #eee;\">不含税金额</th>\n <th style=\"text-align:right; padding:10px; border-bottom:1px solid #eee;\">税率</th>\n <th style=\"text-align:right; padding:10px; border-bottom:1px solid #eee;\">税额</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td style=\"padding:10px; border-bottom:1px solid #f5f5f5;\">{{ $('Google Sheets').item.json[\"商品名称\"] || \"\" }}</td>\n <td style=\"padding:10px; border-bottom:1px solid #f5f5f5;\">{{ $('Google Sheets').item.json[\"规格型号\"] || \"\" }}</td>\n <td style=\"padding:10px; text-align:center; border-bottom:1px solid #f5f5f5;\">{{ $('Google Sheets').item.json[\"单位\"] || \"\" }}</td>\n <td style=\"padding:10px; text-align:right; border-bottom:1px solid #f5f5f5;\">{{ $('Google Sheets').item.json[\"数量\"] ?? \"\" }}</td>\n <td style=\"padding:10px; text-align:right; border-bottom:1px solid #f5f5f5;\">{{ Number($('Google Sheets').item.json[\"单价\"] ?? 0).toFixed(6) }}</td>\n <td style=\"padding:10px; text-align:right; border-bottom:1px solid #f5f5f5;\">{{ Number($('Google Sheets').item.json[\"不含税金额\"] ?? 0).toFixed(2) }}</td>\n <td style=\"padding:10px; text-align:right; border-bottom:1px solid #f5f5f5;\">\n {{ $('Google Sheets').item.json[\"税率显示\"] || (Number($('Google Sheets').item.json[\"税率\"] ?? 0)*100).toFixed(0) + \"%\" }}\n </td>\n <td style=\"padding:10px; text-align:right; border-bottom:1px solid #f5f5f5;\">{{ Number($('Google Sheets').item.json[\"税额\"] ?? 0).toFixed(2) }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <!-- 合计 -->\n <div style=\"padding:0 20px 20px 20px;\">\n <table role=\"presentation\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-left:auto; border-collapse:collapse;\">\n <tr>\n <td style=\"padding:6px 12px; color:#666;\">合计不含税金额:</td>\n <td style=\"padding:6px 12px; text-align:right; font-weight:700;\">\n {{ Number($('Google Sheets').item.json[\"合计不含税金额\"] ?? 0).toFixed(2) }}\n </td>\n </tr>\n <tr>\n <td style=\"padding:6px 12px; color:#666;\">合计税额:</td>\n <td style=\"padding:6px 12px; text-align:right; font-weight:700;\">\n {{ Number($('Google Sheets').item.json[\"合计税额\"] ?? 0).toFixed(2) }}\n </td>\n </tr>\n <tr>\n <td style=\"padding:6px 12px; color:#666;\">合计价税合计金额:</td>\n <td style=\"padding:6px 12px; text-align:right; font-weight:700;\">\n {{ Number($('Google Sheets').item.json[\"合计价税合计金额\"] ?? 0).toFixed(2) }}\n </td>\n </tr>\n </table>\n </div>\n\n <!-- 底部 -->\n <div style=\"padding:10px 20px; background:#f9fafb; border-top:1px solid #eee; font-size:13px; color:#555;\">\n 开票人:{{ $('Google Sheets').item.json[\"开票人\"] || \"\" }}\n </div>\n</div>\n", "options": {} }, "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [ 1060, -60 ], "id": "16486451-dabf-48d7-98a9-77851add9d47", "name": "Gmail", "webhookId": "7f924497-ae8b-4b4e-8cad-3b4cd7a162d9", "credentials": { "gmailOAuth2": { "id": "lLR0rjkd7MVl0WuY", "name": "Gmail account" } } }, { "parameters": { "options": { "allowFileUploads": true } }, "type": "@n8n/n8n-nodes-langchain.chatTrigger", "typeVersion": 1.1, "position": [ -760, 200 ], "id": "7e8689a3-250d-466a-a4b1-1e42a8f014d4", "name": "When chat message received", "webhookId": "d7c99574-86d3-42f4-adf2-69f9fc1f7d3d" }, { "parameters": { "method": "POST", "url": "https://api.imgbb.com/1/upload?expiration=6000&key=80ddf220f655b5887b8a5eeee2a3652e", "sendBody": true, "contentType": "multipart-form-data", "bodyParameters": { "parameters": [ { "parameterType": "formBinaryData", "name": "image", "inputDataFieldName": "data0" } ] }, "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ -560, 200 ], "id": "0849a0c5-dafc-4af7-ac7d-8b463df5abb9", "name": "IMGBB" }, { "parameters": { "method": "POST", "url": "https://api.gpt.ge/v1/chat/completions", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"## 角色\\n你是一个专业的\\\"发票信息抽取器\\\"。输入是一段发票文字(可能来自 OCR、邮件正文或聊天粘贴),输出是严格有效的 JSON,适合直接写入数据库/Google Sheets。\\n## 任务\\n从给定的发票文本中识别并抽取字段,返回单个 JSON 对象,放在一个标记代码块里(json ... )。不要输出任何解释、注释或多余字符。\\n## 输出要求\\n仅输出一个 JSON 代码块,不得包含额外文字。\\n不存在或不确定的值一律填 null。\\n日期统一为 YYYY-MM-DD(ISO 8601);\\n金额/数量等数值字段用 数字类型(而非字符串),保留精度但不要添加货币符号或千分位。\\n税率使用小数(例如 1% → 0.01),并同时提供显示字段(例如 \\\"1%\\\")。\\nitems 数组必须存在;若无行项目,输出空数组 []。\\n## 字段定义(Schema)\\n{\\n \\\"invoice\\\": {\\n \\\"title\\\": \\\"string|null\\\",\\n \\\"number\\\": \\\"string|null\\\",\\n \\\"issue_date\\\": \\\"YYYY-MM-DD|null\\\",\\n \\\"currency\\\": \\\"string|null\\\",\\n \\\"buyer\\\": {\\n \\\"name\\\": \\\"string|null\\\",\\n \\\"tax_id\\\": \\\"string|null\\\",\\n \\\"note\\\": \\\"string|null\\\"\\n },\\n \\\"seller\\\": {\\n \\\"name\\\": \\\"string|null\\\",\\n \\\"tax_id\\\": \\\"string|null\\\"\\n },\\n \\\"items\\\": [\\n {\\n \\\"name\\\": \\\"string|null\\\",\\n \\\"spec\\\": \\\"string|null\\\",\\n \\\"unit\\\": \\\"string|null\\\",\\n \\\"quantity\\\": \\\"number|null\\\",\\n \\\"unit_price\\\": \\\"number|null\\\",\\n \\\"amount_without_tax\\\": \\\"number|null\\\",\\n \\\"tax_rate\\\": \\\"number|null\\\",\\n \\\"tax_rate_display\\\": \\\"string|null\\\",\\n \\\"tax_amount\\\": \\\"number|null\\\"\\n }\\n ],\\n \\\"totals\\\": {\\n \\\"amount_without_tax\\\": \\\"number|null\\\",\\n \\\"tax_total\\\": \\\"number|null\\\",\\n \\\"amount_with_tax\\\": \\\"number|null\\\"\\n },\\n \\\"issuer\\\": \\\"string|null\\\"\\n }\\n}\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"{{ $json.data.url }}\"\n }\n }\n ]\n }\n ]\n} ", "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ -240, 200 ], "id": "24b25ed1-18d8-4c8a-9d2e-d903168e9b8e", "name": "识别图片", "retryOnFail": true, "credentials": { "httpHeaderAuth": { "id": "BKtGro8HEgz5LcZM", "name": "V3 Header Auth account" } } } ], "pinData": {}, "connections": { "Code": { "main": [ [ { "node": "Google Sheets", "type": "main", "index": 0 } ] ] }, "Google Sheets": { "main": [ [ { "node": "Code1", "type": "main", "index": 0 } ] ] }, "Code1": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] }, "If": { "main": [ [ { "node": "Gmail", "type": "main", "index": 0 } ] ] }, "When chat message received": { "main": [ [ { "node": "IMGBB", "type": "main", "index": 0 } ] ] }, "IMGBB": { "main": [ [ { "node": "识别图片", "type": "main", "index": 0 } ] ] }, "识别图片": { "main": [ [ { "node": "Code", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "versionId": "fb865209-ec18-41a6-b252-def147580997", "meta": { "templateCredsSetupCompleted": true, "instanceId": "3cb07a731a78af260d8c81716bfc0e842ef01e898e945b902a3871e6a1cd0d48" }, "id": "OWymQVChmL3XifYL", "tags": [] } ```

n8n 实操攻略 22:如何配置Reddit搜索数据

### Reddit是什么? Reddit,常被戏称为“互联网首页”,是一个庞大且极具活力的在线社区平台。 它并非单一的论坛,而是由成千上万个名为“Subreddit”(简称sub,可理解为特定主题的版块或子社区)组成的集合体。 每个Subreddit都围绕着一个特定的兴趣、话题或社群,从主流的科技(r/technology)、游戏(r/gaming)、新闻(r/news),到非常小众的爱好如“只用勺子吃饭的人”(r/WeWantPlatesButWeGotSpoons),包罗万象。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8c1c6b8a-9bc7-4ffe-9f84-021de48561ae.png "image.png") 在n8n 里,可以通过工作流,链接 Reddit,更好的分析数据,做出海需求。 https://appstore.lazycat.cloud/#/shop/detail/cloud.lazycat.app.n8n ### 如何配置 新建一个工作流,搜索 Reddit 节点 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/66ee3401-e009-43e3-81e4-04edcf7bccf0.png "image.png") 选择 Search for a post ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/452ce688-926a-469a-a9bc-98ac56d6bf6e.png "image.png") 需要先新建个凭证 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/9bd74087-670b-4e88-8a03-c7c959cdb0d2.png "image.png") 这里的 url 可以先复制下,等会儿要用到 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/0c039d40-8434-44a3-8e80-f0cd859d2889.png "image.png") 接下来,我们要获取到 Reddit 里的 clientid 和密钥 进入 Reddit 后台 https://www.reddit.com/prefs/apps 点击 create an app ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/d01a41f7-f2d5-4bbf-894a-d4dab2b4b67c.png "image.png") 把前面的 url,填入到redirect uri这个位置 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/23672d9f-bf8e-45a6-9027-dfdb491a9b31.png "image.png") 点击 create app,就会弹出web app和secret信息 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/2b8f4885-f0be-4adc-af07-001c9610b27a.png "image.png") 点击链接账户 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/d89440d9-5c0f-4083-a8b8-d3c327d968fe.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/a2ac462c-06ef-4eb8-9bf0-ada524f997b6.png "image.png") 链接成功会有提示 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/225668f6-d6a3-4d10-a443-a4a8bd948bf8.png "image.png") Resource 是选择搜索的类型:帖子、评论、用户。。。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/9c158d9a-8e90-4339-820f-036b38bdea5c.png "image.png") Location 是选择子频道还是整站搜索 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/f6a15c36-f7c1-4bcf-8cc4-cfc0c9ddd416.png "image.png") 输入关键词,下方可以设置排序类型 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8e572d6d-ee87-41a6-ab40-0b5be8ca99b8.png "image.png") 点击执行 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/d4e65ccd-9b58-4255-b965-8a0691856246.png "image.png") 可以看到搜索结果了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/3746aea7-257a-4957-8c29-20c3cd8cc526.png "image.png") 通常我们会过滤一下数据,只要自己想处理的关键数据,可以添加一个 filter 节点 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7f7654c5-0b77-4587-a98a-479234a8ec90.png "image.png") 比如点赞 ups 大于 5 的数据 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7fccc30e-5e48-47e6-a98f-c209e9d50622.png "image.png") 拿到数据之后,可以让 AI 去分析数据,整理需求, 可以参考的提示词 ``` ### Reddit搜索结果深度分析与商业洞察 #### 1. 角色扮演 (Role) & 任务背景 (Context) 您将扮演一名专业的 “Reddit 商业机会分析师”。您的任务是基于给定的 Reddit 搜索数据,为用户提供一份精准、深刻且聚焦于商业价值的分析洞察。请以该专家的视角进行思考和表达。 #### 2. 任务目标 (Goal) 根据下方提供的 “用户搜索意图”、“搜索关键词” 和 “Reddit 搜索结果”,生成一份包含两大核心模块的分析报告:“主题内容与相关性” 和 “行业聚焦与细分机会”。报告必须结构清晰、逻辑严谨,并严格遵循指定的输出格式。 #### 3. 输入数据 (Input Data) * 用户的搜索意图: ``` {{ $('设置搜索词与id').item.json.target }} ``` * 搜索关键词: ``` {{ $('设置搜索词与id').item.json.search_keyword }} ``` * Reddit 搜索结果 (帖子标题与内容): ``` {{ $('Loop Over Items').item.json.data.record.fields['帖子标题'] }} {{ $('Loop Over Items').item.json.data.record.fields['帖子内容'] }} ``` --- #### 4. 输出要求:严格遵循以下 Markdown 格式 (Output Format) ### Reddit 搜索结果商业价值分析报告 1. 主题内容与相关性 * 核心议题总结: (在此处以列表形式,总结帖子中反复出现的 1-3 个核心议题、问题或观点。) * 议题一: * 议题二: * ... * 相关性评估: (在此处明确评估这些议题与“用户搜索意图”的关联程度,请选择:高 / 中 / 低 / 不相关,并简要解释你的判断理由。) 2. 行业聚焦与细分机会 * 2.1 潜在细分行业/领域: * 根据帖子内容,识别出该讨论最可能归属或关联的 1-2 个细分行业或特定市场领域。 * 示例: * 细分行业1: [例如:独立游戏开发、SaaS客户支持工具、可持续时尚电商] * 2.2 用户痛点洞察: * 从帖子中用户(发帖人或评论者)的讨论、抱怨、提问或分享的经验中,识别出 1-3 个明确的用户痛点或未被满足的需求。 * 要求:痛点描述需具体,能反映用户的真实困境。 * 示例: * 痛点1: [例如:缺乏针对小型企业的廉价项目管理工具] * 痛点2: [例如:现有AI写作助手生成的中文内容不够自然] * 2.3 潜在商业机会挖掘: * 基于上述核心议题和用户痛点,思考并提出 1-2 个具有潜力的商业机会、产品概念或服务方向。 * 要求:商业机会应具有一定的创新性和可行性,并说明其如何解决用户痛点或满足需求。 * 示例: * 商业机会1: [例如:开发一款集成AI的、专为中文内容创作者设计的语法和风格优化插件,以解决AI写作不自然的问题。] * 商业机会2: [例如:推出一个专注于可持续材料的B2B时尚采购平台,连接设计师与环保面料供应商。] --- #### 5. 关键指令与限制 (Critical Instructions & Constraints) * 聚焦商业: 分析的最终目的是挖掘商业价值,请确保“商业机会”部分具体、有启发性,而不仅仅是重复问题。 * 专注当前帖子: 你的所有分析都必须严格基于当前提供的“Reddit帖子标题”和“Reddit帖子内容”。不要引入外部知识或对其他帖子的假设,除非帖子内容明确引用,杜绝主观臆测。 * 客观中立: 保持分析的客观性和中立性,避免主观臆断。 * 深度优先: 相比宽泛的概述,更注重对单一帖子价值的深度挖掘。 * 精炼表达: 使用精炼的商业语言,直击要点。语言力求精准、专业、言简意赅。 * 信息不足处理: 如果帖子内容过于简短或信息不足,导致无法有效完成某项分析(如“商业机会挖掘”),请在该项下明确指出“信息不足,无法进行有效分析”,并简要说明原因。 * 严格遵守格式: 必须完全遵循上述Markdown输出格式,包括标题层级、编号和加粗等。 * 如果帖子内容为空或无关: 若“Reddit帖子内容”为空、乱码或与“帖子标题”、“搜索关键词”及“用户搜索意图”完全不相关(例如广告、spam),则在报告开头注明“当前帖子内容无效或不相关,无法进行分析”,然后终止后续分析。 ``` 剩下的就是自己发挥了,可以根据需要去添加节点。 最难的部分是凭证的如何配置。

n8n 上手攻略:5个方法让你快速搭建一个工作流

想要学会用 n8n 这个自动化工具,很多人都走入了一个误区:**把它当成编程语言来学**。 我们都知道,学编程需要从基础的语法开始,然后学习各种框架,最后才能真正动手做项目。 但 n8n 压根就不是编程。它更像是一个拼积木的工具。你见过哪个小孩子在玩积木之前,会先去把说明书从头到尾背下来呢? 学 n8n 最快的方法,其实是【模仿】,或者说是【复制、粘贴】,快速的把一个工作流跑起来,能大大提高你的自信心。 https://appstore.lazycat.cloud/#/shop/detail/cloud.lazycat.app.n8n 我总结了以下几个方法,能带你快速入门: ### 官方模版库 打开https://n8n.io/workflows/ ,在顶部搜索框中,输入你想搜索的关键词, 官方目前有 5k多个工作流。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/2a5451ba-d333-48a9-993b-ebc1658ad412.png "image.png") 比如你搜 it Ops,显示有 795 个结果 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/376d7929-b4da-43a7-9e79-92564dd16bbb.png "image.png") 点击一个你感兴趣的项目,点击 use fro free ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/c1742ad7-5d1e-4dc5-b252-c89a1b5dfcd5.png "image.png") 在弹窗中复制它的 json 文件 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/2cd1e205-6b74-4a37-82cc-69d46a942b64.png "image.png") 回到 n8n,新建一个工作流,直接ctr+v 粘贴 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/87880a83-e88e-460f-99a4-ffa04076e7ba.png "image.png") 导入的工作流通常都是灰色的,表示需要配置,如果有大模型或者权限配置,需要你手动配置上。 ### n8n workflows 应用商店里有这个应用,同样支持上面的操作 https://appstore.lazycat.cloud/#/shop/detail/com.txj.n8nworkflows 新手入门的话,可以选择难度为 low 的,节点比较少,更容易跑起来 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/6465c8cd-f33e-4460-8f4c-a40f895b3639.png "image.png") 你可以下载 json 文件,再导入到 n8n 中,或者直接复制代码,粘贴也可以。它也支持在线查看流程图 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/e778a3bc-df83-46c4-a0db-ae8cec6e4d71.png "image.png") ### 利用大模型做提示词 万能提示词模板: Please act as an n8n expert. Create a detailed n8n workflow for the following task: [你的具体需求粘贴这里] Please provide the step-by-step logic and the complete JSON for me to import. 它甚至可以给你自动生成 json 文件, ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/e1ffd996-e3d4-4e36-b699-5979209e667a.png "image.png") 如果你觉得还是太麻烦,可以看下面的方法 ### 安装n8n-mcp 执行代码 npm install -g @leonardsellem/n8n-mcp-server 以 mac 为例,在~/.zshrc 文件中,添加 `export N8N_API_KEY="your-actual-n8n-api-key" # 替换为你的实际 API Key export N8N_BASE_URL="http://localhost:5678" # 替换为你的 n8n 实例 URL` #### 如何获取 n8n API Key: 1. 登录你的 n8n 实例 2. 点击右上角的用户菜单 3. 选择 "Settings" 4. 进入 "API" 选项卡 5. 创建新的 API Key 或复制现有的 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/f5410b91-d49c-47df-b026-9446de966c77.png "image.png") 等配置好之后,就可以在你的开发环境 IDE 中,比如我用 Claude Code,直接问他:列出我所有的 n8n 工作流,输出结果: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/545bc393-44a5-475e-a783-0847757e9548.png "image.png") 在 n8n 环境中,可以看到,它的结论是没问题的,说明链接成功了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8a313109-cc14-420a-b04b-a21f7af2241f.png "image.png") 接下来,我就可以直接让它帮我生成工作流 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/4022b1b0-55a1-4237-92ae-ecceeca3ff7c.png "image.png") 等了 4 分钟,它提示我已经创建成功了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/0b318581-ab21-453c-8463-4230c071d380.png "image.png") 回到n8n,刷新一下,果然发现它给我创建了一个工作流 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/2a790190-be14-4f01-8e39-af978878e6db.png "image.png") ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/40f95c4a-cd2c-48c1-9ff4-b5ae1c3528d0.png "image.png") 当然,这个方法比较废 token,如果是 max 用户就无所谓了。 ### 安装n8n 浏览器插件 在 chrome 商店中搜索 n8n workflow ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8df8f974-44ac-4972-acb0-ca48a5766e32.png "image.png") 配上你的 api key 就能用了,我用的是 Gemini ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/a2d1cd95-b8a7-4c61-a647-6a34e445414c.png "image.png") 对于简单的工作流,它就直接可以生成了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/2d147008-d97c-40a2-bf8f-7ed22a25cf83.png "image.png") 它没有像 Claude Code 那样生成详细的说明文档,好处就是免费能用。 ## 写在最后 学习n8n最忌讳只学不干,相信通过上面的方法能让你快速上手一个n8n 工作流。

n8n 配置攻略 14:如何配置 X(原 Twitter)节点

在 n8n 中,可以配置上 X,能实现自动读取、发送推文。 这篇攻略讲解如何配置好 X 的相关细节。 https://appstore.lazycat.cloud/#/shop/detail/cloud.lazycat.app.n8n ### 1.新建工作流 先新建一个工作流 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/a69d4e6a-8ef0-4e28-afba-054992924c6b.png "image.png") 触发器就选手动触发就行 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/7a150494-24fa-4a81-9045-2d924f7883ce.png "image.png") 添加 x节点 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/bf23329e-a57d-4421-a8ee-0dce65ada901.png "image.png") 选择创建推文 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b89f47ca-ce08-4c23-92a4-c991cfc37aee.png "image.png") 这里需要创建凭证了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/6ac16461-d951-460f-b4a7-080d6828d918.png "image.png") 可以先复制下这个 url,待会要用到 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/2867697f-7034-4f2d-b255-02db43224421.png "image.png") ### 2.查看 API 文档 官方的配置文档在[这里](https://docs.n8n.io/integrations/builtin/credentials/twitter/#using-oauth2),默认是英文的,可以配合沉浸式翻译看中文。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/dfded4b0-7904-4bcd-a4cf-bff238abe512.png "image.png") 根据文档要求,你需要先到 X 的开发者账户,申请[开通权限](https://developer.x.com/en) 申请理由,可以让 ai 帮你生成一下,最好填英文的。 把这几个都勾上 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/4bc5ec26-a8b3-47c1-9a4d-8bc4b11da0f7.png "image.png") 接下来[开通一个项目](https://developer.x.com/en/portal/projects-and-apps),申请 ClientID 和密钥。 在项目的“ Overview ”选项卡上,找到 “应用 ”部分,然后选择“ Add App ”。 这是我创建好的页面 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/237560db-2427-498f-84d4-0c13a89b7096.png "image.png") 进入 app 的设置界面 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/fd1f9d2b-cb04-42e2-86d3-3ce848414f75.png "image.png") 用户认证里,点击set up 安装 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8a4a1582-8640-4076-9f5b-1cbcf160a0ca.png "image.png") 这里我给了它最高的权限,type of app 选下面的这个 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/c001aa48-02a8-48dc-a198-2472b2bcbc72.png "image.png") App info 这里,要填几个 url ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/40ace661-32b0-4c1b-a14c-7cc315cb8bd8.png "image.png") 这里的 Callback URI,就是我们第 1 步复制的那个 url 填入你的 website url,随便填一个就行 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/61294a0b-323b-4356-8c8c-72b2868ea2ec.png "image.png") 这时候就会生成 ClientID 和 Secert 了,注意密钥可以保存到本地,防止丢失。 复制粘贴到 n8n 的框里。 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/f84c5a50-7a3c-4820-a33f-e259697ef9ca.png "image.png") 点击链接账户 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b06d2ea6-0006-40b6-b541-3b62350f4c6f.png "image.png") 授权应用 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/4c61cbd8-6e09-4109-ba3b-7b2228fd421d.png "image.png") n8n 里可以看到 链接成功了: ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/cdfd7482-50b7-4550-aff7-0dc9668bf104.png "image.png") 我们发送个“你好懒猫”测试一下 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/546a2238-d284-4d6c-8581-bae6d04223b6.png "image.png") 可以看到输出结果 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/a65106dc-9bca-43b1-b341-37440d186827.png "image.png") 在我的信息流里可以看到了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/2357ef7d-9ca8-4e37-a8a3-57f4b75bd024.png "image.png") 以上就是 X 在n8n 里的配置,接下来可以利用它做一些好玩的事情,比如自动定时发推,可以看我以后的攻略。

n8n 实操攻略 3:如何打通飞书节点

上一篇讲了如何在 n8n 中使用 Google drive,但在网络环境中,大家可能用到飞书多一些。这篇攻略讲一下如何配置飞书平台。 https://appstore.lazycat.cloud/#/shop/detail/cloud.lazycat.app.n8n 点击左下角头像旁边的...点击 Setting ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/16a43e4e-8065-403d-898f-c1c3523db467.png "image.png") 点击社区节点 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/746b8858-351b-41de-ab6e-b8d209a3d984.png "image.png") 打开社区网站 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/baaee395-2ff1-4963-b148-c6212294deb0.png "image.png") 搜索 feishu,我们用第 2 个 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/054a1b5f-6ca6-46d5-87fb-b38d0e9ab447.png "image.png") 复制节点名称 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8ec969b0-277c-47cb-a9b4-d9821495b12a.png "image.png") 点击安装 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/56f82308-738e-470c-b8b4-7372a8f724df.png "image.png") 安装成功后,这里可以看到 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/8e575a9c-3657-479c-9ad7-df27b9ed4119.png "image.png") 获取飞书的 appid 和密钥: 打开[飞书开放平台](https://open.feishu.cn/app?lang=zh-CN),创建一个应用 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/82bec407-42b0-4c5f-8331-83877ad582c7.png "image.png") 权限管理,开通权限 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/90781ba3-1d51-4e65-8e88-f1abd8e5fb64.png "image.png") 搜索多维,把这些都勾选上 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/0f15ea27-ea3c-47c4-a0ae-3fb39627a4b7.png "image.png") 创建一个版本 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/98fd26b7-dda2-4494-8d7a-a2378132e47c.png "image.png") 发布应用 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/b69c1177-55e4-4ba9-9d0f-b6ce45a80264.png "image.png") 在凭证信息里,可以看到 appid 和密钥了 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/0972dc18-7bc1-41ab-86d0-1318eab52e37.png "image.png") 点击右上角的云文档 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/1e25573d-358d-4447-9f9d-bbbcb6490074.png "image.png") 新建一个多维表格 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/bd9766cd-3665-4945-b69e-8eb0bd1c6b51.png "image.png") 复制一下上面的地址,待会要用 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/639343fd-6181-4e4f-9e3b-a5cae6ae14bc.png "image.png") 地址是类似这种: https://tian.feishu.cn/base/O9l76llJCaZVAVstncccUSSwnxf?table=tbl54l8x14vL0VmXTA&view=vewlNi2SYj 回到 n8n 工作台,添加一个节点 搜索 feishu,可以看到刚才安装的节点 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/bc483c1e-6321-4f9e-8606-2b190a24cc52.png "image.png") 往下拉可以看到跟多维表格相关的操作 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/9a2940f8-50fa-4aa6-a190-608a1b041fe6.png "image.png") 点击 新增记录 首先要新增一个授权 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/bd0abbbc-79f6-407a-a52d-7fe235ddd9a8.png "image.png") appid 和 secret 就是第一步我们拿到的 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/cc888961-4374-407b-afb9-effd78c18fba.png "image.png") 保存会有成功提示 ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/4e105635-dc46-4e9d-b338-d246d7f457a9.png "image.png") 多维表格token: 回到多维表格的URL链接,"base"后面,"table"前面的内容就是多维表格的token,注意:不包含? 多维表格ID: "table"后面,"view"前面的内容,就是多维表格的ID 注意:不包含& ![image.png](https://lzc-playground-1301583638.cos.ap-chengdu.myqcloud.com/guidelines/496/f9f07fc4-94f8-43bc-afb0-1c76af9cf510.png "image.png") 至此,飞书的相关的文档操作,n8n 节点已经准备好了。

懒猫评分/评论

5.0

5 条评论

请继续更新版本。谢谢。

强烈要起升级到1.135.3!!!

请问如何安装社区节点呢?

应用信息

最新版本

2.21.7

更新日期

5/25/2026

预估安装占用

318.47 MB

不支持平台

android、ios

来源

n8n-io

兼容性

可在此设备上使用

更新上游最新版