8
n8n 中文网amn8n.com

RSS源智能中心与每日Slack摘要

高级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 29 个节点。主要使用 Set, Code, Sort, Limit, Slack 等节点。 使用Gemini AI为RSS源自动化新闻智能,推送至Notion和Slack

前置要求
  • Slack Bot Token 或 Webhook URL
  • Notion API Key
  • Google Sheets API 凭证
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "L75BmalAEZZ1orS5",
  "meta": {
    "instanceId": "189dde98270e9ce0f006f0e9deb96aa5e627396fc6279cac8902c9b06936984d"
  },
  "name": "RSS源智能中心与每日Slack摘要",
  "tags": [],
  "nodes": [
    {
      "id": "b53e19f4-42d6-4433-be23-dee9d43d4c96",
      "name": "每日早晨触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1088,
        160
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "df28a219-fa77-408f-b842-1394c04bd8db",
      "name": "工作流配置",
      "type": "n8n-nodes-base.set",
      "position": [
        1408,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "rssFeeds",
              "type": "array",
              "value": "[\"https://techcrunch.com/feed/\"]"
            },
            {
              "id": "id-2",
              "name": "notionDatabaseId",
              "type": "string",
              "value": "296863ef60d880f28e32e8212b244d30"
            },
            {
              "id": "id-3",
              "name": "slackChannel",
              "type": "string",
              "value": "#general"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "7f7de5b9-dd1a-4a5a-9eb3-c85030a8bb59",
      "name": "读取RSS源",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        2016,
        64
      ],
      "parameters": {
        "url": "={{ $json.rssFeeds }}",
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "f6b25f54-0635-4498-b878-4468c633c932",
      "name": "AI摘要生成器和标签器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2256,
        64
      ],
      "parameters": {
        "text": "You are an expert content analyst.\nYour task is to analyze the provided RSS feed item based on the tag dictionary below.\n\nHere is the dictionary of available tags you MUST use:\n{{ JSON.stringify($('Aggregate Tags').first().json.tagDictionary) }}\n\n---\n\nNow, analyze the following RSS feed item:\nTitle: {{ $json.title }}\nContent: {{ $json.content }}\n\nBased on the content and the tag dictionary, create a 3-line summary and assign relevant tags.\nOutput a single, valid JSON object with these fields: \"title\", \"summary\" (max 3 lines), \"tags\" (array of strings), \"priority\" (integer 1-5, 5 is most important), \"url\", \"publishedDate\".\n\n**IMPORTANT: You MUST only output the JSON object itself. Do not include any explanatory text, markdown formatting (like ```json), or anything else before or after the JSON object.**",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "fb2fe89f-b551-47e0-a133-cb585c92a517",
      "name": "获取标签词典",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1712,
        256
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1dLUTeDxFv8zOeVXDB6_e05BsZBWrG_Ar-r4T8V0GacE/edit#gid=0",
          "cachedResultName": "Tags"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "1dLUTeDxFv8zOeVXDB6_e05BsZBWrG_Ar-r4T8V0GacE"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "92010737-ab4a-49de-a1ee-670759347865",
      "name": "解析AI输出",
      "type": "n8n-nodes-base.code",
      "position": [
        2624,
        64
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Parse AI agent output and extract relevant fields\nlet aiOutput = $input.item.json.output;\n\n// --- START: AI Output Cleaning ---\nconst jsonMatch = aiOutput.match(/\\{[\\s\\S]*\\}/);\nif (jsonMatch) {\n  aiOutput = jsonMatch[0];\n} else {\n  aiOutput = null; \n}\n// --- END: AI Output Cleaning ---\n\nlet parsedData;\ntry {\n  if (aiOutput === null) throw new Error(\"No valid JSON object found in AI output.\");\n  parsedData = JSON.parse(aiOutput);\n} catch (e) {\n  // Parsing failed, return data that won't cause a Notion API error\n  return { \n    title: 'Error: Failed to parse AI output', \n    summary: $input.item.json.output, // Keep original output for debugging\n    tags: [], \n    priority: 1, \n    url: null, \n    publishedDate: null \n  };\n}\n\n// === START: Notion Multi-Select Fix ===\nconst tagsArray = parsedData.tags || [];\n// === END: Notion Multi-Select Fix ===\n\n// === START: Robust Notion Date Fix ===\n// Ensure the publishedDate is a valid ISO string or null.\nlet notionDate = null;\nif (parsedData.publishedDate) {\n  const dateObject = new Date(parsedData.publishedDate);\n  \n  // Create a Date object and check if it's a valid date.\n  // isNaN(dateObject.getTime()) is a reliable way to check for \"Invalid Date\".\n  if (dateObject instanceof Date && !isNaN(dateObject.getTime())) {\n    notionDate = dateObject.toISOString();\n  } else {\n    // If the date string is invalid, notionDate remains null.\n    console.log(`Could not parse date: ${parsedData.publishedDate}`);\n  }\n}\n// === END: Robust Notion Date Fix ===\n\n\n// Extract the fields and create the final result object\nconst result = {\n  title: parsedData.title || '',\n  summary: parsedData.summary || '',\n  tags: tagsArray,\n  priority: parsedData.priority || 1,\n  url: parsedData.url || null,\n  publishedDate: notionDate \n};\n\nreturn result;"
      },
      "typeVersion": 2
    },
    {
      "id": "808a0b99-b2d7-4b4e-970a-c3f8e189e87c",
      "name": "写入Notion数据库",
      "type": "n8n-nodes-base.notion",
      "position": [
        2944,
        64
      ],
      "parameters": {
        "title": "={{ $json.title }}",
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.notionDatabaseId }}"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "summary|rich_text",
              "textContent": "={{ $json.summary }}"
            },
            {
              "key": "tags|multi_select",
              "multiSelectValue": "={{ $json.tags }}"
            },
            {
              "key": "priority|number",
              "numberValue": "={{ $json.priority }}"
            },
            {
              "key": "url|url",
              "urlValue": "={{ $json.url }}"
            },
            {
              "key": "publishedDate|date",
              "date": "={{ $json.publishedDate }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "970b77bd-6c52-43b8-800a-2d236d9a7cd3",
      "name": "按优先级排序",
      "type": "n8n-nodes-base.sort",
      "position": [
        3248,
        64
      ],
      "parameters": {
        "options": {},
        "sortFieldsUi": {
          "sortField": [
            {
              "order": "descending",
              "fieldName": "property_priority"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "075978c2-5ee8-453e-a75e-0fb7708889a2",
      "name": "头条前三",
      "type": "n8n-nodes-base.limit",
      "position": [
        3568,
        64
      ],
      "parameters": {
        "maxItems": 3
      },
      "typeVersion": 1
    },
    {
      "id": "643c4d99-f909-4287-ab22-203526c96c02",
      "name": "格式化Slack消息",
      "type": "n8n-nodes-base.code",
      "position": [
        3872,
        64
      ],
      "parameters": {
        "jsCode": "// Format top 3 items into a Slack message\nconst items = $input.all();\n\n// Slackの改行には \\\\n ではなく \\n を使います\nlet message = \"*📰 Your Daily Top 3 Headlines*\\n\\n\";\n\nfor (let i = 0; i < items.length; i++) {\n  const item = items[i].json;\n  const number = i + 1;\n  \n  // Notionノードからのデータ名に合わせてプロパティを取得\n  const title = item.name || 'No Title';\n  const summary = item.property_summary || 'No summary available';\n  const tags = item.property_tags || [];\n  const url = item.property_url;\n  \n  message += `*${number}. ${title}*\\n`;\n  message += `${summary}\\n`;\n  \n  // タグの表示部分も修正\n  if (tags.length > 0) {\n    const tagNames = tags.map(tag => tag.name); // タグ名を取得\n    message += `🏷️ Tags: ${tagNames.join(', ')}\\n`;\n  }\n  \n  if (url) {\n    message += `🔗 <${url}|Read more>\\n`;\n  }\n  \n  // 各項目の間にスペースを入れます\n  message += \"\\n\";\n}\n\nreturn [{ json: { message } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "4b73b33f-b7b8-4305-9f96-afecab761db2",
      "name": "发布到 Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        4176,
        64
      ],
      "webhookId": "2163c2fa-5df4-4765-b317-c349cefc528e",
      "parameters": {
        "text": "={{ $json.message }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.slackChannel }}"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2.3
    },
    {
      "id": "2b77e4b0-f37e-4d05-a4c9-4b6f4015ef1e",
      "name": "JavaScript 代码",
      "type": "n8n-nodes-base.code",
      "position": [
        1712,
        64
      ],
      "parameters": {
        "jsCode": "const rssFeedsArray = $input.item.json.rssFeeds;\nconst outputItems = [];\n\nfor (const feedUrl of rssFeedsArray) {\n  outputItems.push({ \n    json: { \n      rssFeeds: feedUrl \n    } \n  });\n}\n\nreturn outputItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "cb8efc38-c306-4c35-ae0e-230a28686529",
      "name": "聚合标签",
      "type": "n8n-nodes-base.code",
      "position": [
        2016,
        256
      ],
      "parameters": {
        "jsCode": "// Googleシートの全行を受け取り、'tagDictionary'という一つのリストにまとめます。\nconst allTags = $input.all().map(item => item.json);\n\n// ワークフローの後続ノードが使いやすいように、一つのアイテムとして出力します。\nreturn [{ json: { tagDictionary: allTags } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "335c2541-e71d-4992-afd2-1262aa810ae2",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        2240,
        256
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash-lite"
      },
      "typeVersion": 1
    },
    {
      "id": "e4c64295-aad1-4a04-a328-9fd9a1d51614",
      "name": "注意:每日早晨触发器",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        -144
      ],
      "parameters": {
        "color": "white",
        "height": 176,
        "content": "**用途:** 每天早晨启动工作流。"
      },
      "typeVersion": 1
    },
    {
      "id": "51d8fc1b-5195-42cb-85b7-6d1d00a4829d",
      "name": "注意:工作流配置",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1344,
        -144
      ],
      "parameters": {
        "color": "white",
        "height": 176,
        "content": "**用途:** 中央配置中心。"
      },
      "typeVersion": 1
    },
    {
      "id": "37dfe9c2-c412-454b-8aa5-ed580d2c88dc",
      "name": "注意:JavaScript代码",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1648,
        -144
      ],
      "parameters": {
        "color": "white",
        "height": 176,
        "content": "**用途:** 将`rssFeeds`数组拆分为每个源URL一个项目。"
      },
      "typeVersion": 1
    },
    {
      "id": "24192a09-f208-4eaa-837e-00ccece1d873",
      "name": "注意:读取RSS源",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        -144
      ],
      "parameters": {
        "color": "white",
        "height": 176,
        "content": "**用途:** 获取每个源URL的文章。"
      },
      "typeVersion": 1
    },
    {
      "id": "21304a64-1034-44ba-97c8-f4040d074fc4",
      "name": "注意:获取标签词典",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1648,
        416
      ],
      "parameters": {
        "color": "white",
        "content": "**用途:** 从Google Sheets加载标签词典。"
      },
      "typeVersion": 1
    },
    {
      "id": "ccd7838e-b26f-4e95-ab9f-4c3deb157c94",
      "name": "注意:聚合标签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        416
      ],
      "parameters": {
        "color": "white",
        "content": "**用途:** 将所有表格行合并为`tagDictionary`(单个项目)。"
      },
      "typeVersion": 1
    },
    {
      "id": "7f6c10fb-10ad-4f39-90a7-713af4b676a6",
      "name": "注意:Google Gemini聊天模型",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2256,
        416
      ],
      "parameters": {
        "color": "white",
        "content": "**用途:** 为AI代理提供LLM运行时。"
      },
      "typeVersion": 1
    },
    {
      "id": "32def482-d498-47a1-8905-6b7ec2629307",
      "name": "注意:AI摘要生成器和标签器",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2256,
        -144
      ],
      "parameters": {
        "color": "white",
        "height": 176,
        "content": "**用途:** 生成严格的JSON有效载荷:标题、摘要(≤3行)、标签[]、优先级(1–5)、URL、发布日期。"
      },
      "typeVersion": 1
    },
    {
      "id": "be9475cf-e641-4b92-9845-84b71cda8c6d",
      "name": "注意:解析AI输出",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2560,
        -144
      ],
      "parameters": {
        "color": "white",
        "height": 176,
        "content": "**用途:** 验证并规范化AI JSON。"
      },
      "typeVersion": 1
    },
    {
      "id": "e985e8c7-c9ea-4e3b-b568-a6e3105980d4",
      "name": "注意:写入Notion数据库",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2864,
        -144
      ],
      "parameters": {
        "color": "white",
        "width": 256,
        "height": 176,
        "content": "**用途:** 为每个项目创建Notion页面。"
      },
      "typeVersion": 1
    },
    {
      "id": "deb714fc-9818-48a1-a6b4-dd3dacc4414e",
      "name": "注意:按优先级排序",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3184,
        -144
      ],
      "parameters": {
        "color": "white",
        "height": 176,
        "content": "**用途:** 按`priority`(降序)排序项目。"
      },
      "typeVersion": 1
    },
    {
      "id": "8817c32a-ed51-4086-b7a8-75f1c81f05ef",
      "name": "注意:头条前三",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3488,
        -144
      ],
      "parameters": {
        "color": "white",
        "height": 176,
        "content": "**用途:** 将项目限制为前三个,以保持Slack摘要简洁。"
      },
      "typeVersion": 1
    },
    {
      "id": "c5cbb7ef-b3c3-416a-9bc1-47852f1edaa5",
      "name": "注意:格式化Slack消息",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3792,
        -144
      ],
      "parameters": {
        "color": "white",
        "height": 176,
        "content": "**用途:** 构建可读的Slack摘要。"
      },
      "typeVersion": 1
    },
    {
      "id": "f7ee2819-01f5-4150-9c5a-33c22d000066",
      "name": "注意:发布到Slack",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4096,
        -144
      ],
      "parameters": {
        "color": "white",
        "height": 176,
        "content": "**用途:** 将摘要发送到您的频道。"
      },
      "typeVersion": 1
    },
    {
      "id": "a1b407c5-4e5a-4cff-9e19-b7d0d131b893",
      "name": "模板概览",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -384
      ],
      "parameters": {
        "color": "yellow",
        "width": 608,
        "height": 688,
        "content": "## RSS源智能中心与每日Slack摘要"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fab6bf45-898d-47e3-a790-add5ccd6767d",
  "connections": {
    "Read RSS Feeds": {
      "main": [
        [
          {
            "node": "AI Summarizer and Tagger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Output": {
      "main": [
        [
          {
            "node": "Write to Notion Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Top 3 Headlines": {
      "main": [
        [
          {
            "node": "Format Slack Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort by Priority": {
      "main": [
        [
          {
            "node": "Top 3 Headlines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Read RSS Feeds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Tag Dictionary": {
      "main": [
        [
          {
            "node": "Aggregate Tags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Slack Message": {
      "main": [
        [
          {
            "node": "Post to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Morning Trigger": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Get Tag Dictionary",
            "type": "main",
            "index": 0
          },
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Summarizer and Tagger": {
      "main": [
        [
          {
            "node": "Parse AI Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Summarizer and Tagger",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Write to Notion Database": {
      "main": [
        [
          {
            "node": "Sort by Priority",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 市场调研, AI 摘要总结

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流