How do you integrate a final state machine into Node Red?
By simply using the search bar offered by the Node-RED forum...
Then you will see a series of example, like this. I haven't used it myself ...
Here's a link to a tutorial I wrote for my IoT students to code a FSM for UK traffic lights.
There's a link to a NR flow as well.
Note: If you look at the NR flow you will see the classic way of coding a FSM using 'case' statements.
This traffic light example just moves from one state to another every 3-secs (so you can just use a simple counter in this very basic example).