{ "name": "Current City Weather", "nodes": [ { "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 250, 300 ], "parameters": {}, "typeVersion": 1, "id": "current-city-weather-trigger" }, { "name": "OpenWeatherMap", "type": "n8n-nodes-base.openWeatherMap", "position": [ 450, 300 ], "parameters": { "operation": "currentWeather", "format": "metric", "locationSelection": "cityName", "cityName": "berlin,de", "language": "" }, "typeVersion": 1, "id": "current-city-weather-read" }, { "id": "current-city-weather-check", "name": "Check current-weather success", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 670, 300 ], "parameters": { "mode": "runOnceForEachItem", "jsCode": "function currentCityWeather({ weather }) {\n if (!weather || typeof weather !== 'object' || Array.isArray(weather) || weather.cod !== 200) {\n throw new Error('OpenWeather did not return a successful current-weather record');\n }\n return { weather };\n}\n\nreturn { json: currentCityWeather({ weather: $json }).weather };" } } ], "active": false, "settings": { "executionOrder": "v1" }, "connections": { "On clicking 'execute'": { "main": [ [ { "node": "OpenWeatherMap", "type": "main", "index": 0 } ] ] }, "OpenWeatherMap": { "main": [ [ { "node": "Check current-weather success", "type": "main", "index": 0 } ] ] } }, "pinData": {} }