8
n8n 中文网amn8n.com

将社交媒体内容聚合自动化到Telegram频道

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 30 个节点。主要使用 If, Code, Wait, Telegram, HttpRequest 等节点。 使用Google Gemini AI将Twitter/X内容聚合到Telegram频道

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "Qsx3VDr6JAHBYiU1",
  "meta": {
    "instanceId": "e2a1d0ec98fd0994972a016020dcf90b56d31fa85f2abd02801701fb8fc45e3d",
    "templateCredsSetupCompleted": true
  },
  "name": "将社交媒体内容聚合自动化到 Telegram 频道",
  "tags": [],
  "nodes": [
    {
      "id": "51ad1db1-1268-43f2-af87-49784184b19e",
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        -1056,
        80
      ],
      "parameters": {
        "url": "https://api.browseract.com/v2/workflow/run-task",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "workflow_id",
              "value": "52606771064261730"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "x2SDklVkEIBFM56U",
          "name": "BrowserACtaPi"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "eb445058-6561-4cdd-aeb6-86b1cea7caac",
      "name": "HTTP请求1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -576,
        64
      ],
      "parameters": {
        "url": "https://api.browseract.com/v2/workflow/get-task",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "=task_id",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "x2SDklVkEIBFM56U",
          "name": "BrowserACtaPi"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e3a8baef-33a5-4b36-a0ac-f393077dfba9",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        -320,
        336
      ],
      "webhookId": "ef2a567b-c3a0-4e8f-a90a-011906991d48",
      "parameters": {
        "unit": "minutes",
        "amount": 1
      },
      "typeVersion": 1.1
    },
    {
      "id": "d7afdc55-375d-42f6-aec1-d5ed4073fd86",
      "name": "等待1",
      "type": "n8n-nodes-base.wait",
      "position": [
        -864,
        336
      ],
      "webhookId": "a2237c54-9346-40e7-b622-0c50db1b379c",
      "parameters": {
        "amount": 20
      },
      "typeVersion": 1.1
    },
    {
      "id": "4f1ec379-162b-4d77-bdb5-e4bcdca86935",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        -864,
        80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d48ae258-78a0-4b26-923d-2643b6b774c6",
              "operator": {
                "type": "object",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": ""
            },
            {
              "id": "3967a169-8432-45bd-8f89-08795fd12679",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": "null"
            }
          ]
        }
      },
      "retryOnFail": false,
      "typeVersion": 2.2
    },
    {
      "id": "a50bbd98-fbb7-4bab-bd52-b03c9c12c7b5",
      "name": "条件判断1",
      "type": "n8n-nodes-base.if",
      "position": [
        -304,
        64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0347a2a2-eb32-414d-9494-4e648078cf40",
              "operator": {
                "type": "object",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": ""
            },
            {
              "id": "99f31959-6f27-40dd-97c3-6ff611da1e0b",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "finished"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "641e6deb-f68f-48ad-99e5-382d0b36df95",
      "name": "发送文本消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        464,
        112
      ],
      "webhookId": "c9d760eb-3c1a-4fc6-8ee7-da0e26ac27fe",
      "parameters": {
        "text": "={{ $json.Title }}\n{{ $json.Summary }}\n\nBY: {{ $json.PublishedBy }}\n{{ $json.Url }}",
        "chatId": "@Test",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "34LCOs7mfDx5vkSV",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a53dc2cd-7ed0-478a-a610-bca789143af5",
      "name": "JavaScript 代码",
      "type": "n8n-nodes-base.code",
      "position": [
        -64,
        400
      ],
      "parameters": {
        "jsCode": "// This function will iterate through your data and reformat it\n// into a list of single-item lists.\nconst refinedOutput = $input.first().json.output.refined_output\nconst processedItems = [];\n\nfor (const item of refinedOutput) {\n  // Create a new item object with a 'json' key\n  // that holds the object directly.\n  const newItem = {\n    json: item,\n  };\n  processedItems.push(newItem);\n}\n\n// Return the new list of items\nreturn processedItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "61a053ae-cd55-43b2-9b08-53171f39c37c",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "maxTries": 2,
      "position": [
        -64,
        48
      ],
      "parameters": {
        "text": "=in the\n\n{{ $json.output.string }}\n\nlist of maps available like the example below\n\n\n[\n {    \n \"Title\": \".............\",  \n \"PublishedBy\": \"............\",  \n \"Summary\": \".............\",  \n \"Url\": \".............\",\n\"Pic\" : \".............\"\n}\n]  \n\nRefine the output for each items in the list, Summarize the 'Summary' if needed and remove all duplicated data.\n\n\"refined_output\" : \n  {\n    \"Title\": <String>,\n    \"PublishedBy\":  <String>,\n    \"Summary\":  <String>,\n    \"Url\" : <String>,\n    \"Pic\" : <String>\n  }\n\nadd each one separately as an item \n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "retryOnFail": true,
      "typeVersion": 2.2,
      "waitBetweenTries": 1500
    },
    {
      "id": "ce1fbc09-7156-4a7d-b88c-1c1bb881d12a",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        96,
        256
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"refined_output\": \n  [\n    {\n    \"Title\": \"<String>\",\n    \"PublishedBy\": \"<String>\",\n    \"Summary\": \"<String>\",\n    \"Url\": \"<String>\",\n    \"Pic\": \"<String>\"\n  }\n  ]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "55d8a924-c02d-4d5e-893f-094587a8b1a7",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -64,
        256
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "G8YK0DTLFGi5n0WD",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c582cfc7-66c7-46da-918f-6758014b8587",
      "name": "如果2",
      "type": "n8n-nodes-base.if",
      "position": [
        128,
        400
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "df1ae316-b51d-4f5a-959a-bea374087a9b",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.Pic }}",
              "rightValue": "=no picture"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e63901a7-2e00-4467-8191-a6e529d9ef90",
      "name": "发送图片消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        464,
        336
      ],
      "webhookId": "5cd5b005-17d2-4fd1-a61c-3f90c54cf2d7",
      "parameters": {
        "file": "={{ $json.Pic }}",
        "chatId": "@Test",
        "operation": "sendPhoto",
        "additionalFields": {
          "caption": "={{ $json.Title }} \n\n{{ $json.Summary }} \n\nBY: {{ $json.PublishedBy }}\n\n{{ $json.Url }}"
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "34LCOs7mfDx5vkSV",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "85e66f7d-b04c-494a-a80c-3d54522b8aaa",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1312,
        80
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 12
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2170f06f-24de-455c-8f2a-bbd3310a72d0",
      "name": "便签-介绍",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        -128
      ],
      "parameters": {
        "width": 592,
        "height": 408,
        "content": "## 立即试用!"
      },
      "typeVersion": 1
    },
    {
      "id": "80c1e1b8-cb9b-42c4-8509-81106db60295",
      "name": "便签-抓取",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -128
      ],
      "parameters": {
        "color": 5,
        "width": 480,
        "height": 164,
        "content": "## 1. 触发任务抓取器"
      },
      "typeVersion": 1
    },
    {
      "id": "341dd9f1-bde8-4fc8-9fd9-39dc60107eef",
      "name": "便签-等待",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -128
      ],
      "parameters": {
        "color": 5,
        "width": 512,
        "height": 164,
        "content": "## 2. 等待抓取完成"
      },
      "typeVersion": 1
    },
    {
      "id": "81b9fbd7-33fc-4563-8a1f-e3a4fc939cb2",
      "name": "便签-AI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -128
      ],
      "parameters": {
        "color": 4,
        "width": 448,
        "content": "## 3. 使用 AI 优化内容"
      },
      "typeVersion": 1
    },
    {
      "id": "f861965c-7e8c-4008-b6ea-6aa310d0b813",
      "name": "便签-条件发送",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -128
      ],
      "parameters": {
        "color": 3,
        "width": 352,
        "height": 196,
        "content": "## 4. 发送到 Telegram"
      },
      "typeVersion": 1
    },
    {
      "id": "1f370ea2-d0fd-4442-baa8-ae101cd9e5f7",
      "name": "便签-如何使用",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        288
      ],
      "parameters": {
        "width": 592,
        "height": 168,
        "content": "## 使用方法"
      },
      "typeVersion": 1
    },
    {
      "id": "323127a9-6e88-41a6-8529-b43cc44b009a",
      "name": "便签-帮助",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        464
      ],
      "parameters": {
        "width": 592,
        "height": 96,
        "content": "## 需要帮助?"
      },
      "typeVersion": 1
    },
    {
      "id": "b78bcd09-88bc-4dd9-8ef1-32d3e247a6e1",
      "name": "便签-视频",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        576
      ],
      "parameters": {
        "width": 592,
        "height": 80,
        "content": "## 观看工作流指导和展示"
      },
      "typeVersion": 1
    },
    {
      "id": "f59c80ea-db18-4f18-b623-f4f0fe156c69",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        48
      ],
      "parameters": {
        "color": 5,
        "width": 480,
        "height": 480,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c8d84675-275a-4838-961c-9701f8a3a7cb",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        48
      ],
      "parameters": {
        "color": 5,
        "width": 512,
        "height": 480,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "807e290e-0b2e-4e75-b91d-e4b7ab77cb9e",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        48
      ],
      "parameters": {
        "color": 4,
        "width": 448,
        "height": 480,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a821fb85-990c-4a4c-9329-808dff71b184",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        80
      ],
      "parameters": {
        "color": 3,
        "width": 352,
        "height": 448,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "94468263-32d0-49c2-b805-61f8a0c1b7cb",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        -240
      ],
      "parameters": {
        "color": 5,
        "width": 182,
        "height": 80,
        "content": "##"
      },
      "typeVersion": 1
    },
    {
      "id": "3116f3bc-dd38-4a46-b62e-713150332933",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -240
      ],
      "parameters": {
        "color": 5,
        "width": 182,
        "height": 80,
        "content": "##"
      },
      "typeVersion": 1
    },
    {
      "id": "0c84785c-6e66-47d1-b307-9198ccbc85a4",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        -240
      ],
      "parameters": {
        "color": 4,
        "width": 230,
        "height": 80,
        "content": "##"
      },
      "typeVersion": 1
    },
    {
      "id": "ec102a87-733d-4e22-8a08-154d53552139",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -240
      ],
      "parameters": {
        "color": 3,
        "width": 214,
        "height": 80,
        "content": "##"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "63f14756-172c-40d7-9efc-8ef6737214ca",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If2": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a photo message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini 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
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 内容创作, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量30
分类2
节点类型10
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Madame AI Team | Kai

Madame AI Team | Kai

@madame-ai

I’m a PhD in Physics turned AI enthusiast, passionate about uncovering how AI is transforming content creation, business, and daily life.

外部链接
在 n8n.io 查看

分享此工作流