After receiving message generate each second a message for 10 minutes

So after a message arrives (content is irrelevant) a node starts so send for 10 minutes a message each second. How is this possible?

Doing a for loop sending via node.send?
However there is no build in sleep function in JavaScript. You need a few lines code to use a sleep function. So is there no easier way to achive this task?

Have a look at the node.

Using the core nodes, you can do it with a pair of Trigger nodes:


The incoming message goes to both trigger nodes. The top one is configured to resend 1 every second until it receives a msg.payload with a value of "reset".
The bottom trigger node sends nothing initially, waits 10 minutes, then sends a payload of reset, which is passed to the top trigger node to stop it.


Thanks, I'll use this variant with built in nodes. The is especially useful if you want to change the intervals at runtime.

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