How to inject, inject node one by one

Hello Everyone,

I want to inject 50 payloads(String) one by one After 2 second delay.
Please suggest me any solution for that.

Thank you

And again it should repeat the same task again and again.

Hey

As a non-programmer I would fix it like this (sorry programmers :sweat_smile:...)
There are better options, of course, but it should work.

Example, for 4 msg:

Flow:

[{"id":"944d2aca.21fda8","type":"inject","z":"90af3ff8.12c38","name":"START","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"open","payloadType":"str","x":2010,"y":3800,"wires":[["6f39b89.364bb48","500b3fe6.0693a"]]},{"id":"6f39b89.364bb48","type":"change","z":"90af3ff8.12c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2200,"y":3800,"wires":[["d88c00e0.3ee6f","9d17bf75.330aa"]]},{"id":"d88c00e0.3ee6f","type":"delay","z":"90af3ff8.12c38","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2020,"y":3860,"wires":[["6e5a0e31.d62db"]]},{"id":"6e5a0e31.d62db","type":"change","z":"90af3ff8.12c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2200,"y":3860,"wires":[["2dd0af6e.7c841","9d17bf75.330aa"]]},{"id":"2dd0af6e.7c841","type":"delay","z":"90af3ff8.12c38","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2020,"y":3920,"wires":[["95c9009a.f6417"]]},{"id":"95c9009a.f6417","type":"change","z":"90af3ff8.12c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2200,"y":3920,"wires":[["270c4b3f.046574","9d17bf75.330aa"]]},{"id":"270c4b3f.046574","type":"delay","z":"90af3ff8.12c38","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2020,"y":3980,"wires":[["7552558f.b93c2c"]]},{"id":"7552558f.b93c2c","type":"change","z":"90af3ff8.12c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2200,"y":3980,"wires":[["9d17bf75.330aa","500b3fe6.0693a"]]},{"id":"9d17bf75.330aa","type":"debug","z":"90af3ff8.12c38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2550,"y":3900,"wires":[]},{"id":"500b3fe6.0693a","type":"gate","z":"90af3ff8.12c38","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":2230,"y":4040,"wires":[["6f39b89.364bb48"]]},{"id":"bb1b167f.5647d8","type":"inject","z":"90af3ff8.12c38","name":"STOP","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"close","payloadType":"str","x":2010,"y":4040,"wires":[["500b3fe6.0693a"]]},{"id":"dd054814.6134d8","type":"inject","z":"90af3ff8.12c38","name":"START","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"open","payloadType":"str","x":2010,"y":4200,"wires":[["70580c9c.d8d2d4","1c4697de.8beb48"]]},{"id":"70580c9c.d8d2d4","type":"change","z":"90af3ff8.12c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2200,"y":4200,"wires":[["1519d571.7474bb","1c4697de.8beb48"]]},{"id":"1519d571.7474bb","type":"delay","z":"90af3ff8.12c38","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2020,"y":4260,"wires":[["a7dc9185.9319"]]},{"id":"a7dc9185.9319","type":"change","z":"90af3ff8.12c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2200,"y":4260,"wires":[["6fb7ddbb.75c824","1c4697de.8beb48"]]},{"id":"6fb7ddbb.75c824","type":"delay","z":"90af3ff8.12c38","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2020,"y":4320,"wires":[["4bf42d07.f215f4"]]},{"id":"4bf42d07.f215f4","type":"change","z":"90af3ff8.12c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2200,"y":4320,"wires":[["e0f8c189.954d4","1c4697de.8beb48"]]},{"id":"e0f8c189.954d4","type":"delay","z":"90af3ff8.12c38","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2020,"y":4380,"wires":[["264e8b1b.5e15c4"]]},{"id":"264e8b1b.5e15c4","type":"change","z":"90af3ff8.12c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2200,"y":4380,"wires":[["1c4697de.8beb48"]]},{"id":"2f8f59d3.4350c6","type":"debug","z":"90af3ff8.12c38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2550,"y":4300,"wires":[]},{"id":"1497c1bb.26fece","type":"inject","z":"90af3ff8.12c38","name":"STOP","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"close","payloadType":"str","x":2010,"y":4440,"wires":[["1c4697de.8beb48"]]},{"id":"1c4697de.8beb48","type":"gate","z":"90af3ff8.12c38","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":2390,"y":4300,"wires":[["2f8f59d3.4350c6"]]},{"id":"e1839f7b.5efee","type":"comment","z":"90af3ff8.12c38","name":"Stop after all msg","info":"","x":2030,"y":3760,"wires":[]},{"id":"748e11fa.af351","type":"comment","z":"90af3ff8.12c38","name":"Stop immediately.","info":"","x":2020,"y":4160,"wires":[]}]

Arne

Thanks, same thing i did.

It depends how/where those payloads come from.

You could inject a single Array containing those 50 payloads, pass to a split node to turn into a stream of 50 messages, and then a Delay node configured to rate limit the messages to 1 second per 2 seconds.

Now that you mention it, that's right!

New solution, according to @knolleary.

[{"id":"23d623cd.c9089c","type":"inject","z":"90af3ff8.12c38","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"open","payloadType":"str","x":1710,"y":3780,"wires":[["692a4bd2.611704","43722c23.216ab4"]]},{"id":"59d21468.80b47c","type":"debug","z":"90af3ff8.12c38","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2290,"y":3900,"wires":[]},{"id":"cd2e58db.d0d2f8","type":"delay","z":"90af3ff8.12c38","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"2","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":2100,"y":3880,"wires":[["59d21468.80b47c","1dc0b233.bc060e"]]},{"id":"1a240ca3.c65103","type":"split","z":"90af3ff8.12c38","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1950,"y":3880,"wires":[["cd2e58db.d0d2f8"]]},{"id":"1dc0b233.bc060e","type":"trigger","z":"90af3ff8.12c38","name":"Watchdog","op1":"","op2":"timeout","op1type":"nul","op2type":"str","duration":"3","extend":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":2280,"y":3860,"wires":[["43722c23.216ab4"]]},{"id":"692a4bd2.611704","type":"change","z":"90af3ff8.12c38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\"bericht 1\",\"bericht 2\",\"bericht 3\",\"bericht 4\",\"bericht 5\"]","tot":"jsonata"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1800,"y":3880,"wires":[["1a240ca3.c65103"]]},{"id":"43722c23.216ab4","type":"gate","z":"90af3ff8.12c38","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":2410,"y":3860,"wires":[["692a4bd2.611704"]]},{"id":"ab5621d6.f2322","type":"inject","z":"90af3ff8.12c38","name":"Stop","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"control","payload":"close","payloadType":"str","x":1710,"y":3820,"wires":[["43722c23.216ab4"]]}]

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