# Node-red-contrib-dsm

**URL:** https://discourse.nodered.org/t/node-red-contrib-dsm/1388
**Category:** Share Your Nodes
**Created:** [6 July 2018 04:26 UTC](https://discourse.nodered.org/t/node-red-contrib-dsm/1388 "2018-07-06T04:26:25Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)
#### Post date: [5 November 2018 09:24 UTC](https://discourse.nodered.org/t/node-red-contrib-dsm/1388/8 "2018-11-05T09:24:13Z")

</div>

moved from [How can i build a random delayed trigger loop?](https://discourse.nodered.org/t/how-can-i-build-a-random-delayed-trigger-loop/3912/10)

I know, generally the state machine approach isn't easy to understand. That's the reason the node is in the `Advanced Category`. 🙂

One way to learn using the dsm node is to import the examples, there are more then 25 examples in the [Wiki](https://github.com/cflurin/node-red-contrib-dsm/wiki)

I've no plan at the moment to add a config UI, but let's see.

* * *

New version 0.13.0 available.

**Enhancements:**

- preState: the previous state (sm.preState) before the transition is executed.

- preStateOutput: here you can define the msg property e.g. `previous` =\> msg.previous

- examples: Menu \> Import \> Examples \> dsm

To start you can import the `skeleton` example.

Feedback and PR's are welcome.

---

_[View the full topic](https://discourse.nodered.org/t/node-red-contrib-dsm/1388)._
