{ "nodes": [ { "id": "weather-temperature-to-signl4-alert-0", "name": "When clicking ‘Test workflow’", "type": "n8n-nodes-base.manualTrigger", "position": [ -500, 40 ], "parameters": {}, "typeVersion": 1 }, { "id": "weather-temperature-to-signl4-alert-1", "name": "SIGNL4", "type": "n8n-nodes-base.signl4", "position": [ 60, -140 ], "parameters": { "message": "=Weather alert ❄️ Temperature: {{ $json.main.temp }} °C", "additionalFields": { "title": "Weather Alert from n8n", "externalId": "weather-alert", "locationFieldsUi": { "locationFieldsValues": { "latitude": "={{ $json.coord.lat }}", "longitude": "={{ $json.coord.lon }}" } } } }, "typeVersion": 1 }, { "id": "weather-temperature-to-signl4-alert-2", "name": "OpenWeatherMap", "type": "n8n-nodes-base.openWeatherMap", "position": [ -320, -140 ], "parameters": { "cityName": "Berlin", "format": "metric" }, "typeVersion": 1 }, { "id": "weather-temperature-to-signl4-alert-3", "name": "If", "type": "n8n-nodes-base.if", "position": [ -160, -140 ], "parameters": { "options": {}, "conditions": { "options": { "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "b95ba4e6-0749-4dd0-9830-14a6b0b5edcf", "operator": { "type": "number", "operation": "lt" }, "leftValue": "={{ $json.main.temp }}", "rightValue": 25 } ] } }, "typeVersion": 2 }, { "id": "weather-temperature-to-signl4-alert-4", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ -500, -140 ], "parameters": { "rule": { "interval": [ { "triggerAtHour": 6, "triggerAtMinute": 15 } ] } }, "typeVersion": 1.2 }, { "id": "weather-temperature-to-signl4-alert-validate", "name": "Validate weather data", "type": "n8n-nodes-base.code", "typeVersion": 2, "parameters": { "mode": "runOnceForEachItem", "jsCode": "const t=$json.main?.temp;if(typeof t!=='number'||!Number.isFinite(t))throw new Error('OpenWeather response has no numeric temperature');if(t<25){const lat=$json.coord?.lat,lon=$json.coord?.lon;if(typeof lat!=='number'||!Number.isFinite(lat)||lat < -90||lat > 90||typeof lon!=='number'||!Number.isFinite(lon)||lon < -180||lon > 180)throw new Error('OpenWeather response has invalid coordinates');}return {json:$json};" } } ], "pinData": {}, "connections": { "If": { "main": [ [ { "node": "SIGNL4", "type": "main", "index": 0 } ] ] }, "OpenWeatherMap": { "main": [ [ { "node": "Validate weather data", "type": "main", "index": 0 } ] ] }, "Schedule Trigger": { "main": [ [ { "node": "OpenWeatherMap", "type": "main", "index": 0 } ] ] }, "When clicking ‘Test workflow’": { "main": [ [ { "node": "OpenWeatherMap", "type": "main", "index": 0 } ] ] }, "Validate weather data": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] } }, "name": "Weather Temperature to SIGNL4 Alert", "active": false, "settings": { "executionOrder": "v1", "timezone": "UTC" } }