{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "6380fbf8-4893-4c55-8ca5-ac498597a247",
      "name": "Get Home Weather",
      "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_TOKEN_HERE&include=alerts,today",
        "options": {}
      },
      "notesInFlow": [
        {
          "note": "Fetches today's weather and alerts for home location."
        }
      ],
      "typeVersion": 1
    },
    {
      "id": "655bbb79-0663-427a-bdcf-c4edc92e1359",
      "name": "Check for Home Weather Alerts",
      "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": "Send Home Weather Alert",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1168,
        80
      ],
      "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": "Hourly Trigger",
      "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": "If",
      "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": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        -80
      ],
      "parameters": {
        "width": 192,
        "height": 336,
        "content": "## Hourly Trigger\nTriggers the flow every hour as intended."
      },
      "typeVersion": 1
    },
    {
      "id": "d79d3148-da13-47a3-b6a8-999ea7c6bba8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -80
      ],
      "parameters": {
        "width": 192,
        "height": 336,
        "content": "## Get Weather \nThis fetches today\u2019s weather and any severe alerts for the home location."
      },
      "typeVersion": 1
    },
    {
      "id": "46f02e3d-e774-48e2-a243-e17e3688b3f7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        -80
      ],
      "parameters": {
        "width": 400,
        "height": 336,
        "content": "## Check Weather Alerts \nFilters items to only those with alerts"
      },
      "typeVersion": 1
    },
    {
      "id": "d22f959c-6cf2-400c-906c-87e64109f06d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -80
      ],
      "parameters": {
        "width": 192,
        "height": 336,
        "content": "## Send notification\nMake sure Telegram credentials and chat ID are set in the node."
      },
      "typeVersion": 1
    },
    {
      "id": "e39018d7-ac63-428b-a96a-f00146f66c70",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        272
      ],
      "parameters": {
        "width": 1088,
        "height": 640,
        "content": "## How it works\nThis workflow automates the process of fetching weather forecasts for your home location, including severe weather alerts, and sends timely notifications. It uses the Visual Crossing API for detailed weather data and integrates with Telegram (or other messaging services) for messaging and alerts.\n\n## Step-by-step\nIn summary, the workflow runs every hour, grabs the current day's weather conditions for [your city/location of interest], and returns only those items that truly contain one or more weather alerts.\n\n\ud83d\udcc5 Step 1: **Hourly Trigger**\nThe workflow begins with the Hourly Trigger node, which is a scheduleTrigger. This node acts as the clock that initiates the entire process at regular hourly intervals.\n\n\ud83c\udf24\ufe0f Step 2: **Fetch Weather Data**\nImmediately after the trigger, the workflow moves to the Meteo node, an httpRequest. This node makes an external API call to fetch weather data for your specified location.\n\nAPI Used: Visual Crossing Web Services\n\nAuthentication: Uses your API key (key=[API KEY])\n\nResponse format: JSON\n\n\ud83c\udf2a\ud83c\udf00 Step 3: **Check for Severe Weather**\nThe JSON weather data output is analyzed, and if severe weather conditions or alerts are detected, the workflow sends the alert via your preferred communication channel(s).\n\n## Optional\nYou can replace the Telegram node with email, WhatsApp, SMS notifications, or add multiple notification nodes to receive severe weather alerts across all desired channels."
      },
      "typeVersion": 1
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}