8
n8n 中文网amn8n.com

001_面向Slack的AI驱动新闻洞察工作流

高级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 17 个节点。主要使用 Set, Code, Merge, Slack, HttpRequest 等节点。 使用NewsAPI和GPT-4洞察的每日商业新闻简报发送到Slack

前置要求
  • Slack Bot Token 或 Webhook URL
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "4g8HglPLSdpDmBwc",
  "meta": {
    "instanceId": "e854ccd1d846d48f876ea4ce7613a148e39ed800c748cb59061b490defde7afd",
    "templateCredsSetupCompleted": true
  },
  "name": "001_面向 Slack 的 AI 驱动新闻洞察工作流",
  "tags": [],
  "nodes": [
    {
      "id": "4ed04f56-1cd8-47d5-b4c1-34cfdb496583",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        128,
        192
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e658f392-e1b6-4f14-ad02-414eb3b03f99",
      "name": "发布到Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        2896,
        176
      ],
      "webhookId": "4a077704-dc20-4afb-a471-9a9ea8c24373",
      "parameters": {
        "text": "={{ $json.choices[0].message.content }}",
        "user": {
          "__rl": true,
          "mode": "list",
          "value": "U096VCG525P",
          "cachedResultName": "james"
        },
        "select": "user",
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "edcCpymx9IvKgibG",
          "name": "Slack account"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "06b21744-df60-4a78-b804-21223b628fcc",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        -288
      ],
      "parameters": {
        "width": 448,
        "height": 1008,
        "content": "## 📰 将趋势新闻总结为 Slack 中的商业洞察"
      },
      "typeVersion": 1
    },
    {
      "id": "ac6308fa-d25c-4b24-bcec-aa4208870571",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        -384
      ],
      "parameters": {
        "color": 7,
        "width": 624,
        "height": 304,
        "content": "## ⚙️ 工作流分解"
      },
      "typeVersion": 1
    },
    {
      "id": "8b926d52-75a4-4dce-9f80-5ff22f256bb7",
      "name": "设置用户配置(国家、类别、查询)",
      "type": "n8n-nodes-base.set",
      "position": [
        624,
        192
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "{\n  \"country\": \"us\",\n  \"category\": \"technology\",\n  \"query\": \"openai\"\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "444c5afa-9052-4e07-8881-7a0a86ac8a78",
      "name": "获取新闻文章",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1104,
        192
      ],
      "parameters": {
        "url": "=https://newsapi.org/v2/top-headlines?country={{ $json.country }}&category={{ $json.category }}&q={{ $json.query }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Api-Key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0ed04c61-e4dd-4e3f-8735-3cff4aedc9cb",
      "name": "合并配置与文章",
      "type": "n8n-nodes-base.merge",
      "position": [
        2032,
        176
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "85ce6b97-0549-4ff8-9334-e9daf7fceed2",
      "name": "生成商业洞察(GPT)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2352,
        176
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "GPT-4.1-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=You are a business analyst. The user is researching \"{{ $json.query }}\" in the \"{{ $json.category }}\" sector within \"{{ $json.country }}\".\n\nHere are {{ $json.articles.length }} articles. Select the 10 most important based on:\n1. Impact and relevance to \"{{ $json.query }}\"\n2. Business risks, opportunities, or strategic insights\n\nFor each of the 10, summarize in 2-3 lines and also add if it's a:\n- 🔴 Risk\n- 🟢 Opportunity\n- ⚪ Neutral\n\nFinish with a 1-paragraph summary of the overall trend.\n\nHere is the data:\n {{ JSON.stringify($json, null, 2) }}"
            },
            {
              "role": "system",
              "content": "You are a professional trend analyst summarizing news with actionable business insights."
            }
          ]
        },
        "simplify": false
      },
      "credentials": {
        "openAiApi": {
          "id": "e4tOzT9cxtVeZl61",
          "name": "n8n free OpenAI API credits"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "67a3fc4b-4c91-4856-810f-0f39b121a729",
      "name": "注入配置数据",
      "type": "n8n-nodes-base.set",
      "position": [
        1824,
        64
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "{\n  \"country\": \"us\",\n  \"category\": \"technology\",\n  \"query\": \"AI\"\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "c9730e23-e365-4964-8ed3-7184dfe13d69",
      "name": "限制前 10 趋势",
      "type": "n8n-nodes-base.code",
      "disabled": true,
      "position": [
        1584,
        64
      ],
      "parameters": {
        "jsCode": "const topTen = items.slice(0, 10);\nreturn topTen;"
      },
      "typeVersion": 2
    },
    {
      "id": "a96f8610-32c6-4410-8b87-a7bb43ece32d",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        464,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 416,
        "content": "## 注入配置设置"
      },
      "typeVersion": 1
    },
    {
      "id": "900b9b6a-cff5-4438-bf49-3919c9b179d0",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 416,
        "content": "## 获取最新新闻头条"
      },
      "typeVersion": 1
    },
    {
      "id": "d0747cf1-d1db-4728-869b-b39d86320958",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 720,
        "height": 496,
        "content": "## 准备文章并合并配置"
      },
      "typeVersion": 1
    },
    {
      "id": "5942c7d8-4853-47cd-b529-c91e7427a7e2",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2272,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 496,
        "content": "## GPT 商业总结"
      },
      "typeVersion": 1
    },
    {
      "id": "e2bc105f-82e8-414b-a2ef-1556ab99934c",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2752,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 496,
        "content": "## 发布到 Slack"
      },
      "typeVersion": 1
    },
    {
      "id": "bc891826-edfd-4f45-b986-c9bfb86baa44",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 416,
        "content": "## 计划触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "13e633f5-02ac-46d0-b878-f8736746beb3",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        -320
      ],
      "parameters": {
        "color": 4,
        "width": 480,
        "height": 192,
        "content": "## 🎥 Demo Video  \n👉 **[Click here to watch the setup guide](https://www.loom.com/share/970a3fba1ed44352a2194f1ef6a8dc45?sid=6750eb3e-9eb9-4400-a6ec-83d2c9de55e4)**  "
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "60471506-ee09-4599-b9eb-f38a675a162b",
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set User Config (Country, Category, Query)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Inject Config Data": {
      "main": [
        [
          {
            "node": "Merge Config with Articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch News Articles": {
      "main": [
        [
          {
            "node": "Merge Config with Articles",
            "type": "main",
            "index": 1
          },
          {
            "node": "Limit to Top 10 Trends",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit to Top 10 Trends": {
      "main": [
        [
          {
            "node": "Inject Config Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Config with Articles": {
      "main": [
        [
          {
            "node": "Generate Business Insights (GPT)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Business Insights (GPT)": {
      "main": [
        [
          {
            "node": "Post to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set User Config (Country, Category, Query)": {
      "main": [
        [
          {
            "node": "Fetch News Articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

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

需要付费吗?

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

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

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

作者
James Carter

James Carter

@arioloop

Automation engineer | 10+ years streamlining Sales & Marketing. Use my link to book an initial consultation for custom n8n work.

外部链接
在 n8n.io 查看

分享此工作流