[
{
"id": "008f2793d8e0b213",
"type": "tab",
"label": "Flow 3",
"disabled": false,
"info": "",
"env": []
},
{
"id": "a31c98c0e6a8f44c",
"type": "inject",
"z": "008f2793d8e0b213",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "num",
"payload": "[10,20,30]",
"payloadType": "json",
"x": 160,
"y": 180,
"wires": [
[
"f38eccc2aa9fc71a"
]
]
},
{
"id": "f38eccc2aa9fc71a",
"type": "function",
"z": "008f2793d8e0b213",
"name": "function 2",
"func": "var num = msg.payload;\nvar sum = 0;\nfor (var i in num){\n sum+=num[i];\n}\nmsg.payload = `sum is ${sum}`\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 420,
"y": 180,
"wires": [
[
"42a45807b1f2b163"
]
]
},
{
"id": "42a45807b1f2b163",
"type": "debug",
"z": "008f2793d8e0b213",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 620,
"y": 180,
"wires": []
}
]
Comments