8
n8n 中文网amn8n.com

从Visual Crossing向Telegram发送恶劣天气警报

中级

这是一个Personal Productivity领域的自动化工作流,包含 10 个节点。主要使用 If, Function, Telegram, HttpRequest, ScheduleTrigger 等节点。 从Visual Crossing向Telegram发送恶劣天气警报

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "e0abec5d9b13345e424c0dbbc512271f89fb17de3b268697e13a797de2271404",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "6380fbf8-4893-4c55-8ca5-ac498597a247",
      "name": "获取家庭天气",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        496,
        96
      ],
      "parameters": {
        "url": "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/YOUR_HOME_LOCATION?unitGroup=metric&key=YOUR_VISUAL_CROSSING_API_KEY&include=alerts,today",
        "options": {}
      },
      "notesInFlow": [
        {
          "note": "Fetches today's weather and alerts for home location."
        }
      ],
      "typeVersion": 1
    },
    {
      "id": "655bbb79-0663-427a-bdcf-c4edc92e1359",
      "name": "检查家庭天气警报",
      "type": "n8n-nodes-base.function",
      "position": [
        720,
        96
      ],
      "parameters": {
        "functionCode": "return items.filter(item => item.json.alerts && item.json.alerts.length > 0);"
      },
      "notesInFlow": [
        {
          "note": "Continues only if there are severe weather alerts at home location."
        }
      ],
      "typeVersion": 1
    },
    {
      "id": "5345c75c-9530-48bd-8584-59330cf8ce44",
      "name": "发送家庭天气警报",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1168,
        80
      ],
      "webhookId": "a98e6bdf-293f-4130-bcac-ffd699391a23",
      "parameters": {
        "operation": "send"
      },
      "credentials": {},
      "notesInFlow": [
        {
          "note": "Sends severe weather alert notification for home location, if any alerts present."
        }
      ],
      "typeVersion": 1
    },
    {
      "id": "ff289a8a-a9a1-480d-9fdb-2c0aeac91143",
      "name": "每小时触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        272,
        96
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "notesInFlow": [
        {
          "note": "Starts the workflow every day at 7 AM to check calendar events and weather."
        }
      ],
      "typeVersion": 1
    },
    {
      "id": "c8e4f8cb-aada-4f89-a3ff-9d9638795872",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        944,
        96
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "7ca31fa4-80fb-4220-b70f-6b7be1b6649c",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{$json[\"alerts\"] && $json[\"alerts\"].length > 0}} ",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3007062d-7d01-4d9d-abfc-1c4c8ee9863d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        -80
      ],
      "parameters": {
        "width": 192,
        "height": 336,
        "content": "## 每小时触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "d79d3148-da13-47a3-b6a8-999ea7c6bba8",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -80
      ],
      "parameters": {
        "width": 192,
        "height": 336,
        "content": "## 获取天气"
      },
      "typeVersion": 1
    },
    {
      "id": "46f02e3d-e774-48e2-a243-e17e3688b3f7",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        -80
      ],
      "parameters": {
        "width": 400,
        "height": 336,
        "content": "## 检查天气警报"
      },
      "typeVersion": 1
    },
    {
      "id": "d22f959c-6cf2-400c-906c-87e64109f06d",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -80
      ],
      "parameters": {
        "width": 192,
        "height": 336,
        "content": "## 发送通知"
      },
      "typeVersion": 1
    },
    {
      "id": "e39018d7-ac63-428b-a96a-f00146f66c70",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        272
      ],
      "parameters": {
        "width": 1088,
        "height": 640,
        "content": "## 工作原理"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Send Home Weather Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hourly Trigger": {
      "main": [
        [
          {
            "node": "Get Home Weather",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Home Weather": {
      "main": [
        [
          {
            "node": "Check for Home Weather Alerts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Home Weather Alerts": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 个人效率

需要付费吗?

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

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

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

作者
Razvan Bara

Razvan Bara

@amzneer

Whether you're launching your first product or scaling, I'll help you build an AI-powered, data-driven system that runs your business while you focus on strategic growth. Let's discuss how strategic optimization combined with business intelligence and custom AI agents can transform your operations and accelerate your success. Ready to scale smarter with AI and data? Let's talk.

外部链接
在 n8n.io 查看

分享此工作流