# Sequence with variable delays

**URL:** <https://discourse.nodered.org/t/sequence-with-variable-delays/47052>\
**Category:** General\
**Created:** [11 June 2021 19:37 UTC](https://discourse.nodered.org/t/sequence-with-variable-delays/47052 "2021-06-11T19:37:53Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [12 June 2021 08:52 UTC](https://discourse.nodered.org/t/sequence-with-variable-delays/47052/6 "2021-06-12T08:52:31Z")

</div>

I did a similar thing with variable delays between transitions in a finite state machine FSM).

> [@Need help to use if function in Node Red](https://discourse.nodered.org/t/need-help-to-use-if-function-in-node-red/36091/12):
>
> Just had a few spare minutes to take a look at having different delays between transitions. [{"id":"743e732.c12228c","type":"function","z":"be3ab1ef.3f0a68","name":"Decode RED light","func":"var fsm\_state = flow.get(\"state\_counter\");\n\nif (fsm\_state === 0 || fsm\_state == 1)\n {msg.payload = 1;\n node.status({fill:\"red\",shape:\"dot\",text:\"Red ON\"});\n }\n \nelse\n {msg.payload = 0;\n node.status({});\n }\n\nreturn msg;","outputs":1,"no…

---

_[View the full topic](https://discourse.nodered.org/t/sequence-with-variable-delays/47052)._
