Finite state machine logic

I was curious whether anyone has used workflows to mirror the behaviour of a finite state machine for doing basic control logic at the edge?

I was thinking the Switch and Conditional nodes could be used but I’m wondering if anyone has experimented with mapping an FSM to a Losant workflow?


I have not tried implementing a finite state machine into a workflow and not sure if someone has tried this yet. Maybe\Hopefully someone in the forums will respond with an implementation that they have done.

Like you said, I think it is possible and I would anticipate that you would be using the Switch Node and Conditional Node like you mentioned.

Let us know how your implementation goes if you choose to implement a finite state machine in a workflow.

Thank you Paul,

Thanks @Kevin_Niemiller

Folks using node-red have apparently created FSM nodes using a rather popular JavaScript State Machine library.

That would be interesting in Losant :slight_smile:


Thank you for the link - I will definitely check it out!


Have not implemented a FSM. Our “control system demo” uses essentially an if-elseif-else
logic as detailed at

I have been effectively creating a FSM using switches, and local storage. Not for control but determining state for alarms.

We have a number of mechanical devices that get start signals but are not considered running until feedback is provided and this can take some time.

We need to be able to record fail to start, starting running.

So the workflow is triggered each event, and the state progresses based on time and inbound events and previous state.

It seems to work fine.