{ "kind": "open-flow-workflow", "version": 1, "name": "Publish ISS Position to ActiveMQ", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_7ed2d11f83c660f5": { "name": "Every minute", "kind": "cron", "cronTimes": [ { "type": "cron", "expression": "* * * * *", "timezone": "UTC" } ] }, "n_e18936e20d843410": { "inputs": {}, "name": "Prepare the position URL", "kind": "task", "task": { "inputs": [], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" } ], "name": "Prepare the position URL", "moduleId": "n_6b08a585b6538d5a", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_c4611d20cc9dff68": { "inputs": { "url": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e18936e20d843410", "output": "url" } ] } }, "name": "Get the ISS position", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Get the ISS position", "executor": { "method": "GET", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "authentication": { "type": "none" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_77cb7ed66ec59192": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c4611d20cc9dff68", "output": "body" } ] } }, "name": "Prepare the topic message", "kind": "task", "task": { "inputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": { "anyOf": [ { "type": [ "string", "number", "boolean" ] }, { "type": "array", "items": { "type": [ "string", "number", "boolean" ] } } ] } }, "nullable": false, "handle": "body" } ], "name": "Prepare the topic message", "moduleId": "n_17c6ae2da971a0af", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_17dabfc413fc280d": { "inputs": { "url": { "kind": "value", "value": "https://example.com/api/message?destination=topic%3A%2F%2Fiss-position" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_77cb7ed66ec59192", "output": "body" } ] }, "auth.username": { "kind": "unset" }, "auth.password": { "kind": "unset" } }, "name": "Publish to the topic", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": { "type": "object", "additionalProperties": { "anyOf": [ { "type": [ "string", "number", "boolean" ] }, { "type": "array", "items": { "type": [ "string", "number", "boolean" ] } } ] } }, "nullable": false, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.username" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.password" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Publish to the topic", "executor": { "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "form", "authentication": { "type": "basic" }, "responseFormat": "text", "statusPolicy": "success", "kind": "http-request" } } } }, "edges": [ { "source": "n_7ed2d11f83c660f5", "target": "n_e18936e20d843410" }, { "source": "n_e18936e20d843410", "target": "n_c4611d20cc9dff68" }, { "source": "n_c4611d20cc9dff68", "target": "n_77cb7ed66ec59192" }, { "source": "n_77cb7ed66ec59192", "target": "n_17dabfc413fc280d" } ] } }, "modules": { "n_6b08a585b6538d5a": { "name": "Prepare the position URL", "imports": [], "source": "export default function () {\n return {url:'https://api.wheretheiss.at/v1/satellites/25544/positions?timestamps='+Math.floor(Date.now()/1000)};\n}\n" }, "n_17c6ae2da971a0af": { "name": "Prepare the topic message", "imports": [], "source": "export default function ({body}) {\n const p=Array.isArray(body)?body[0]:null;\n if(!p||typeof p.name!=='string'||!Number.isFinite(p.latitude)||!Number.isFinite(p.longitude)||!Number.isFinite(p.timestamp)) throw Error('Invalid ISS position response');\n return {body:{body:JSON.stringify({Name:p.name,Latitude:p.latitude,Longitude:p.longitude,Timestamp:p.timestamp})}};\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }