8
n8n 中文网amn8n.com

将来自订阅源的新文章发布到Slack频道

中级

这是一个AI领域的自动化工作流,包含 8 个节点。主要使用 Code, Cron, Slack, RssFeedRead, GoogleSheets 等节点,结合人工智能技术实现智能自动化。 将来自订阅源的新文章发布到Slack频道

前置要求
  • Slack Bot Token 或 Webhook URL
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "G452NfcbwAErVDRu",
  "meta": {
    "instanceId": "05cd306a73f97150c796adf49d28dcc97084b722b0b212b8c228ea8b71d87571",
    "templateCredsSetupCompleted": true
  },
  "name": "将来自订阅源的新文章发布到 Slack 频道",
  "tags": [
    {
      "id": "HKMgMooCXhG1RvQ4",
      "name": "RSS",
      "createdAt": "2025-06-25T20:39:25.066Z",
      "updatedAt": "2025-06-25T20:39:25.066Z"
    },
    {
      "id": "LrtcE3ptvaKdYplW",
      "name": "Slack",
      "createdAt": "2025-06-25T20:39:34.824Z",
      "updatedAt": "2025-06-25T20:39:34.824Z"
    },
    {
      "id": "msIodL6e7sVaa5aZ",
      "name": "Google Sheets",
      "createdAt": "2025-06-25T20:39:20.673Z",
      "updatedAt": "2025-06-25T20:39:20.673Z"
    },
    {
      "id": "mv8twTYqHvotykOz",
      "name": "Filter",
      "createdAt": "2025-06-25T20:39:31.349Z",
      "updatedAt": "2025-06-25T20:39:31.349Z"
    }
  ],
  "nodes": [
    {
      "id": "5555a9ce-26d1-45a3-9672-5f54b0cf28a3",
      "name": "筛选未发布文章",
      "type": "n8n-nodes-base.code",
      "notes": "Filter previously published articles from those received from the feeds.",
      "position": [
        -460,
        -340
      ],
      "parameters": {
        "jsCode": "const sheetLinks = $('Get Historically Posted Articles from Google Sheet').all().map(row => row.json.link);\nconst articles = $('Read Latest Articles from Feeds').all();\nreturn articles.filter(item => !sheetLinks.includes(item.json.link));              "
      },
      "notesInFlow": true,
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "235db786-a37c-4f70-9fb8-a23903399056",
      "name": "触发工作流",
      "type": "n8n-nodes-base.cron",
      "notes": "cron-based Workflow trigger. Recommend once per day.",
      "position": [
        -1340,
        -340
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 7
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "195bea58-205a-4d30-bab0-ef137b157ab5",
      "name": "将新文章发布到 Slack 频道",
      "type": "n8n-nodes-base.slack",
      "notes": "Post new articles to Slack Channel.",
      "position": [
        -20,
        -340
      ],
      "webhookId": "637dea4d-c4e0-4369-93bb-f98268950d65",
      "parameters": {
        "text": "=*{{$json[\"title\"]}}* | {{$json[\"link\"]}} _Published: {{$json[\"pubDate\"]}}_",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C09281Y80AH",
          "cachedResultName": "daily-industry-news-automation"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "notesInFlow": true,
      "typeVersion": 2.3
    },
    {
      "id": "e1ea7e51-5f0f-4089-a4c0-9308bc72c85a",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2340,
        -420
      ],
      "parameters": {
        "width": 900,
        "height": 1380,
        "content": "# 📄 将来自订阅源的新文章发布到 Slack 频道"
      },
      "typeVersion": 1
    },
    {
      "id": "146f4c93-a72c-4356-99ab-bcbc7747e671",
      "name": "获取文章订阅源",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Get a list of RSS feeds to poll from the Feeds Google Sheet (title, link).",
      "position": [
        -1120,
        -340
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1768028583,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HIldK5vDx2luvmYEstU2PQzSS68xBrpp7lJ-8rQb2No/edit#gid=1768028583",
          "cachedResultName": "Feeds"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{$vars.Daily_Industry_News_Automation_Google_Sheet}}"
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.6,
      "alwaysOutputData": true
    },
    {
      "id": "3a2f3d00-333f-477f-8634-1b3c703d4061",
      "name": "从订阅源读取最新文章",
      "type": "n8n-nodes-base.rssFeedRead",
      "notes": "Get articles from each feed in Google Sheet.",
      "position": [
        -900,
        -340
      ],
      "parameters": {
        "url": "={{ $json.link }}",
        "options": {}
      },
      "notesInFlow": true,
      "typeVersion": 1.2,
      "alwaysOutputData": true
    },
    {
      "id": "74fec81d-bd50-4cce-87d5-fa6808658581",
      "name": "从 Google Sheet 获取历史发布文章",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Get a list of articles previously posted from Posted Articles Google Sheet (title, link, pubDate).",
      "position": [
        -680,
        -340
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HIldK5vDx2luvmYEstU2PQzSS68xBrpp7lJ-8rQb2No/edit#gid=0",
          "cachedResultName": "Posted Articles"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{$vars.Daily_Industry_News_Automation_Google_Sheet}}"
        }
      },
      "executeOnce": true,
      "notesInFlow": true,
      "typeVersion": 4.6,
      "alwaysOutputData": true
    },
    {
      "id": "f0c01201-06f4-4154-8010-f134e5506f27",
      "name": "将新文章追加到 Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Append the un-published articles to the Published Articles Google Sheet.",
      "position": [
        -240,
        -340
      ],
      "parameters": {
        "columns": {
          "value": {
            "link": "={{ $json.link }}",
            "title": "={{ $json.title }}",
            "pubDate": "={{ $json.pubDate }}"
          },
          "schema": [
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "link",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "pubDate",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "pubDate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "creator",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "creator",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content:encoded",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content:encoded",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content:encodedSnippet",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content:encodedSnippet",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "dc:creator",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "dc:creator",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "contentSnippet",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "contentSnippet",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "guid",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "guid",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "categories",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "categories",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "isoDate",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "isoDate",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "author",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "author",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "dc:date",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "dc:date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "comments",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "comments",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1HIldK5vDx2luvmYEstU2PQzSS68xBrpp7lJ-8rQb2No/edit#gid=0",
          "cachedResultName": "Posted Articles"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{$vars.Daily_Industry_News_Automation_Google_Sheet}}"
        }
      },
      "executeOnce": false,
      "notesInFlow": true,
      "typeVersion": 4.6,
      "alwaysOutputData": true
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "2799c1bc-9306-4ff8-b6e9-8341fac3cfdb",
  "connections": {
    "Trigger Workflow": {
      "main": [
        [
          {
            "node": "Get Article Feeds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Article Feeds": {
      "main": [
        [
          {
            "node": "Read Latest Articles from Feeds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Unpublished Articles": {
      "main": [
        [
          {
            "node": "Append New Articles to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Latest Articles from Feeds": {
      "main": [
        [
          {
            "node": "Get Historically Posted Articles from Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append New Articles to Google Sheet": {
      "main": [
        [
          {
            "node": "Post New Articles to Slack Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Historically Posted Articles from Google Sheet": {
      "main": [
        [
          {
            "node": "Filter Unpublished Articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能

需要付费吗?

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

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

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

作者
Paul Taylor

Paul Taylor

@ptylr

Senior product and solutions leader with deep technical expertise, commercial acumen, and proven leadership across VC- and PE-backed firms. I specialize in unifying product strategy, scaling cross-functional models, and incubating new opportunities. Skilled at crafting compelling narratives, driving GTM execution, and engaging externally with impact. I thrive on building teams and turning vision into value across the full product lifecycle.

外部链接
在 n8n.io 查看

分享此工作流