node-red-contrib-state-machine runtime errors (Deprecated Events)
See original GitHub issueProblem/Motivation
The node-red component “node-red-contrib-state-machine” has not been updated in some time and has been apparently abandoned by its maintainer; it has been replaced by “node-red-contrib-persistent-fsm” which appears to be compatible to the behavior of the old component.
The older component was written prior to the availability of “flows:started” and uses an older method of flow setup that is no longer supported in NodeRED.
Expected behavior
No warnings, no indications on flow initiation.
Actual behavior
Debug panel display on deployment with the node in the configuration:
"[RED.events] Deprecated use of "nodes-started" event from "/opt/node_modules/node-red-contrib-state-machine/state-machine.js:98:20". Use "flows:started" instead."
Steps to reproduce
- Add a flow with the node from “node-red-contrib-state-machine” in use (an inject -> node -> debug flow is fine for this purpose.
- Display the Debug window in the side pane.
- Deploy.
Proposed changes
A substitution is proposed in the following issue logged against the “node-red-contrib-state-machine” github repository: ISSUE It suggests a config change to the addon, which does in fact function fine:
npm_packages:
- node-red-contrib-persistent-fsm
init_commands:
- npm un node-red-contrib-state-machine --save
The new module is based on the old DeanCording module, and is kept here: node-red-contrib-persistent-fsm It does not appear that the old maintainer is improving the module anymore.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)

Top Related StackOverflow Question
I was able to provide the maintainer a fix and sent him a pull request. I was able to verify that a simple async delay on the message works fine… I’ll let you know when he replies.
It seems to share the same nodename and base configuration; when I loaded it into my flow set it seemed to adopt the existing flow configuration. It certainly seemed to “drop in”.
It also includes a state machine visualizer which is pretty nice - as well as a “persist state across deployments” feature which has been lacking in the prior component.