How to create a sequence to send msg one after another instead in parallel

Like the image shows. I want to chain the msgs that are being sent with a small delay in between them. Currently function just spits out the array with the list and everything gets triggered all at once because of that.

NodeRed Version v1.0.3

Hello @shivam422, welcome to the forum :grinning:

It is possible to use a Delay node in Rate Limit mode to send one message every 3 seconds

We have a picture of your flow but not the code, so I don't know why your function node sends 8 messages in parallel rather than just one. What does the function do? There may be a better way to structure it.

I see that you have a trigger node "resend every 3s". Each message produces 8 more, you want each of those at 3 second intervals so it takes 24s to completely process each input message. Whatever queue mechanism you use will eventually be overwhelmed.

Here is a complete look at the process that I am trying to accomplish. And I do think its being overwhelmed because the process is very slow to get data.

So essentially the function node just pushed 8 IPs out at the same time and the flow below will essentially make HTTP request to get the data using those 8 IPs. But all of this is being done in parallel and is very slow. There may be a better way of doing this flow and I will post the code also.

[{"id":"d28b3d7c.798e7","type":"link out","z":"ac84fbfe.787f58","name":"ESS4_IP","links":["cc4f73ce.1650a","d38da3c7.aef91","5a2f0db7.506394","1796094a.d25a4f","3ceef24c.3b5e2e","f48916a3.78bc68","ba4d1c2.be68de"],"x":875,"y":420,"wires":[]},{"id":"262ef82d.2f0e98","type":"link out","z":"ac84fbfe.787f58","name":"ESS5_IP","links":["f48916a3.78bc68"],"x":875,"y":460,"wires":[]},{"id":"926bb0ce.09b3d","type":"link out","z":"ac84fbfe.787f58","name":"ESS6_IP","links":["68968473.e2b87c","b482a2d4.10956","3666600b.767","2c30ece3.d12be4","8715e8e4.20c3","f48916a3.78bc68","c98bdb34.73c708"],"x":875,"y":500,"wires":[]},{"id":"b7e8cc07.a3d4f","type":"link out","z":"ac84fbfe.787f58","name":"ESS7_IP","links":["40d375cb.bc991c","2d495008.65129","b25d95da.972d38","7c104aff.b6f674","1245ef64.6fe729","f48916a3.78bc68","a35c60df.3acca"],"x":875,"y":540,"wires":[]},{"id":"b4cbef22.dc361","type":"link out","z":"ac84fbfe.787f58","name":"ESS0_IP","links":["bdc4b31b.75d23","4446e954.18dbe8","8e696203.2a38a","8094f947.0920d","b25ad35a.33db8","a3423268.1bfd1","f48916a3.78bc68","b83e5150.d171f"],"x":875,"y":260,"wires":[]},{"id":"62d2e6c4.80b5c8","type":"link out","z":"ac84fbfe.787f58","name":"ESS1_IP","links":["4020a322.82541c","5f705eb.2e2cba","cc5e743f.23a818","7032a317.252134","a5aeedfb.6b6438","f48916a3.78bc68","910b5a46.5b4038"],"x":875,"y":300,"wires":[]},{"id":"c13d462e.870c68","type":"link out","z":"ac84fbfe.787f58","name":"ESS2_IP","links":["2007da4a.1968d6","9ca6f5fb.206cd8","34792eed.67bac2","f2617efa.f1fc1","330d2097.f2de","f48916a3.78bc68","5e19496b.1c09b8"],"x":875,"y":340,"wires":[]},{"id":"575f33ea.0a264c","type":"link out","z":"ac84fbfe.787f58","name":"ESS3_IP","links":["ab9ecd6.329153","fb7b0797.f789f8","b5032a9a.931578","bf2bf7d6.e5f76","9046de32.655d88","f48916a3.78bc68","edbe7355.b3df4"],"x":875,"y":380,"wires":[]},{"id":"a90bc67f.2ae568","type":"trigger","z":"ac84fbfe.787f58","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"-3","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":480,"y":400,"wires":[["bfd2dec.4751c2"]]},{"id":"bfd2dec.4751c2","type":"function","z":"ac84fbfe.787f58","name":"Make Array List","func":"var IP_list = [];\nvar numOfESS = global.get(\"NumberofESS\");\n\nIP_list.push(global.get(\"ESS0_IP\"));\nIP_list.push(global.get(\"ESS1_IP\"));\nIP_list.push(global.get(\"ESS2_IP\"));\nIP_list.push(global.get(\"ESS3_IP\"));\nIP_list.push(global.get(\"ESS4_IP\"));\nIP_list.push(global.get(\"ESS5_IP\"));\nIP_list.push(global.get(\"ESS6_IP\"));\nIP_list.push(global.get(\"ESS7_IP\"));\n\n\nvar msgArray = [];\n\nfor(var i = 0; i < numOfESS+1; i++)\n{\n    var myvalue = IP_list[i];\n    var ESSIP = {\n        \"topic\": \"manualConfig\",\n        \"payload\": myvalue\n    };\n    msgArray.push(ESSIP);\n}\nreturn msgArray;","outputs":"8","noerr":0,"x":680,"y":400,"wires":[["b4cbef22.dc361","dd0bebb4.f47388"],["62d2e6c4.80b5c8"],["c13d462e.870c68"],["575f33ea.0a264c"],["d28b3d7c.798e7"],["262ef82d.2f0e98"],["926bb0ce.09b3d"],["b7e8cc07.a3d4f"]]},{"id":"7ee8bbb8.bd19e4","type":"hmi-tag out","z":"ac84fbfe.787f58","sse":"4ed039a6.814638","hmiID":"FinishBtn","name":"FinishBtn","all":false,"x":180,"y":400,"wires":[["798bec19.c2f5c4"]]},{"id":"798bec19.c2f5c4","type":"delay","z":"ac84fbfe.787f58","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":320,"y":400,"wires":[["a90bc67f.2ae568"]]},{"id":"dd0bebb4.f47388","type":"debug","z":"ac84fbfe.787f58","name":"","active":false,"console":"false","complete":"false","x":690,"y":260,"wires":[]},{"id":"10a1e169.32c77f","type":"comment","z":"ac84fbfe.787f58","name":"Send First","info":"","x":960,"y":260,"wires":[]},{"id":"e80a984b.59dde8","type":"comment","z":"ac84fbfe.787f58","name":"Send Second after First Msg is sent and 3sec delay","info":"","x":1090,"y":300,"wires":[]},{"id":"300bc592.1175ea","type":"comment","z":"ac84fbfe.787f58","name":"Send Third after Second Msg is sent and 3sec delay","info":"","x":1090,"y":340,"wires":[]},{"id":"f4910859.2be208","type":"comment","z":"ac84fbfe.787f58","name":"And so on","info":"","x":960,"y":380,"wires":[]},{"id":"ec45d109.b5144","type":"http request","z":"ac84fbfe.787f58","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"http://{{payload}}/scib_data.dat","tls":"","persist":false,"proxy":"","authType":"","x":470,"y":680,"wires":[["849bc568.57f898"]]},{"id":"b83e5150.d171f","type":"link in","z":"ac84fbfe.787f58","name":"","links":["101d5d7.69c5aa3","b4cbef22.dc361"],"x":135,"y":680,"wires":[["24e6f8a2.69f518"]]},{"id":"afa587f8.0cb5e8","type":"function","z":"ac84fbfe.787f58","name":"ESS0 Array","func":"var scib_data = [];\nscib_data = msg.payload.split(\",\");\n\nif(scib_data.length === 1301)\n{\n    var msgObj = {\n        \"topic\": \"ESS0_scib_data\",\n        \"payload\": scib_data \n    };\n\n    return msgObj;\n}\n","outputs":1,"noerr":0,"x":870,"y":680,"wires":[["22fa886b.9fafc8"]]},{"id":"22fa886b.9fafc8","type":"link out","z":"ac84fbfe.787f58","name":"ESS0_SCiB_Data","links":["15b92071.1243d8","380e4a7f.4d9e0e","3d1a3cf0.bc86ac","4306f4ad.bc44b4","43940eae.9e223","44eca295.f73624","4bf232f6.158ddc","52bf7c34.0be29c","5ac5b391.ff4fe4","60714bd8.9477ac","b6c8a76d.317468","6a308538.525834","ce4a4b08.3e7138","7eb18dae.bb01ac","7f3571f6.55bca","8386ceef.6be938","98c6c439.e55d1","9d00007e.9ade08","a7af261d.97935","a9acb806.ffcf7","b7790be6.3fccd","bda894e3.be0c5","c48017ef.94d2d8","d7cae3aa.a7481","d7d5a51a.054bb8","d88dfc4a.9c4a08","8d9976a6.e19828","e2daf4cd.fa8da8","73d0ae0b.bac0e","fb4930fe.f736d","36eb2277.476fd6","222d1dc.34090e2","779a8dbd.d3ed7c","bae13a7b.046678","460de62b.bc431","a0c42d4c.6446d8","761d6000.f159e8","161162d7.41c1bd","4c322c2a.a3d10c","4d772141.e0809","3f8caaf4.79dba6","c7391f7f.843258","64746faf.8442e8","439725b0.7ce22c","9e362331.6cb79","e0453f06.be9b3","bd9f4d9b.c7b26","c0677abb.596f18","c02f7bc1.14e678","9d8419ab.e9cfe8"],"x":1015,"y":680,"wires":[]},{"id":"9107ae39.20c65","type":"http request","z":"ac84fbfe.787f58","name":"","method":"GET","ret":"txt","url":"http://{{payload}}/scib_data.dat","tls":"","x":470,"y":720,"wires":[["e915a370.1241a"]]},{"id":"910b5a46.5b4038","type":"link in","z":"ac84fbfe.787f58","name":"","links":["d7015f91.9b85c","62d2e6c4.80b5c8"],"x":135,"y":720,"wires":[["fa08ce32.64be3"]]},{"id":"950a02.3367a6","type":"function","z":"ac84fbfe.787f58","name":"ESS1 Array","func":"var scib_data = [];\nscib_data = msg.payload.split(\",\");\n\nif(scib_data.length === 1301)\n{\n    var msgObj = {\n        \"topic\": \"ESS1_scib_data\",\n        \"payload\": scib_data \n    };\n\n    return msgObj;\n}\n","outputs":1,"noerr":0,"x":870,"y":720,"wires":[["c33b80a5.87f4d"]]},{"id":"c33b80a5.87f4d","type":"link out","z":"ac84fbfe.787f58","name":"ESS1_SCiB_Data","links":["f617121c.99fbc8","65dd7343.eca03c","c48017ef.94d2d8","e9e6cb4e.1e1fc8","9f71764c.d2253","d7d5a51a.054bb8","60714bd8.9477ac","7f3571f6.55bca","15b92071.1243d8","fb4930fe.f736d","380e4a7f.4d9e0e","d7cae3aa.a7481","4bf232f6.158ddc","98c6c439.e55d1","e2daf4cd.fa8da8","7f356150.417fe","a9acb806.ffcf7","8d9976a6.e19828","ee0d66c1.baa0a8","b999b56d.35acb8","cd8a3013.f9217","b6c8a76d.317468","27e578ce.e01da8","dab00929.23e2f8","d9ba8769.d9b178","942dc19c.d1bb48","6b429525.9585ec","34bd6015.b6694","7d9c53d4.ac2814","8a2f0979.98066","dc9dd1ef.c96f9","6a308538.525834","bda894e3.be0c5","4306f4ad.bc44b4","b7790be6.3fccd","43940eae.9e223","d88dfc4a.9c4a08","5ac5b391.ff4fe4","52bf7c34.0be29c","8386ceef.6be938","a7af261d.97935","c2fee095.e63e28","cc65911a.4a1fd8","36eb2277.476fd6","222d1dc.34090e2","779a8dbd.d3ed7c","bae13a7b.046678","460de62b.bc431","a0c42d4c.6446d8","761d6000.f159e8","161162d7.41c1bd","4c322c2a.a3d10c","4d772141.e0809","3f8caaf4.79dba6","c7391f7f.843258","63f65253.fbd45c","439725b0.7ce22c","9e362331.6cb79","c538ee2.7ce341","bd9f4d9b.c7b26","c0677abb.596f18","c02f7bc1.14e678","9d8419ab.e9cfe8"],"x":1015,"y":720,"wires":[]},{"id":"281fadd8.3a6d72","type":"http request","z":"ac84fbfe.787f58","name":"","method":"GET","ret":"txt","url":"http://{{payload}}/scib_data.dat","tls":"","x":470,"y":760,"wires":[["42c0785f.5990d8"]]},{"id":"5e19496b.1c09b8","type":"link in","z":"ac84fbfe.787f58","name":"","links":["69c069c5.10eac8","be43cc79.921cc","e969367e.ea44d8","aaee1bc4.0c20a8","c13d462e.870c68"],"x":135,"y":760,"wires":[["6d5c2207.21e34c"]]},{"id":"80104bec.ad1838","type":"function","z":"ac84fbfe.787f58","name":"ESS2 Array","func":"var scib_data = [];\nscib_data = msg.payload.split(\",\");\n\nif(scib_data.length === 1301)\n{\n    var msgObj = {\n        \"topic\": \"ESS2_scib_data\",\n        \"payload\": scib_data \n    };\n\n    return msgObj;\n}\n","outputs":1,"noerr":0,"x":870,"y":760,"wires":[["fd249a4.a675b68"]]},{"id":"fd249a4.a675b68","type":"link out","z":"ac84fbfe.787f58","name":"ESS2_SCiB_Data","links":["6b93e11d.67e3f","8f434e40.ac2f2","e34612b7.d8786","951bcc9d.6bf66","32c1a61e.77c0ca","90ababbf.6fff98","c48017ef.94d2d8","d7d5a51a.054bb8","60714bd8.9477ac","7f3571f6.55bca","15b92071.1243d8","fb4930fe.f736d","380e4a7f.4d9e0e","d7cae3aa.a7481","4bf232f6.158ddc","98c6c439.e55d1","e2daf4cd.fa8da8","7f356150.417fe","a9acb806.ffcf7","8d9976a6.e19828","e64532f7.4b24a","cd8a3013.f9217","b6c8a76d.317468","27e578ce.e01da8","fd68c7d3.27b6a8","fc4fce61.4909b","c78aaf91.84a678","68661889.2a17b8","819c77bc.088dd","77ef9d69.6c68f4","8a2f0979.98066","dc9dd1ef.c96f9","6a308538.525834","bda894e3.be0c5","4306f4ad.bc44b4","b7790be6.3fccd","43940eae.9e223","d88dfc4a.9c4a08","5ac5b391.ff4fe4","52bf7c34.0be29c","8386ceef.6be938","a7af261d.97935","689fc2d5.6fabbc","be0ac0e0.da009","36eb2277.476fd6","222d1dc.34090e2","779a8dbd.d3ed7c","bae13a7b.046678","460de62b.bc431","a0c42d4c.6446d8","761d6000.f159e8","161162d7.41c1bd","4c322c2a.a3d10c","4d772141.e0809","3f8caaf4.79dba6","c7391f7f.843258","e70df9fa.dce168","439725b0.7ce22c","9e362331.6cb79","b10926ba.8eb978","bd9f4d9b.c7b26","c0677abb.596f18","c02f7bc1.14e678","9d8419ab.e9cfe8"],"x":1015,"y":760,"wires":[]},{"id":"48bcd78f.b46768","type":"http request","z":"ac84fbfe.787f58","name":"","method":"GET","ret":"txt","url":"http://{{payload}}/scib_data.dat","tls":"","x":470,"y":800,"wires":[["ad20300e.3e5d5"]]},{"id":"edbe7355.b3df4","type":"link in","z":"ac84fbfe.787f58","name":"","links":["5607913a.3b715","e72865d.9b2ea98","5de9fcc7.a52a44","cb4df088.c37a7","575f33ea.0a264c"],"x":135,"y":800,"wires":[["d05f3e8e.46d2d"]]},{"id":"f6ebfca7.db298","type":"function","z":"ac84fbfe.787f58","name":"ESS3 Array","func":"var scib_data = [];\nscib_data = msg.payload.split(\",\");\n\nif(scib_data.length === 1301)\n{\n    var msgObj = {\n        \"topic\": \"ESS3_scib_data\",\n        \"payload\": scib_data \n    };\n\n    return msgObj;\n}\n","outputs":1,"noerr":0,"x":870,"y":800,"wires":[["4f24a0a9.9320f"]]},{"id":"4f24a0a9.9320f","type":"link out","z":"ac84fbfe.787f58","name":"ESS3_SCiB_Data","links":["59d842a0.274dfc","9c83f611.44fa18","35171921.536e56","fc2f4958.9ee8f8","1953dd50.369863","a0bf1572.503428","95373c5b.f3e82","1a4fd22f.074b0e","4e0d2941.3ec23","4ec2486b.e1b94","c48017ef.94d2d8","d7d5a51a.054bb8","60714bd8.9477ac","7f3571f6.55bca","15b92071.1243d8","fb4930fe.f736d","380e4a7f.4d9e0e","d7cae3aa.a7481","4bf232f6.158ddc","98c6c439.e55d1","e2daf4cd.fa8da8","7f356150.417fe","a9acb806.ffcf7","8d9976a6.e19828","a54f1f5a.694fc","cd8a3013.f9217","b6c8a76d.317468","27e578ce.e01da8","ccf7c9d6.913228","77270079.d0058","6519c7af.fd98d8","aa175825.dd8d88","35b91879.d6de98","39bf6e.f4f66092","8a2f0979.98066","dc9dd1ef.c96f9","6a308538.525834","bda894e3.be0c5","4306f4ad.bc44b4","b7790be6.3fccd","43940eae.9e223","d88dfc4a.9c4a08","5ac5b391.ff4fe4","52bf7c34.0be29c","8386ceef.6be938","a7af261d.97935","695f9ad5.3cbf54","677c6d38.c0904c","36eb2277.476fd6","222d1dc.34090e2","779a8dbd.d3ed7c","bae13a7b.046678","460de62b.bc431","a0c42d4c.6446d8","761d6000.f159e8","161162d7.41c1bd","4c322c2a.a3d10c","4d772141.e0809","3f8caaf4.79dba6","c7391f7f.843258","1940a57d.fe197b","439725b0.7ce22c","9e362331.6cb79","f5301e90.e0a07","bd9f4d9b.c7b26","c0677abb.596f18","c02f7bc1.14e678","9d8419ab.e9cfe8"],"x":1015,"y":800,"wires":[]},{"id":"a465023b.afa08","type":"http request","z":"ac84fbfe.787f58","name":"","method":"GET","ret":"txt","url":"http://{{payload}}/scib_data.dat","tls":"","x":470,"y":840,"wires":[["19a48ded.6fc032"]]},{"id":"ba4d1c2.be68de","type":"link in","z":"ac84fbfe.787f58","name":"","links":["9bfaef70.1d8de","d28b3d7c.798e7"],"x":135,"y":840,"wires":[["b48e6c13.65cde"]]},{"id":"a4f05c16.bebfb","type":"function","z":"ac84fbfe.787f58","name":"ESS4 Array","func":"var scib_data = [];\nscib_data = msg.payload.split(\",\");\n\nif(scib_data.length === 1301)\n{\n    var msgObj = {\n        \"topic\": \"ESS4_scib_data\",\n        \"payload\": scib_data \n    };\n\n    return msgObj;\n}\n","outputs":1,"noerr":0,"x":870,"y":840,"wires":[["b1f29a3d.9a8e38"]]},{"id":"b1f29a3d.9a8e38","type":"link out","z":"ac84fbfe.787f58","name":"ESS4_SCiB_Data","links":["59d842a0.274dfc","9c83f611.44fa18","35171921.536e56","fc2f4958.9ee8f8","2cf7dc3d.966384","bf189722.0a9ee8","e3d380ce.955dc","c6c981c0.abe638","2d45585b.01ad38","9d1de213.e631e","c48017ef.94d2d8","d7d5a51a.054bb8","60714bd8.9477ac","7f3571f6.55bca","15b92071.1243d8","fb4930fe.f736d","380e4a7f.4d9e0e","d7cae3aa.a7481","4bf232f6.158ddc","98c6c439.e55d1","e2daf4cd.fa8da8","7f356150.417fe","a9acb806.ffcf7","8d9976a6.e19828","57b5542a.26fafc","cd8a3013.f9217","b6c8a76d.317468","27e578ce.e01da8","4adc0af7.3b5c04","4bd66521.0caefc","6761d451.bbaeec","fd538dc8.dbc7a","56edeb8c.f71504","be18641a.2277c","8a2f0979.98066","dc9dd1ef.c96f9","6a308538.525834","bda894e3.be0c5","4306f4ad.bc44b4","b7790be6.3fccd","43940eae.9e223","d88dfc4a.9c4a08","5ac5b391.ff4fe4","52bf7c34.0be29c","8386ceef.6be938","a7af261d.97935","646c6c40.0144e4","1815d083.0255ef","36eb2277.476fd6","222d1dc.34090e2","779a8dbd.d3ed7c","bae13a7b.046678","460de62b.bc431","a0c42d4c.6446d8","761d6000.f159e8","161162d7.41c1bd","4c322c2a.a3d10c","4d772141.e0809","3f8caaf4.79dba6","c7391f7f.843258","30dfc39b.5956d4","439725b0.7ce22c","9e362331.6cb79","4241520d.ae4eac","bd9f4d9b.c7b26","c0677abb.596f18","c02f7bc1.14e678","9d8419ab.e9cfe8"],"x":1015,"y":840,"wires":[]},{"id":"c7262c.8b0e29d8","type":"http request","z":"ac84fbfe.787f58","name":"","method":"GET","ret":"txt","url":"http://{{payload}}/scib_data.dat","tls":"","x":470,"y":880,"wires":[["46c453e5.3aa42c"]]},{"id":"7711498c.d248b8","type":"link in","z":"ac84fbfe.787f58","name":"","links":["18e41b57.69f3c5","d5bf6d87.18ee","ed2c540c.ec61a8","b567d5bd.8fc7f8"],"x":135,"y":880,"wires":[["4887ec59.649114"]]},{"id":"34e3ee87.3691b2","type":"function","z":"ac84fbfe.787f58","name":"ESS5 Array","func":"var scib_data = [];\nscib_data = msg.payload.split(\",\");\n\nif(scib_data.length === 1301)\n{\n    var msgObj = {\n        \"topic\": \"ESS5_scib_data\",\n        \"payload\": scib_data \n    };\n\n    return msgObj;\n}\n\n","outputs":1,"noerr":0,"x":870,"y":880,"wires":[["f4089370.00229"]]},{"id":"f4089370.00229","type":"link out","z":"ac84fbfe.787f58","name":"ESS5_SCiB_Data","links":["59d842a0.274dfc","9c83f611.44fa18","35171921.536e56","fc2f4958.9ee8f8","88b0183.5989ce8","e131624.5b23fa","cfc0efa.558911","9b750534.2708d","267ce5c.1058b9a","6018fb4e.8b6884","c48017ef.94d2d8","d7d5a51a.054bb8","60714bd8.9477ac","7f3571f6.55bca","15b92071.1243d8","fb4930fe.f736d","380e4a7f.4d9e0e","d7cae3aa.a7481","4bf232f6.158ddc","98c6c439.e55d1","e2daf4cd.fa8da8","7f356150.417fe","a9acb806.ffcf7","8d9976a6.e19828","61bc4927.2b3a28","cd8a3013.f9217","b6c8a76d.317468","27e578ce.e01da8","b7890063.8d778","1192f2e9.1e0225","b9bfce6e.ad7d2","44a70475.28f374","e60e7a10.849c5","853df1e1.e0dab8","8a2f0979.98066","dc9dd1ef.c96f9","6a308538.525834","bda894e3.be0c5","4306f4ad.bc44b4","b7790be6.3fccd","43940eae.9e223","d88dfc4a.9c4a08","5ac5b391.ff4fe4","52bf7c34.0be29c","8386ceef.6be938","a7af261d.97935","67dd2275.39739c","53d52b30.116fcc","36eb2277.476fd6","222d1dc.34090e2","779a8dbd.d3ed7c","bae13a7b.046678","460de62b.bc431","a0c42d4c.6446d8","761d6000.f159e8","161162d7.41c1bd","4c322c2a.a3d10c","4d772141.e0809","3f8caaf4.79dba6","c7391f7f.843258","d7667582.dc1278","d7667582.dc1278","439725b0.7ce22c","9e362331.6cb79","acb05037.d5ddb","bd9f4d9b.c7b26","c0677abb.596f18","c02f7bc1.14e678","9d8419ab.e9cfe8"],"x":1015,"y":880,"wires":[]},{"id":"a79dc8cf.460d08","type":"http request","z":"ac84fbfe.787f58","name":"","method":"GET","ret":"txt","url":"http://{{payload}}/scib_data.dat","tls":"","x":470,"y":920,"wires":[["9f599780.d372b8"]]},{"id":"c98bdb34.73c708","type":"link in","z":"ac84fbfe.787f58","name":"","links":["776f1ae7.65c0a4","2e765e46.b6cde2","f48d0504.c27d58","6aca68a5.0b7de","926bb0ce.09b3d"],"x":135,"y":920,"wires":[["ed067622.320a78"]]},{"id":"c44a5354.f4a4d","type":"function","z":"ac84fbfe.787f58","name":"ESS6 Array","func":"var scib_data = [];\nscib_data = msg.payload.split(\",\");\n\nif(scib_data.length === 1301)\n{\n    var msgObj = {\n        \"topic\": \"ESS6_scib_data\",\n        \"payload\": scib_data \n    };\n\n    return msgObj;\n}\n","outputs":1,"noerr":0,"x":870,"y":920,"wires":[["3a9d366f.7ed47a"]]},{"id":"3a9d366f.7ed47a","type":"link out","z":"ac84fbfe.787f58","name":"ESS6_SCiB_Data","links":["59d842a0.274dfc","9c83f611.44fa18","35171921.536e56","fc2f4958.9ee8f8","768ba19d.8f5d9","ace45a3c.322318","b0ebcabf.d77a68","b4a34fc6.8e7998","aa095ca3.e64488","bb4a81e0.361d1","c48017ef.94d2d8","d7d5a51a.054bb8","60714bd8.9477ac","7f3571f6.55bca","15b92071.1243d8","fb4930fe.f736d","380e4a7f.4d9e0e","d7cae3aa.a7481","4bf232f6.158ddc","98c6c439.e55d1","e2daf4cd.fa8da8","7f356150.417fe","a9acb806.ffcf7","8d9976a6.e19828","44ab68e6.003278","cd8a3013.f9217","b6c8a76d.317468","27e578ce.e01da8","84924cf4.09df7","532c38ba.fbc84","bb82b4aa.4337f","aa7b1d2e.ada048","c5c86150.4c768","b0296d4f.b3b328","8a2f0979.98066","dc9dd1ef.c96f9","6a308538.525834","bda894e3.be0c5","4306f4ad.bc44b4","b7790be6.3fccd","43940eae.9e223","d88dfc4a.9c4a08","5ac5b391.ff4fe4","52bf7c34.0be29c","8386ceef.6be938","a7af261d.97935","a2d33085.5aded","7b407071.93b2f","36eb2277.476fd6","222d1dc.34090e2","779a8dbd.d3ed7c","bae13a7b.046678","460de62b.bc431","a0c42d4c.6446d8","761d6000.f159e8","161162d7.41c1bd","4c322c2a.a3d10c","4d772141.e0809","3f8caaf4.79dba6","c7391f7f.843258","5c5fb5e7.0e614c","439725b0.7ce22c","9e362331.6cb79","c75f2a53.955f48","bd9f4d9b.c7b26","c0677abb.596f18","c02f7bc1.14e678","9d8419ab.e9cfe8"],"x":1015,"y":920,"wires":[]},{"id":"f6ae2410.fbce68","type":"http request","z":"ac84fbfe.787f58","name":"","method":"GET","ret":"txt","url":"http://{{payload}}/scib_data.dat","tls":"","x":470,"y":960,"wires":[["6d77eb6a.670fd4"]]},{"id":"a35c60df.3acca","type":"link in","z":"ac84fbfe.787f58","name":"","links":["fe6cf323.d11da","c05dba77.698af8","1eb9c60f.127e0a","982b6785.d63bd8","b7e8cc07.a3d4f"],"x":135,"y":960,"wires":[["da73e300.09e11"]]},{"id":"cbdf4f3c.8e62f","type":"function","z":"ac84fbfe.787f58","name":"ESS7 Array","func":"var scib_data = [];\nscib_data = msg.payload.split(\",\");\n\nif(scib_data.length === 1301)\n{\n    var msgObj = {\n        \"topic\": \"ESS7_scib_data\",\n        \"payload\": scib_data \n    };\n\n    return msgObj;\n}\n","outputs":1,"noerr":0,"x":870,"y":960,"wires":[["bffee3af.3bf19"]]},{"id":"bffee3af.3bf19","type":"link out","z":"ac84fbfe.787f58","name":"ESS7_SCiB_Data","links":["59d842a0.274dfc","9c83f611.44fa18","35171921.536e56","fc2f4958.9ee8f8","7238614b.c6736","bd59dc3f.a029","c0ce8af9.f152a8","f372a508.06256","fe3e62bb.a0a6d","b4d47d53.dceab8","c48017ef.94d2d8","d7d5a51a.054bb8","60714bd8.9477ac","7f3571f6.55bca","15b92071.1243d8","fb4930fe.f736d","380e4a7f.4d9e0e","d7cae3aa.a7481","4bf232f6.158ddc","98c6c439.e55d1","e2daf4cd.fa8da8","7f356150.417fe","a9acb806.ffcf7","8d9976a6.e19828","cd3c5dd0.89a0b","cd8a3013.f9217","b6c8a76d.317468","27e578ce.e01da8","b8512b16.dcab28","b6894810.855cd8","384625a9.420eda","a321c992.dc715","d94ad11e.fcc63","1a6bad00.62220b","8a2f0979.98066","dc9dd1ef.c96f9","6a308538.525834","bda894e3.be0c5","4306f4ad.bc44b4","b7790be6.3fccd","43940eae.9e223","d88dfc4a.9c4a08","5ac5b391.ff4fe4","52bf7c34.0be29c","8386ceef.6be938","a7af261d.97935","8200be50.a9b07","7c39134a.b67ab4","36eb2277.476fd6","222d1dc.34090e2","779a8dbd.d3ed7c","bae13a7b.046678","460de62b.bc431","a0c42d4c.6446d8","761d6000.f159e8","161162d7.41c1bd","4c322c2a.a3d10c","4d772141.e0809","3f8caaf4.79dba6","c7391f7f.843258","46284239.a9af8c","439725b0.7ce22c","9e362331.6cb79","564ada7b.f4e0d4","bd9f4d9b.c7b26","c0677abb.596f18","c02f7bc1.14e678","9d8419ab.e9cfe8"],"x":1015,"y":960,"wires":[]},{"id":"24e6f8a2.69f518","type":"delay","z":"ac84fbfe.787f58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":680,"wires":[["ec45d109.b5144"]]},{"id":"fa08ce32.64be3","type":"delay","z":"ac84fbfe.787f58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":720,"wires":[["9107ae39.20c65"]]},{"id":"6d5c2207.21e34c","type":"delay","z":"ac84fbfe.787f58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":760,"wires":[["281fadd8.3a6d72"]]},{"id":"d05f3e8e.46d2d","type":"delay","z":"ac84fbfe.787f58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":800,"wires":[["48bcd78f.b46768"]]},{"id":"b48e6c13.65cde","type":"delay","z":"ac84fbfe.787f58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":840,"wires":[["a465023b.afa08"]]},{"id":"4887ec59.649114","type":"delay","z":"ac84fbfe.787f58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":880,"wires":[["c7262c.8b0e29d8"]]},{"id":"ed067622.320a78","type":"delay","z":"ac84fbfe.787f58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":920,"wires":[["a79dc8cf.460d08"]]},{"id":"da73e300.09e11","type":"delay","z":"ac84fbfe.787f58","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":960,"wires":[["f6ae2410.fbce68"]]},{"id":"849bc568.57f898","type":"switch","z":"ac84fbfe.787f58","name":"200 success?","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":660,"y":680,"wires":[["afa587f8.0cb5e8"],[]]},{"id":"e915a370.1241a","type":"switch","z":"ac84fbfe.787f58","name":"200 success?","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":660,"y":720,"wires":[["950a02.3367a6"],[]]},{"id":"42c0785f.5990d8","type":"switch","z":"ac84fbfe.787f58","name":"200 success?","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":660,"y":760,"wires":[["80104bec.ad1838"],[]]},{"id":"ad20300e.3e5d5","type":"switch","z":"ac84fbfe.787f58","name":"200 success?","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":660,"y":800,"wires":[["f6ebfca7.db298"],[]]},{"id":"19a48ded.6fc032","type":"switch","z":"ac84fbfe.787f58","name":"200 success?","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":660,"y":840,"wires":[["a4f05c16.bebfb"],[]]},{"id":"46c453e5.3aa42c","type":"switch","z":"ac84fbfe.787f58","name":"200 success?","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":660,"y":880,"wires":[["34e3ee87.3691b2"],[]]},{"id":"9f599780.d372b8","type":"switch","z":"ac84fbfe.787f58","name":"200 success?","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":660,"y":920,"wires":[["c44a5354.f4a4d"],[]]},{"id":"6d77eb6a.670fd4","type":"switch","z":"ac84fbfe.787f58","name":"200 success?","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":660,"y":960,"wires":[["cbdf4f3c.8e62f"],[]]},{"id":"cc6ec10f.48f47","type":"comment","z":"ac84fbfe.787f58","name":"All 8 IPs send HTTP request","info":"","x":240,"y":640,"wires":[]},{"id":"24756f76.fd7be","type":"comment","z":"ac84fbfe.787f58","name":"Parse out and Send it to other flows","info":"","x":900,"y":640,"wires":[]},{"id":"4ed039a6.814638","type":"hmi-sse","z":"","name":"JMobile","host":"127.0.0.1","port":"80","period":"100"}]

Seems to be a lot of duplication
I would create the array of ip's, then split them into separte messages. Then rate limit msg's, run each http request. Once request responds flush next msg from rate limit, then rejoin the array splits. Once all split msg's have rejoined delay a few seconds and repeat. You can break the loop with simple gate or something similar. I have added an inject you can break the loop by injecting when 5 second delay is running.
e.g.

[{"id":"bfd2dec.4751c2","type":"function","z":"452103ea51141731","name":"Make Array List","func":"const esp_list =[\n    \"ESS0_IP\", \n    \"ESS1_IP\", \n    \"ESS2_IP\", \n    \"ESS3_IP\"\n];\nmsg.payload = global.get(esp_list);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":4220,"wires":[["dd0bebb4.f47388","c18cc7569aa84461"]]},{"id":"7ee8bbb8.bd19e4","type":"hmi-tag out","z":"452103ea51141731","sse":"4ed039a6.814638","hmiID":"FinishBtn","name":"FinishBtn","all":false,"x":400,"y":4180,"wires":[["bfd2dec.4751c2"]]},{"id":"301047edb84f43b6","type":"delay","z":"452103ea51141731","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":540,"y":4220,"wires":[["bfd2dec.4751c2"]]},{"id":"dd0bebb4.f47388","type":"debug","z":"452103ea51141731","name":"","active":false,"console":"false","complete":"false","x":770,"y":4080,"wires":[]},{"id":"c18cc7569aa84461","type":"split","z":"452103ea51141731","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":930,"y":4220,"wires":[["4d2e2231f6204b8f"]]},{"id":"e97d79427a894d8d","type":"join","z":"452103ea51141731","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":1410,"y":4220,"wires":[["301047edb84f43b6"]]},{"id":"75414161afad949d","type":"inject","z":"452103ea51141731","name":"stop loop","props":[{"p":"reset","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":400,"y":4280,"wires":[["301047edb84f43b6"]]},{"id":"4d2e2231f6204b8f","type":"delay","z":"452103ea51141731","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"60","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1100,"y":4220,"wires":[["ec45d109.b5144"]]},{"id":"ec45d109.b5144","type":"http request","z":"452103ea51141731","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://{{payload}}/scib_data.dat","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"credentials":{"user":"","password":""},"x":1270,"y":4220,"wires":[["849bc568.57f898","e97d79427a894d8d"]]},{"id":"afa587f8.0cb5e8","type":"function","z":"452103ea51141731","name":"ESS0 Array","func":"var scib_data = [];\nscib_data = msg.payload.split(\",\");\n\nif(scib_data.length === 1301)\n{\n    var msgObj = {\n        \"topic\": \"ESS0_scib_data\",\n        \"payload\": scib_data \n    };\n\n    return [msgObj, {\"flush\":1}];\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":4420,"wires":[["dbbed3c87ca466fe"],["4d2e2231f6204b8f"]]},{"id":"03033f2b4c7ef319","type":"function","z":"452103ea51141731","name":"HANDLE NO SUCCESS","func":"\n    return [msgObj, {\"flush\":1}];\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":4460,"wires":[["65df3d29e216c86f"],["4d2e2231f6204b8f"]]},{"id":"849bc568.57f898","type":"switch","z":"452103ea51141731","name":"200 success?","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"else"}],"checkall":"true","outputs":2,"x":560,"y":4440,"wires":[["afa587f8.0cb5e8"],["03033f2b4c7ef319"]]},{"id":"dbbed3c87ca466fe","type":"debug","z":"452103ea51141731","name":"debug 110","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1090,"y":4400,"wires":[]},{"id":"65df3d29e216c86f","type":"debug","z":"452103ea51141731","name":"debug 111","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1090,"y":4440,"wires":[]}]

Untested as do not have your devices to test.

1 Like

Thank you! I was able to implement this

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.