{
 "name": "[노드 한 장] IF · 우산 챙겨야 하는 날만 알려주기",
 "nodes": [
  {
   "id": "b1",
   "name": "Run manually",
   "type": "n8n-nodes-base.manualTrigger",
   "typeVersion": 1,
   "position": [
    0,
    0
   ],
   "parameters": {}
  },
  {
   "id": "b2",
   "name": "Every morning 7AM",
   "type": "n8n-nodes-base.scheduleTrigger",
   "typeVersion": 1.2,
   "position": [
    0,
    200
   ],
   "parameters": {
    "rule": {
     "interval": [
      {
       "triggerAtHour": 7
      }
     ]
    }
   }
  },
  {
   "id": "b3",
   "name": "Get today's forecast",
   "type": "n8n-nodes-base.httpRequest",
   "typeVersion": 4.2,
   "position": [
    260,
    100
   ],
   "parameters": {
    "url": "https://api.open-meteo.com/v1/forecast?latitude=37.5665,51.5072,40.7128,35.6762,1.3521,-33.8688&longitude=126.978,-0.1276,-74.006,139.6503,103.8198,151.2093&daily=precipitation_probability_max,temperature_2m_max&timezone=auto&forecast_days=1",
    "options": {}
   }
  },
  {
   "id": "b4",
   "name": "Pick city & rain chance",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    500,
    100
   ],
   "parameters": {
    "assignments": {
     "assignments": [
      {
       "id": "c1",
       "name": "city",
       "type": "string",
       "value": "={{ ['Seoul','London','New York','Tokyo','Singapore','Sydney'][$itemIndex] }}"
      },
      {
       "id": "c2",
       "name": "rain_chance",
       "type": "number",
       "value": "={{ $json.daily.precipitation_probability_max[0] }}"
      },
      {
       "id": "c3",
       "name": "max_temp_c",
       "type": "number",
       "value": "={{ $json.daily.temperature_2m_max[0] }}"
      },
      {
       "id": "c4",
       "name": "date",
       "type": "string",
       "value": "={{ $json.daily.time[0] }}"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "b5",
   "name": "Rain chance ≥ 50%?",
   "type": "n8n-nodes-base.if",
   "typeVersion": 2.2,
   "position": [
    740,
    100
   ],
   "parameters": {
    "conditions": {
     "options": {
      "caseSensitive": true,
      "leftValue": "",
      "typeValidation": "strict",
      "version": 2
     },
     "conditions": [
      {
       "id": "d1",
       "leftValue": "={{ $json.rain_chance }}",
       "rightValue": 50,
       "operator": {
        "type": "number",
        "operation": "gte"
       }
      }
     ],
     "combinator": "and"
    },
    "options": {}
   }
  },
  {
   "id": "b6",
   "name": "Take an umbrella",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    1000,
    0
   ],
   "parameters": {
    "includeOtherFields": true,
    "assignments": {
     "assignments": [
      {
       "id": "e1",
       "name": "message",
       "type": "string",
       "value": "=☂️ {{ $json.city }}: 우산 챙기세요 ({{ $json.rain_chance }}%)"
      }
     ]
    },
    "options": {}
   }
  },
  {
   "id": "b7",
   "name": "Skip",
   "type": "n8n-nodes-base.noOp",
   "typeVersion": 1,
   "position": [
    1000,
    220
   ],
   "parameters": {}
  }
 ],
 "connections": {
  "Run manually": {
   "main": [
    [
     {
      "node": "Get today's forecast",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Every morning 7AM": {
   "main": [
    [
     {
      "node": "Get today's forecast",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Get today's forecast": {
   "main": [
    [
     {
      "node": "Pick city & rain chance",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Pick city & rain chance": {
   "main": [
    [
     {
      "node": "Rain chance ≥ 50%?",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Rain chance ≥ 50%?": {
   "main": [
    [
     {
      "node": "Take an umbrella",
      "type": "main",
      "index": 0
     }
    ],
    [
     {
      "node": "Skip",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "timezone": "Asia/Seoul",
  "executionOrder": "v1"
 },
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow/nodes"
 }
}