{ "kind": "open-flow-workflow", "version": 1, "name": "Send Daily Weather to Gotify", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_d8f31bda12879a75": { "name": "Every day at 09:00 UTC", "kind": "cron", "cronTimes": [ { "type": "cron", "expression": "0 9 * * *", "timezone": "UTC" } ] }, "n_1366688ee96dde45": { "inputs": { "q": { "kind": "value", "value": "Berlin" }, "units": { "kind": "value", "value": "metric" } }, "name": "Read current weather", "kind": "task", "task": { "inputs": [ { "description": "The city name, optionally followed by state code and country code, such as London,GB.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The city name, optionally followed by state code and country code, such as London,GB." }, "nullable": true, "handle": "q", "value": null }, { "description": "The OpenWeather city identifier.", "jsonSchema": { "type": "integer", "minimum": 0, "description": "The OpenWeather city identifier." }, "nullable": true, "handle": "id", "value": null }, { "description": "The ZIP or postal code followed by country code, such as 94040,US.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The ZIP or postal code followed by country code, such as 94040,US." }, "nullable": true, "handle": "zip", "value": null }, { "description": "The latitude in decimal degrees.", "jsonSchema": { "type": "number", "minimum": -90, "maximum": 90, "description": "The latitude in decimal degrees." }, "nullable": true, "handle": "lat", "value": null }, { "description": "The longitude in decimal degrees.", "jsonSchema": { "type": "number", "minimum": -180, "maximum": 180, "description": "The longitude in decimal degrees." }, "nullable": true, "handle": "lon", "value": null }, { "description": "The units of measurement for the response.", "jsonSchema": { "type": "string", "enum": [ "standard", "metric", "imperial" ], "description": "The units of measurement for the response." }, "nullable": true, "handle": "units", "value": null }, { "description": "The response language code in ISO 639-1 format.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The response language code in ISO 639-1 format." }, "nullable": true, "handle": "lang", "value": null } ], "outputs": [ { "description": "The current weather payload returned by OpenWeather.", "jsonSchema": { "type": "object", "properties": { "coord": { "type": "object", "properties": { "lon": { "type": "number", "description": "The longitude in decimal degrees." }, "lat": { "type": "number", "description": "The latitude in decimal degrees." } }, "required": [ "lon", "lat" ], "additionalProperties": true, "description": "The coordinates for the requested place." }, "weather": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "description": "The weather condition identifier." }, "main": { "type": "string", "description": "The group of weather parameters." }, "description": { "type": "string", "description": "The localized condition description." }, "icon": { "type": "string", "description": "The weather icon code." } }, "required": [ "id", "main", "description", "icon" ], "additionalProperties": true, "description": "A weather condition entry returned by OpenWeather." }, "description": "The weather conditions for the requested place." }, "base": { "type": "string", "description": "The internal base parameter returned by OpenWeather." }, "main": { "type": "object", "properties": { "temp": { "type": "number", "description": "The measured temperature." }, "feels_like": { "type": "number", "description": "The human-perceived temperature." }, "temp_min": { "type": "number", "description": "The minimum observed temperature." }, "temp_max": { "type": "number", "description": "The maximum observed temperature." }, "pressure": { "type": "number", "description": "The atmospheric pressure in hPa." }, "humidity": { "type": "number", "description": "The humidity percentage." }, "sea_level": { "type": "number", "description": "The sea-level pressure in hPa." }, "grnd_level": { "type": "number", "description": "The ground-level pressure in hPa." }, "temp_kf": { "type": "number", "description": "The internal forecast temperature correction." } }, "required": [ "temp", "feels_like", "temp_min", "temp_max", "pressure", "humidity" ], "additionalProperties": true, "description": "The main weather metrics." }, "visibility": { "type": "number", "description": "The visibility distance in metres." }, "wind": { "type": "object", "properties": { "speed": { "type": "number", "description": "The wind speed." }, "deg": { "type": "number", "description": "The wind direction in degrees." }, "gust": { "type": "number", "description": "The wind gust speed." } }, "required": [ "speed" ], "additionalProperties": true, "description": "The wind metrics." }, "rain": { "type": "object", "properties": { "1h": { "type": "number", "description": "The precipitation volume for the last hour." }, "3h": { "type": "number", "description": "The precipitation volume for the last three hours." } }, "additionalProperties": true, "description": "The rain volume summary." }, "snow": { "type": "object", "properties": { "1h": { "type": "number", "description": "The precipitation volume for the last hour." }, "3h": { "type": "number", "description": "The precipitation volume for the last three hours." } }, "additionalProperties": true, "description": "The snow volume summary." }, "clouds": { "type": "object", "properties": { "all": { "type": "number", "description": "The cloudiness percentage." } }, "required": [ "all" ], "additionalProperties": true, "description": "The cloud coverage summary." }, "dt": { "type": "integer", "minimum": 0, "description": "The calculation time as a Unix UTC timestamp." }, "sys": { "type": "object", "properties": { "type": { "type": "integer", "description": "The internal system type." }, "id": { "type": "integer", "description": "The internal system identifier." }, "country": { "type": "string", "description": "The ISO 3166 country code." }, "sunrise": { "type": "integer", "minimum": 0, "description": "The sunrise time as a Unix UTC timestamp." }, "sunset": { "type": "integer", "minimum": 0, "description": "The sunset time as a Unix UTC timestamp." } }, "required": [ "country", "sunrise", "sunset" ], "additionalProperties": true, "description": "The current weather system metadata." }, "timezone": { "type": "integer", "description": "The shift in seconds from UTC." }, "id": { "type": "integer", "description": "The OpenWeather city identifier." }, "name": { "type": "string", "description": "The place name returned by OpenWeather." }, "cod": { "type": "integer", "description": "The internal response code returned on success." } }, "required": [ "coord", "weather", "base", "main", "wind", "clouds", "dt", "sys", "timezone", "id", "name", "cod" ], "additionalProperties": true, "description": "The current weather payload returned by OpenWeather." }, "nullable": false, "handle": "output" } ], "name": "Read current weather", "executor": { "kind": "connector", "action": "openweather_api.get_current_weather", "outputMode": "value" } } }, "n_6b161f9b06330fff": { "inputs": { "weather": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_1366688ee96dde45", "output": "output" } ] } }, "name": "Prepare temperature message", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "coord": { "type": "object", "properties": { "lon": { "type": "number", "description": "The longitude in decimal degrees." }, "lat": { "type": "number", "description": "The latitude in decimal degrees." } }, "required": [ "lon", "lat" ], "additionalProperties": true, "description": "The coordinates for the requested place." }, "weather": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "description": "The weather condition identifier." }, "main": { "type": "string", "description": "The group of weather parameters." }, "description": { "type": "string", "description": "The localized condition description." }, "icon": { "type": "string", "description": "The weather icon code." } }, "required": [ "id", "main", "description", "icon" ], "additionalProperties": true, "description": "A weather condition entry returned by OpenWeather." }, "description": "The weather conditions for the requested place." }, "base": { "type": "string", "description": "The internal base parameter returned by OpenWeather." }, "main": { "type": "object", "properties": { "temp": { "type": "number", "description": "The measured temperature." }, "feels_like": { "type": "number", "description": "The human-perceived temperature." }, "temp_min": { "type": "number", "description": "The minimum observed temperature." }, "temp_max": { "type": "number", "description": "The maximum observed temperature." }, "pressure": { "type": "number", "description": "The atmospheric pressure in hPa." }, "humidity": { "type": "number", "description": "The humidity percentage." }, "sea_level": { "type": "number", "description": "The sea-level pressure in hPa." }, "grnd_level": { "type": "number", "description": "The ground-level pressure in hPa." }, "temp_kf": { "type": "number", "description": "The internal forecast temperature correction." } }, "required": [ "temp", "feels_like", "temp_min", "temp_max", "pressure", "humidity" ], "additionalProperties": true, "description": "The main weather metrics." }, "visibility": { "type": "number", "description": "The visibility distance in metres." }, "wind": { "type": "object", "properties": { "speed": { "type": "number", "description": "The wind speed." }, "deg": { "type": "number", "description": "The wind direction in degrees." }, "gust": { "type": "number", "description": "The wind gust speed." } }, "required": [ "speed" ], "additionalProperties": true, "description": "The wind metrics." }, "rain": { "type": "object", "properties": { "1h": { "type": "number", "description": "The precipitation volume for the last hour." }, "3h": { "type": "number", "description": "The precipitation volume for the last three hours." } }, "additionalProperties": true, "description": "The rain volume summary." }, "snow": { "type": "object", "properties": { "1h": { "type": "number", "description": "The precipitation volume for the last hour." }, "3h": { "type": "number", "description": "The precipitation volume for the last three hours." } }, "additionalProperties": true, "description": "The snow volume summary." }, "clouds": { "type": "object", "properties": { "all": { "type": "number", "description": "The cloudiness percentage." } }, "required": [ "all" ], "additionalProperties": true, "description": "The cloud coverage summary." }, "dt": { "type": "integer", "minimum": 0, "description": "The calculation time as a Unix UTC timestamp." }, "sys": { "type": "object", "properties": { "type": { "type": "integer", "description": "The internal system type." }, "id": { "type": "integer", "description": "The internal system identifier." }, "country": { "type": "string", "description": "The ISO 3166 country code." }, "sunrise": { "type": "integer", "minimum": 0, "description": "The sunrise time as a Unix UTC timestamp." }, "sunset": { "type": "integer", "minimum": 0, "description": "The sunset time as a Unix UTC timestamp." } }, "required": [ "country", "sunrise", "sunset" ], "additionalProperties": true, "description": "The current weather system metadata." }, "timezone": { "type": "integer", "description": "The shift in seconds from UTC." }, "id": { "type": "integer", "description": "The OpenWeather city identifier." }, "name": { "type": "string", "description": "The place name returned by OpenWeather." }, "cod": { "type": "integer", "description": "The internal response code returned on success." } }, "required": [ "coord", "weather", "base", "main", "wind", "clouds", "dt", "sys", "timezone", "id", "name", "cod" ], "additionalProperties": true, "description": "The current weather payload returned by OpenWeather." }, "nullable": false, "handle": "weather" } ], "outputs": [ { "jsonSchema": { "type": "string", "minLength": 1, "description": "The message body to send. Markdown excluding HTML is allowed." }, "nullable": false, "handle": "message" } ], "name": "Prepare temperature message", "moduleId": "n_56b0b1ff9743a1c1", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_38fd71d9d47abe2d": { "inputs": { "message": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6b161f9b06330fff", "output": "message" } ] }, "title": { "kind": "value", "value": "Today's Weather Update" } }, "name": "Send Gotify notification", "kind": "task", "task": { "inputs": [ { "description": "The message body to send. Markdown excluding HTML is allowed.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The message body to send. Markdown excluding HTML is allowed." }, "nullable": false, "handle": "message" }, { "description": "An optional title for the Gotify message.", "jsonSchema": { "type": "string", "minLength": 1, "description": "An optional title for the Gotify message." }, "nullable": true, "handle": "title", "value": null }, { "description": "An optional message priority. If omitted, Gotify uses the application default priority.", "jsonSchema": { "type": "integer", "description": "An optional message priority. If omitted, Gotify uses the application default priority." }, "nullable": true, "handle": "priority", "value": null }, { "description": "Optional Gotify message extras keyed by the official namespace format.", "jsonSchema": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Optional Gotify message extras keyed by the official namespace format." }, "nullable": true, "handle": "extras", "value": null } ], "outputs": [ { "description": "The Gotify message id.", "jsonSchema": { "type": "integer", "description": "The Gotify message id." }, "nullable": false, "handle": "id" }, { "description": "The id of the Gotify application that sent this message.", "jsonSchema": { "type": "integer", "description": "The id of the Gotify application that sent this message." }, "nullable": false, "handle": "appid" }, { "description": "The Gotify message body. Markdown excluding HTML is allowed.", "jsonSchema": { "type": "string", "description": "The Gotify message body. Markdown excluding HTML is allowed." }, "nullable": false, "handle": "message" }, { "description": "The date and time when the message was created.", "jsonSchema": { "type": "string", "description": "The date and time when the message was created." }, "nullable": false, "handle": "date" }, { "description": "The optional Gotify message title.", "jsonSchema": { "type": "string", "description": "The optional Gotify message title." }, "nullable": true, "handle": "title" }, { "description": "The Gotify message priority.", "jsonSchema": { "type": "integer", "description": "The Gotify message priority." }, "nullable": true, "handle": "priority" }, { "description": "Optional Gotify message extras keyed by the official namespace format.", "jsonSchema": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Optional Gotify message extras keyed by the official namespace format." }, "nullable": true, "handle": "extras" } ], "name": "Send Gotify notification", "executor": { "kind": "connector", "action": "gotify.send_message" } } } }, "edges": [ { "source": "n_d8f31bda12879a75", "target": "n_1366688ee96dde45" }, { "source": "n_1366688ee96dde45", "target": "n_6b161f9b06330fff" }, { "source": "n_6b161f9b06330fff", "target": "n_38fd71d9d47abe2d" } ] } }, "modules": { "n_56b0b1ff9743a1c1": { "name": "Prepare temperature message", "imports": [], "source": "export default function main({weather}) {\n const temp=weather?.main?.temp;\n if(typeof temp!=='number'||!Number.isFinite(temp))throw Error('Weather response does not contain a temperature');\n return {message:`Hey! The temperature outside is ${temp}°C.`};\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }