Hi, i don’t know how to write script for this purpose. Usually I only use the Wait Node to pause for a fixed period before continuing the flow. But I think this node I can only set a single fixed value.
Is there anyway to create a min - max wait period using existing nodes combination? or maybe a simple code to achieve the same?
My use case:
I have list of telegram users ID from Loop Over Items node. I want to send message to each of them, instead of using a fixed interval (wait time) between messages, i want to randomize the message interval, for example: min 5 secs - max 30 secs. So each message will be sent at random wait time between 5-30 sec…
Thank you! This seems to be working. I can adjust the (max - min) values in this bracket (30 - 5) right? If I want to make it random between 10 - 35 sec, I should change it to: (35 - 10) … + 10, correct?
By the way, is there any method that I can log or save the random number being used for each loop? Just to verify temporarily. Because when i checked the wait node after testing it, the number keep on changing for the same loop item, so I don’t now what are the exact interval value being used for each item when executed.
Exactly, I wrote it that way so you could just plug in the min and max values
If you want to log the value, you’ll have to generate it with an Edit Fields node first. You can then use the value in the nodes after that, so you could log it first, and then use the value inside the wait node.
For example:
If these things are new to you, I recommend following our courses to get familiar with n8n: