Enable/disable a flow programmatically from within Node-RED?

I solve that in my setup by setting a couple global variables, then allow (sub)flows to be run through a switch node that checks what the current condition of that variable is before running the flow. That switch sits at the start, immediately behind anything that triggers it.

For example, I have a "guest mode" variable where in the default situation this is off. But if I have people over, rather than having the automation do semi-random things that only I know about, for example ask me (TTS over a speaker) how I'm doing with pain or giving suggestions for things to eat/pills to take. An alternative flow is started instead when guest mode is on, where these things still happen but rather than asking notifications will be send to my phone for me to respond to, whether normally I would just answer out loud as a Snips conversation is started.

For me, that works just fine. Yeah it's a bit verbose with all those flows visible in the editor, but with good naming both flows and subflows it does not hinder me.

2 Likes