DeanCording/node-red-contrib-state-machine

stateless node

Closed this issue · 2 comments

hi,
the state can be saved in the message instead of the node? in this mode we can have many instance of the state machine for a single node

Hi,

The output property is where the current state is published for other nodes to use. If you set it to a message property, the current state is published there but it is always kept inside the node. The node can only have one instance of the state machine.

Dean

Sorry,I didn't fully understand what you were asking at first.
The state is maintained by a state machine inside of the node, so it isn't possible to keep the state in the message. In any case, thestate would be lost once the message was finished processing.