8
n8n 中文网amn8n.com

自动化AI与LLM通讯,通过BrowserAI和邮件/Telegram发送

中级

这是一个AI Summarization, Multimodal AI领域的自动化工作流,包含 13 个节点。主要使用 Code, Wait, Switch, Telegram, EmailSend 等节点。 自动化AI与LLM通讯,通过BrowserAI和邮件/Telegram发送

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "c52c57a23340de7df966f9e47d97a3fb8c52621d4c39f6342366d1114449002a",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "a0db787b-16a5-493f-9027-7ece55fd8202",
      "name": "获取昨天日期",
      "type": "n8n-nodes-base.code",
      "position": [
        192,
        16
      ],
      "parameters": {
        "jsCode": "return $input.all().map(item => {\n    const timestamp = item.json.timestamp;\n\n    // Create a Date object using the timestamp\n    const triggerDate = new Date(timestamp);\n\n    // Subtract one day to find yesterday's date\n    const yesterday = new Date(triggerDate);\n    yesterday.setDate(triggerDate.getDate() - 1);\n\n    // Format the date as 'dd-MONTH-yyyy'\n    const day = String(yesterday.getDate()).padStart(2, '0');\n    const monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n                        \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n    const month = monthNames[yesterday.getMonth()];\n    const year = yesterday.getFullYear();\n\n    const formattedYesterday = `${day}-${month}-${year}`;\n\n    // Return the result as an object\n    return {\n        json: {\n            formattedYesterday: formattedYesterday\n        }\n    };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "78689092-da85-4a8f-8e40-1c19a95b9a0e",
      "name": "创建新任务",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        448,
        16
      ],
      "parameters": {
        "url": "https://browser.ai/api/v1/tasks",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"instructions\": [\n    {\n      \"action\": \"Please summarize me all the latest news, articles and updates regarding AI and LLMs up to {{ $json.formattedYesterday }}, including title, description and source\"\n    }\n  ],\n  \"geoLocation\": {\n    \"country\": \"us\"\n  },\n  \"project\": \"Project_1\",\n  \"type\": \"crawler_automation\",\n  \"inspect\": true\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "9863ukmMuy65jQPA",
          "name": "BrowserAI account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "872f6181-8fc5-4ff6-bd48-39459054c392",
      "name": "获取任务元数据",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        720,
        16
      ],
      "parameters": {
        "url": "=https://browser.ai/api/v1/tasks/{{ $('Create a new task').item.json.executionId }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "9863ukmMuy65jQPA",
          "name": "BrowserAI account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "215cfa34-249f-434e-aebf-f2e1e8901dee",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -32,
        16
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9455a451-6ecd-4892-bf8f-2af2afcaf11e",
      "name": "发送文本消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1616,
        0
      ],
      "webhookId": "67fb53ea-3c6c-4a7a-8fbf-8d8d3208fbd0",
      "parameters": {
        "text": "={{ $json.cleanedText }}",
        "chatId": "DESTINATION_CHAT_ID",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "EEoBwGOcQmjV0Dau",
          "name": "browserai_service_bot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fc810f85-dccf-41fb-8b3a-f123c143f473",
      "name": "检查是否完成",
      "type": "n8n-nodes-base.switch",
      "position": [
        1168,
        16
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Finalized",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1b4446d7-395e-4cfb-891c-ddbae56d261a",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Get task\\'s metadata').item.json.status }}",
                    "rightValue": "=finalized"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "4cf9780e-4443-43d7-b997-5175c28673cc",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -176
      ],
      "parameters": {
        "color": 3,
        "width": 400,
        "height": 320,
        "content": "## 每天上午8点启动工作流并获取昨天日期"
      },
      "typeVersion": 1
    },
    {
      "id": "635b9388-5f25-4ddb-a70a-593d861b4cda",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -176
      ],
      "parameters": {
        "color": 5,
        "width": 320,
        "height": 320,
        "content": "## 创建BrowserAI任务"
      },
      "typeVersion": 1
    },
    {
      "id": "1ff8d5cf-59c5-49c6-99f4-6ed2c3fe157c",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        -176
      ],
      "parameters": {
        "color": 6,
        "width": 656,
        "height": 320,
        "content": "## 通过检查状态等待任务完成"
      },
      "typeVersion": 1
    },
    {
      "id": "df2251e5-a31a-488c-9f2e-48bafdbf1683",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1344,
        -176
      ],
      "parameters": {
        "width": 448,
        "height": 496,
        "content": "## 发送到您的邮箱/Telegram"
      },
      "typeVersion": 1
    },
    {
      "id": "524cded4-1535-4b0d-95fd-4e0e889113c9",
      "name": "等待BrowserAI状态变更",
      "type": "n8n-nodes-base.wait",
      "position": [
        944,
        -64
      ],
      "webhookId": "9f60957e-ebf3-426e-941d-db5d2af1bcf1",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "ad801781-736e-4b37-9716-b83caa5949ca",
      "name": "清理输出",
      "type": "n8n-nodes-base.code",
      "position": [
        1392,
        0
      ],
      "parameters": {
        "jsCode": "const inputText = $input.first().json.result\n\nconst cleanedText = inputText.replace(/\\*\\*Title:\\*\\*\\s*/g, '')\n    .replace(/\\*\\*Description:\\*\\*\\s*/g, '');\n\nreturn {\n    json: {\n        cleanedText: cleanedText\n    }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ef0259fb-26c9-4442-b8f5-9c540be030b7",
      "name": "发送邮件",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1616,
        176
      ],
      "webhookId": "f596fa00-538d-4046-9c89-263dbf211bf7",
      "parameters": {
        "text": "={{ $json.cleanedText }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "Your daily AI & LLM newsletter is here!",
        "toEmail": "to@example.com",
        "fromEmail": "from@example.com",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "id": "AIzq5LKIjc9gWeJh",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "pinData": {},
  "connections": {
    "Clean output": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get yesterday's date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if finished": {
      "main": [
        [
          {
            "node": "Clean output",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get task's metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a new task": {
      "main": [
        [
          {
            "node": "Get task's metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get task's metadata": {
      "main": [
        [
          {
            "node": "Wait for BrowserAI status change",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get yesterday's date": {
      "main": [
        [
          {
            "node": "Create a new task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for BrowserAI status change": {
      "main": [
        [
          {
            "node": "Check if finished",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - AI 摘要总结, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量13
分类2
节点类型8
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Alex Gurinovich

Alex Gurinovich

@alexg

Project Manager with a Computer Science background and extensive experience in QA and NOC. Passionate about driving innovation, streamlining processes, and leading projects and ideas to success.

外部链接
在 n8n.io 查看

分享此工作流