8
n8n 中文网amn8n.com

我的工作流 6

高级

这是一个Multimodal AI领域的自动化工作流,包含 16 个节点。主要使用 Code, Merge, Telegram, RssFeedRead, Agent 等节点。 使用RSS源和GPT-4的自动化加密新闻摘要发送到Telegram

前置要求
  • Telegram Bot Token
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "76756538d0e97eaf241d3d1243f7a3d2310b1d99252889d76c80d005e2ba5e9c",
    "templateCredsSetupCompleted": true
  },
  "name": "我的工作流 6",
  "tags": [],
  "nodes": [
    {
      "id": "2a4065e4-81e6-45c8-984c-605d3a7a3752",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        368
      ],
      "parameters": {
        "color": 7,
        "width": 736,
        "height": 608,
        "content": "## 描述"
      },
      "typeVersion": 1
    },
    {
      "id": "7454b626-f2d4-448e-bc80-84d01717e9db",
      "name": "Coindesk",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        1632,
        416
      ],
      "parameters": {
        "url": "https://www.coindesk.com/arc/outboundfeeds/rss/",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "e922b90e-b969-43ee-a720-024ad530f30d",
      "name": "Cointelegraph",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        1632,
        624
      ],
      "parameters": {
        "url": "https://cointelegraph.com/rss",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "233d8fd9-0668-4065-bee7-43c54ddc2088",
      "name": "Decrypt",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        1632,
        784
      ],
      "parameters": {
        "url": "https://decrypt.co/feed",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "6af71edd-7cfc-4248-a74a-64dcedd5bc41",
      "name": "Cryptobriefing",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        1632,
        960
      ],
      "parameters": {
        "url": "https://cryptobriefing.com/feed/",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "6df51a25-e8c1-487b-936d-ef581fdc1145",
      "name": "Nulltx",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        1632,
        256
      ],
      "parameters": {
        "url": "https://nulltx.com/feed/",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "5b8057b3-0a26-4d36-b4b1-c0e70e70a932",
      "name": "调度器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1440,
        608
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 3
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "7bf1189a-5ca2-4df1-9ead-065844d703d0",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1808,
        576
      ],
      "parameters": {
        "numberInputs": 5
      },
      "typeVersion": 3.2
    },
    {
      "id": "09d762cf-11ef-4da0-9d33-96209c75b5e7",
      "name": "新闻过滤器和排序器",
      "type": "n8n-nodes-base.code",
      "position": [
        1936,
        624
      ],
      "parameters": {
        "jsCode": "// Фильтрация и дедупликация новостей\nconst items = $input.all();\nconst now = new Date();\nconst yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);\n\n// Убираем дубликаты и фильтруем по времени\nconst uniqueNews = [];\nconst seenUrls = new Set();\n\nfor (const item of items) {\n  const data = item.json;\n  \n  // Проверяем дату публикации\n  const pubDate = new Date(data.pubDate || data.isoDate);\n  if (pubDate < yesterday) continue;\n  \n  // Проверяем на дубликаты\n  if (seenUrls.has(data.link)) continue;\n  seenUrls.add(data.link);\n  \n  // Берем все доступные поля контента\n  const rssContent = data['content:encodedSnippet'] || data.content || data.contentSnippet || data.summary || '';\n  \n  // Очищаем RSS контент от HTML\n  const cleanRssContent = rssContent\n    .replace(/<[^>]*>/g, '')\n    .replace(/&[^;]+;/g, '')\n    .replace(/\\s+/g, ' ')\n    .trim();\n  \n  // Создаем новый объект, теперь с сохранением contentSnippet\n  uniqueNews.push({\n    title: data.title,\n    link: data.link,\n    rssContent: cleanRssContent,\n    contentSnippet: data.contentSnippet, // Сохраняем оригинальный contentSnippet\n    pubDate: data.pubDate,\n    source: data['dc:creator'] || data.meta?.title || 'Unknown',\n    guid: data.guid\n  });\n}\n\nconsole.log(`Filtered ${uniqueNews.length} unique news from ${items.length} total`);\n\nreturn uniqueNews.map(item => ({ json: item }));"
      },
      "typeVersion": 2
    },
    {
      "id": "740a3cd2-1919-442c-9f19-0968206d60a4",
      "name": "新闻格式化器",
      "type": "n8n-nodes-base.code",
      "position": [
        2080,
        624
      ],
      "parameters": {
        "jsCode": "// 1. Получаем все входящие элементы в виде массива\nconst allItems = $input.all();\n\n// 2. Из каждого элемента забираем только его 'json' часть (саму новость)\n// и складываем в новый массив.\nconst newsArray = allItems.map(item => item.json);\n\n// 3. Возвращаем ОДИН-ЕДИНСТВЕННЫЙ новый элемент.\n// У этого элемента будет поле 'data', которое содержит массив всех новостей.\n// Имя 'data' важно, так как оно используется в промте: {{$json.data}}\nreturn [{\n  json: {\n    data: newsArray\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "68236c5d-4344-4653-a135-e126f3133405",
      "name": "SMM 编辑器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2256,
        560
      ],
      "parameters": {
        "text": "=You are an SMM editor and the author of a leading Telegram channel about AI. Your task is to create an engaging, stylish, and easy-to-read digest using exclusively HTML tags compatible with Telegram.\n\n**MAIN RULE: It is STRICTLY FORBIDDEN to use any Markdown formatting (symbols , _, , []()). All formatting, especially bold text, must ONLY be done with the HTML <b>` tag. This is the most important rule.\n\nOther rules:\n\nProcess each news item: Go through every object in the provided JSON array sequentially.\n\nDetailed summary with highlights: Write a meaningful summary of 3–5 sentences. Within this text, highlight the <b>key concept of the news</b> — usually the product name, technology, or main announcement. Try to highlight the phrase at the beginning of the text.\n\nFlawless HTML formatting:\n\nThe news headline (from the title field) must be translated into Russian and made bold and underlined, wrapped in <b> and <u> tags.\n\nThe publication date (pubDate) should be formatted as “DD month YYYY, HH:MM” and wrapped in a <code> tag.\n\nThe source link (link) must be formatted as an HTML hyperlink <a href=\"URL\">Read more</a>.\n\nStructure and separators:\n\nDisplay the news items as a numbered list.\n\nSeparate each news item in the list clearly with two line breaks (\\n\\n).\n\nStrictly follow the example structure.\n\nExample structure for ONE news item:\n\n📰 <b><u>[Here the headline translated into Russian]</u></b>\n📝 [Here is a detailed Russian summary where the <b>key phrase of the news</b> is highlighted in bold.]\n📅 <code>28 July 2025, 15:29</code>\n🔗 <a href=\"https://example.com/news-article-url\">Read more</a>\n\nAt the end of each news block, add a line with hashtags that reflect the key concepts of the news. Use tags without spaces and punctuation, always starting with #. Always include a universal tag such as #CryptoDigest to brand the digest.\n\nInput data (news array):\n{{ $json.output }}",
        "options": {},
        "promptType": "define"
      },
      "retryOnFail": true,
      "typeVersion": 2.1,
      "alwaysOutputData": false
    },
    {
      "id": "88e0548e-f9d2-4c45-8ce2-3bd54d54a058",
      "name": "加密货币分析师",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2256,
        784
      ],
      "parameters": {
        "text": "=You are a senior analyst at a leading crypto and blockchain media outlet (such as CoinDesk or The Block). Your specialization is identifying the most significant and influential events in the world of crypto and blockchain technologies.\n\nYour task is to analyze the provided array of news articles and identify the 10 most important events or topics of the day. For each of the 10 selected events, you must choose the single best and most informative article that covers it.\n\nStrictly follow this process:\n\nAnalysis: Read all articles to compile a complete list of unique events and topics of the day.\n\nEvaluation: Assess the importance of each event using the criteria below.\n\nSelection: Choose the 10 most important events.\n\nBest article choice: For each of the 10 events, if it is covered by multiple articles, select the one that is the most comprehensive and comes from the most authoritative source.\n\nCriteria for evaluating importance (in order of priority):\n\nFinance and Business:\n\nMajor deals, mergers and acquisitions (M&A) in the crypto industry.\n\nLarge funding rounds for crypto startups (especially over $20M).\n\nStrategic partnerships and contracts with major market players.\n\nProducts and Technology:\n\nLaunch of breakthrough blockchain protocols, cryptocurrencies, DeFi platforms, or NFT projects.\n\nImportant network and protocol updates affecting scalability, security, or functionality.\n\nSignificant changes in APIs, limits, or operational rules of major crypto services.\n\nPolicy and Regulation:\n\nNews about new government laws, regulations, or sanctions directly impacting the crypto market and blockchain technologies.\n\nScientific and Technical Breakthroughs:\n\nPublication of research or new technological solutions that set a new standard in the crypto industry.\n\nOutput format:\nYour answer must be ONLY a valid JSON array containing the full objects of the 10 selected news items (one per event). Do not add any explanations, comments, or text before or after the JSON array.\n\nInput data (news array):\n{{ JSON.stringify($json.data, null, 2) }}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "146e66bf-9197-431d-83c5-bd29f7d2df5a",
      "name": "新闻准备器",
      "type": "n8n-nodes-base.code",
      "position": [
        2544,
        528
      ],
      "parameters": {
        "jsCode": "// Получаем длинный текст из предыдущего узла (AI-агента)\nconst longText = $json.output;\n\n// Устанавливаем максимальную длину сообщения в Telegram\nconst maxLength = 4096;\n\n// Место, где мы будем хранить готовые куски сообщения\nconst chunks = [];\n\nlet remainingText = longText;\n\n// Запускаем цикл, который будет работать, пока не \"нарежем\" весь текст\nwhile (remainingText.length > 0) {\n  // Если оставшийся текст уже помещается в одно сообщение, просто добавляем его и выходим\n  if (remainingText.length <= maxLength) {\n    chunks.push(remainingText);\n    break;\n  }\n\n  // Если текст слишком длинный, ищем последнее \"красивое\" место для разрыва\n  // (двойной перенос строки) в пределах лимита\n  let splitAt = remainingText.lastIndexOf('\\n\\n', maxLength);\n\n  // Если не нашли двойного переноса (например, одна новость сама по себе > 4096 символов),\n  // то просто ищем последний перенос строки\n  if (splitAt === -1) {\n    splitAt = remainingText.lastIndexOf('\\n', maxLength);\n  }\n  \n  // Если даже обычного переноса не нашли, режем \"по живому\", чтобы избежать бесконечного цикла\n  if (splitAt === -1) {\n      splitAt = maxLength;\n  }\n\n  // \"Откусываем\" кусок и добавляем его в наш массив\n  chunks.push(remainingText.substring(0, splitAt));\n  \n  // Обновляем оставшийся текст\n  remainingText = remainingText.substring(splitAt).trim();\n}\n\n// На выходе мы получаем массив из нескольких элементов,\n// каждый из которых содержит кусок текста для отправки.\n// Мы должны вернуть их в формате, который n8n сможет обработать по одному.\nreturn chunks.map(chunk => ({\n  json: {\n    // Узел Telegram по умолчанию ищет текст в поле 'text'.\n    // Мы сразу кладем наш кусок в это поле.\n    text: chunk\n  }\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "efce0382-d1ce-4feb-bc63-56d2cb9037b6",
      "name": "发布到群组",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2720,
        528
      ],
      "webhookId": "4006def9-f960-4fb1-a30e-d5f0f7302f5a",
      "parameters": {
        "text": "={{ $json.text }}",
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "additionalFields": {
          "parse_mode": "HTML",
          "appendAttribution": false
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7dee3286-3bff-493d-8dbe-f251a861d107",
      "name": "GPT",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1920,
        448
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "RTqRt3IxjOB1wgBx",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d802a3bf-9a66-4e28-9e29-63b6596a6ed9",
      "name": "GPT 2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2064,
        448
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "RTqRt3IxjOB1wgBx",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "GPT": {
      "ai_languageModel": [
        [
          {
            "node": "Crypto Analyst",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "GPT 2": {
      "ai_languageModel": [
        [
          {
            "node": "SMM Editor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "News Filter & Sorter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nulltx": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decrypt": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Coindesk": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scheduler": {
      "main": [
        [
          {
            "node": "Coindesk",
            "type": "main",
            "index": 0
          },
          {
            "node": "Cointelegraph",
            "type": "main",
            "index": 0
          },
          {
            "node": "Decrypt",
            "type": "main",
            "index": 0
          },
          {
            "node": "Cryptobriefing",
            "type": "main",
            "index": 0
          },
          {
            "node": "Nulltx",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SMM Editor": {
      "main": [
        [
          {
            "node": "News Preparer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cointelegraph": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "News Preparer": {
      "main": [
        [
          {
            "node": "Post to Group",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Crypto Analyst": {
      "main": [
        [
          {
            "node": "SMM Editor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cryptobriefing": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "News Formatter": {
      "main": [
        [
          {
            "node": "Crypto Analyst",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "News Filter & Sorter": {
      "main": [
        [
          {
            "node": "News Formatter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量16
分类1
节点类型8
难度说明

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

作者
Ivan Maksiuta

Ivan Maksiuta

@zodiac

I build production-ready n8n templates—Telegram dashboards, Airtop browser automation, and AI recruiting flows—scalable, compliant, and easy to ship.

外部链接
在 n8n.io 查看

分享此工作流