Inject node - using the initial "inject once at start" event as a separate trigger when using intervals?

I would like to use the initial fire of the inject node to trigger a flow and from then trigger a different flow at each interval period.

Would there be a simple-ish way to achieve this? Thanks!

There are a few contributed nodes that can do something like what you're after. I had a look at node-red-contrib-controltimer and it seems to give you what you need. The initial inject passes the message to your first flow and the timer. The timer is then configured to loop, and pass a message to your second flow. If I'm understanding your requirement correctly.

[{"id":"98cfff41.4742b","type":"inject","z":"757bd7fd.b41a48","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":220,"wires":[["5da03f21.e546f","53707a43.fc2544"]]},{"id":"5da03f21.e546f","type":"debug","z":"757bd7fd.b41a48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":390,"y":260,"wires":[]},{"id":"6d114b8a.f812b4","type":"debug","z":"757bd7fd.b41a48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":180,"wires":[]},{"id":"a12e2999.414ec8","type":"controltimer","z":"757bd7fd.b41a48","name":"","timerType":"loop","timerDurationUnit":"second","timerDurationType":"num","timerDuration":5,"timerLoopTimeoutUnit":"second","timerLoopTimeoutType":"num","timerLoopTimeout":0,"loopTimeoutMessageType":"str","loopTimeoutMessage":"LOOP_TIMEOUT","timerMaxLoopIterationsType":"num","timerMaxLoopIterations":0,"loopMaxIterationsMessageType":"str","loopMaxIterationsMessage":"MAX_LOOP_ITERATIONS","isConsecutiveStartActionTimerResetAllowed":false,"isRunningTimerProgressVisible":false,"outputReceivedMessageOnTimerTrigger":true,"outputReceivedMessageOnTimerHalt":true,"startTimerOnReceivalOfUnknownMessage":false,"resetTimerOnReceivalOfUnknownMessage":false,"isDebugModeEnabled":false,"timerTriggeredMessageType":"str","timerTriggeredMessage":"TIMER_TRIGGERED","timerHaltedMessageType":"str","timerHaltedMessage":"TIMER_HALTED","isStartActionEnabled":true,"isStopActionEnabled":true,"isResetActionEnabled":true,"isPauseActionEnabled":true,"isContinueActionEnabled":true,"actionPropertyNameType":"str","actionPropertyName":"payload","startActionNameType":"str","startActionName":"START","stopActionNameType":"str","stopActionName":"STOP","resetActionNameType":"str","resetActionName":"RESET","pauseActionNameType":"str","pauseActionName":"PAUSE","continueActionNameType":"str","continueActionName":"CONTINUE","x":600,"y":180,"wires":[["6d114b8a.f812b4"],[]]},{"id":"53707a43.fc2544","type":"change","z":"757bd7fd.b41a48","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"START","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":180,"wires":[["a12e2999.414ec8"]]}]
1 Like

You could use two separate inject nodes, one to trigger at start and one to trigger at the desired interval.

Thanks - this is exactly what I'm after!

I assume this would need each inject node to be triggered separately or is there a way to link them using only one mouse click?

Sorry I only just realised that was a totally dumb question on my part!

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