8
n8n 中文网amn8n.com

每日禅语励志名言推送至Slack频道

初级

这是一个Personal Productivity, Multimodal AI领域的自动化工作流,包含 5 个节点。主要使用 Code, Cron, Slack, HttpRequest 等节点。 每日从ZenQuotes获取励志名言并推送到Slack频道

前置要求
  • Slack Bot Token 或 Webhook URL
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "2000c64071c20843606b95c63795bb0797c41036047055a6586498e855b96efc"
  },
  "nodes": [
    {
      "id": "b57d7fea-fd4d-417b-bad6-7d28d1968c6f",
      "name": "设置说明",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 280,
        "height": 200,
        "content": "⭐ **需要设置:**"
      },
      "typeVersion": 1
    },
    {
      "id": "279ead2e-17c7-4e58-8d27-40b6de24e969",
      "name": "每日早上8点触发",
      "type": "n8n-nodes-base.cron",
      "position": [
        0,
        224
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "03ed9013-fc5c-4ce7-834b-1ae8f2274834",
      "name": "获取随机名言",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        208,
        224
      ],
      "parameters": {
        "url": "https://zenquotes.io/api/random",
        "options": {}
      },
      "typeVersion": 4.1
    },
    {
      "id": "114fc429-738a-41b7-95a6-06ccbae822b2",
      "name": "为 Slack 格式化名言",
      "type": "n8n-nodes-base.code",
      "position": [
        400,
        224
      ],
      "parameters": {
        "jsCode": "// Normalize quote data from API response\nconst response = $input.first().json;\nconst quoteData = Array.isArray(response) ? response[0] : response;\n\n// Format the motivational message\nconst formattedQuote = {\n  text: `🌟 *Daily Motivation* 🌟\\n\\n\"${quoteData.q || quoteData.quote || 'Stay positive and keep moving forward!'}\"\\n\\n— ${quoteData.a || quoteData.author || 'Unknown'}`,\n  channel: '#general', // Change to your preferred channel\n  username: 'MotivationBot',\n  icon_emoji: ':star2:',\n  raw_quote: quoteData.q || quoteData.quote,\n  raw_author: quoteData.a || quoteData.author\n};\n\nconsole.log('Formatted Quote:', formattedQuote);\n\nreturn {\n  json: formattedQuote\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "a8598192-0075-4ea1-b1a0-8ac2ff7755d1",
      "name": "发送到 Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        608,
        224
      ],
      "webhookId": "00724f92-9755-4dd9-b88e-f6e0b5ad01b0",
      "parameters": {
        "text": "={{ $json.text }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "general"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 2.1
    }
  ],
  "pinData": {},
  "connections": {
    "Daily 8AM Trigger": {
      "main": [
        [
          {
            "node": "Fetch Random Quote",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Random Quote": {
      "main": [
        [
          {
            "node": "Format Quote for Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Quote for Slack": {
      "main": [
        [
          {
            "node": "Send to Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

初级 - 个人效率, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
初级
节点数量5
分类2
节点类型5
难度说明

适合 n8n 新手,包含 1-5 个节点的简单工作流

作者
David Olusola

David Olusola

@dae221

I help ambitious businesses eliminate operational bottlenecks and scale faster with AI automation. My clients typically see 40-60% efficiency gains within 90 days. Currently accepting 3 new projects this quarter - david@daexai.com

外部链接
在 n8n.io 查看

分享此工作流