UNPKG

node-red-contrib-subflow2node

Version:

Node-RED node for converting subflow to node

1 lines 2.92 kB
[{"id":"21743993.2f52d6","type":"inject","z":"e7acef83.33105","name":"Generate","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":280,"wires":[["fe62988a.5192e8"]]},{"id":"fe62988a.5192e8","type":"template","z":"e7acef83.33105","name":"SUBFLOW definition","field":"payload","fieldType":"msg","format":"json","syntax":"plain","template":"[\n {\n \"id\": \"9fcd0f4a.e590e\",\n \"type\": \"subflow\",\n \"name\": \"Hello\",\n \"info\": \"Prepends a string \\\"`Hello `\\\" to input payload.\\n\\n# Inputs\\n\\n- `payload` _string_\\n\\n A string.\\n\\n# Outputs\\n\\n- `payload` _string_\\n\\n A string with \\\"`Hello `\\\" prepended to input payload.\\n\\n\\n\\n\\n\",\n \"category\": \"\",\n \"in\": [\n {\n \"x\": 60,\n \"y\": 80,\n \"wires\": [\n {\n \"id\": \"9353331c.26f6\"\n }\n ]\n }\n ],\n \"out\": [\n {\n \"x\": 340,\n \"y\": 80,\n \"wires\": [\n {\n \"id\": \"9353331c.26f6\",\n \"port\": 0\n }\n ]\n }\n ],\n \"env\": [],\n \"meta\": {\n \"module\": \"node-red-contrib-hello\",\n \"type\": \"hello\",\n \"version\": \"0.1.0\",\n \"author\": \"hiroyasu.nishiyama.uq@hitachi.com\",\n \"desc\": \"Node-RED node for hello.\",\n \"keywords\": \"Node-RED, hello world\",\n \"license\": \"Apache-2.0\"\n },\n \"color\": \"#3FADB5\",\n \"icon\": \"font-awesome/fa-fighter-jet\"\n },\n {\n \"id\": \"9353331c.26f6\",\n \"type\": \"function\",\n \"z\": \"9fcd0f4a.e590e\",\n \"name\": \"\",\n \"func\": \"msg.payload = \\\"Hello \\\"+ msg.payload;\\nreturn msg;\",\n \"outputs\": 1,\n \"noerr\": 0,\n \"initialize\": \"\",\n \"finalize\": \"\",\n \"x\": 200,\n \"y\": 80,\n \"wires\": [\n []\n ]\n }\n]","output":"json","x":420,"y":280,"wires":[["12c71b31.4ecaf5"]]},{"id":"12c71b31.4ecaf5","type":"sf to node","z":"e7acef83.33105","name":"Convert to NPM","base64":false,"encoding":"none","x":640,"y":280,"wires":[["3c64f5c1.fd044a"]]},{"id":"3c64f5c1.fd044a","type":"file","z":"e7acef83.33105","name":"","filename":"/tmp/sf2node.tgz","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":850,"y":280,"wires":[[]]},{"id":"934d574d.a28ff8","type":"comment","z":"e7acef83.33105","name":"↓ Output JSON format SUBFLOW definition","info":"","x":490,"y":240,"wires":[]}]