{ "kind": "open-flow-workflow", "version": 1, "name": "Daily Weather Temperature to Vonage SMS", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_7e08b1ec2928dd9f": { "name": "Daily at 09:00 UTC", "kind": "cron", "cronTimes": [ { "type": "cron", "expression": "0 9 * * *", "timezone": "UTC" } ] }, "n_40aeb7262f66498e": { "inputs": { "q": { "kind": "value", "value": "berlin" }, "units": { "kind": "value", "value": "metric" } }, "name": "Get 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": "Get current weather", "executor": { "kind": "connector", "action": "openweather_api.get_current_weather", "outputMode": "value" } } }, "n_4ab722873f19baf1": { "inputs": { "weather": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_40aeb7262f66498e", "output": "output" } ] } }, "name": "Format temperature", "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, "maxLength": 1024 }, "nullable": false, "handle": "message" } ], "name": "Format temperature", "moduleId": "n_d26dbbb38fa4a1a0", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_8e28a6a2be8a22e0": { "inputs": { "to": { "kind": "value", "value": "15555550123" }, "from": { "kind": "value", "value": "Vonage APIs" }, "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_4ab722873f19baf1", "output": "message" } ] }, "type": { "kind": "value", "value": "text" } }, "name": "Send Vonage SMS", "kind": "task", "task": { "inputs": [ { "description": "The sender name or number. Number senders use E.164 format; sender ID rules vary by country.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The sender name or number. Number senders use E.164 format; sender ID rules vary by country." }, "nullable": false, "handle": "from" }, { "description": "The destination number in E.164 format without a leading plus sign.", "jsonSchema": { "type": "string", "minLength": 7, "maxLength": 15, "pattern": "^[0-9]{7,15}$", "description": "The destination number in E.164 format without a leading plus sign." }, "nullable": false, "handle": "to" }, { "description": "The text body of the outbound SMS.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The text body of the outbound SMS." }, "nullable": false, "handle": "text" }, { "description": "The SMS text encoding.", "jsonSchema": { "type": "string", "enum": [ "text", "unicode" ], "description": "The SMS text encoding." }, "nullable": true, "handle": "type", "value": null }, { "description": "How long Vonage should attempt delivery, in milliseconds.", "jsonSchema": { "type": "integer", "minimum": 20000, "maximum": 604800000, "description": "How long Vonage should attempt delivery, in milliseconds." }, "nullable": true, "handle": "ttl", "value": null }, { "description": "Whether Vonage should request a delivery receipt.", "jsonSchema": { "type": "boolean", "description": "Whether Vonage should request a delivery receipt." }, "nullable": true, "handle": "statusReportRequired", "value": null }, { "description": "The delivery receipt callback URL for this message.", "jsonSchema": { "type": "string", "maxLength": 100, "format": "uri", "description": "The delivery receipt callback URL for this message." }, "nullable": true, "handle": "callback", "value": null }, { "description": "A caller-defined reference included in the submission result.", "jsonSchema": { "type": "string", "maxLength": 100, "description": "A caller-defined reference included in the submission result." }, "nullable": true, "handle": "clientRef", "value": null } ], "outputs": [ { "description": "The number of SMS submission results returned by Vonage.", "jsonSchema": { "type": "integer", "description": "The number of SMS submission results returned by Vonage." }, "nullable": false, "handle": "messageCount" }, { "description": "The submitted SMS results.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "to": { "type": "string", "description": "The destination number in E.164 format." }, "messageId": { "type": "string", "description": "The Vonage message identifier." }, "status": { "type": "string", "description": "The Vonage SMS status code." }, "remainingBalance": { "type": [ "string", "null" ], "description": "The estimated remaining account balance." }, "messagePrice": { "type": [ "string", "null" ], "description": "The estimated price of the message." }, "network": { "type": [ "string", "null" ], "description": "The destination network identifier." }, "clientRef": { "type": [ "string", "null" ], "description": "The caller-supplied client reference." } }, "required": [ "to", "messageId", "status", "remainingBalance", "messagePrice", "network", "clientRef" ], "additionalProperties": false, "description": "One normalized Vonage SMS submission result." }, "description": "The submitted SMS results." }, "nullable": false, "handle": "messages" } ], "name": "Send Vonage SMS", "executor": { "kind": "connector", "action": "vonage.send_sms" } } } }, "edges": [ { "source": "n_7e08b1ec2928dd9f", "target": "n_40aeb7262f66498e" }, { "source": "n_40aeb7262f66498e", "target": "n_4ab722873f19baf1" }, { "source": "n_4ab722873f19baf1", "target": "n_8e28a6a2be8a22e0" } ] } }, "modules": { "n_d26dbbb38fa4a1a0": { "name": "Format temperature", "imports": [], "source": "export default function weatherMessage({weather}){if(weather?.cod!==200||typeof weather?.main?.temp!=='number'||!Number.isFinite(weather.main.temp))throw Error('OpenWeather response has no current temperature');return{message:`Hey! The temperature outside is ${weather.main.temp}°C.`}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }