{
  "name": "Take-an-Umbrella Check",
  "description": "Checks the forecast each morning and only pings you when rain is on the way — so you grab an umbrella just in time.",
  "tags": [
    "weather",
    "rain",
    "forecast",
    "reminder",
    "notification",
    "daily"
  ],
  "type": "triggered",
  "nodes": [
    {
      "id": "sticky-intro",
      "position": {
        "x": 20,
        "y": 20
      },
      "data": {
        "color": "#fff266",
        "content": "☔ Leave dry, come home dry.\n\nEvery morning at 7am this checks the forecast and, only if rain is expected, sends you a push notification to grab an umbrella. Set your ntfy topic. Keep your browser open for scheduled runs to fire."
      },
      "type": "stickyNote",
      "width": 360,
      "height": 190
    },
    {
      "id": "trigger-schedule",
      "position": {
        "x": 100,
        "y": 260
      },
      "data": {
        "instance": {
          "id": "af-base-node:trigger:schedule"
        },
        "label": "Every day at 7am",
        "inputs": {
          "rules": [
            {
              "triggerInterval": "days",
              "daysBetweenTriggers": 1,
              "triggerAtHour": "7",
              "triggerAtMinute": 0
            }
          ]
        },
        "parameters": {
          "notes": "Runs once a day at 7am."
        }
      },
      "type": "trigger"
    },
    {
      "id": "get-weather",
      "position": {
        "x": 420,
        "y": 260
      },
      "data": {
        "instance": {
          "id": "af-base-node:basic:httpRequest"
        },
        "label": "Get the forecast",
        "inputs": {
          "method": "GET",
          "url": "https://wttr.in/?format=j1"
        },
        "parameters": {
          "notes": "Fetches today's forecast as JSON from a free public service — no account needed. Uses your browser's location by default."
        }
      },
      "type": "basic"
    },
    {
      "id": "is-raining",
      "position": {
        "x": 740,
        "y": 260
      },
      "data": {
        "instance": {
          "id": "af-base-node:if:if"
        },
        "label": "Is it going to rain?",
        "inputs": {
          "conditions": [
            {
              "leftSide": "{{ $input.data.current_condition.0.weatherDesc.0.value }}",
              "rightSide": "rain",
              "operator": {
                "operationType": "string",
                "operatorValue": "contains"
              }
            }
          ]
        },
        "parameters": {
          "notes": "Sends a reminder only when the forecast mentions rain. The True port (0) continues to the notification. UNVERIFIED: the weather field path into wttr.in's JSON — adjust if the description lives elsewhere in the response."
        }
      },
      "type": "if"
    },
    {
      "id": "notify",
      "position": {
        "x": 1060,
        "y": 260
      },
      "data": {
        "instance": {
          "id": "af-base-node:basic:pushNotification"
        },
        "label": "Remind me",
        "inputs": {
          "credential": "",
          "parameters": {
            "provider": "ntfy",
            "topic": "",
            "message": "☔ Take an umbrella today"
          }
        },
        "parameters": {
          "notes": "Sends a push notification via ntfy when rain is expected."
        }
      },
      "type": "basic"
    },
    {
      "id": "sticky-push",
      "position": {
        "x": 1060,
        "y": 460
      },
      "data": {
        "color": "#ffd9b3",
        "content": "Setup needed: set an ntfy topic (any unique name) and subscribe to it in the ntfy app to receive reminders."
      },
      "type": "stickyNote",
      "width": 300,
      "height": 130
    }
  ],
  "edges": [
    {
      "id": "e-schedule-weather",
      "type": "flowEdge",
      "source": "trigger-schedule",
      "target": "get-weather"
    },
    {
      "id": "e-weather-if",
      "type": "flowEdge",
      "source": "get-weather",
      "target": "is-raining"
    },
    {
      "id": "e-if-notify",
      "type": "flowEdge",
      "source": "is-raining",
      "target": "notify",
      "sourceHandle": "output-0"
    }
  ]
}