Failover flow location

Hello

Is it possible to have an alternative/failover flow specified in the setting.js file?
In my use case, I'm loading a flow file from the network drive, and due to the issues with the network that is out of my control, it fails sometimes.
I would like to specify the alternative flow which will be used in the case loading of the main one will fail.
My idea is to create a series of bash scripts that could be launched to fix it, depends on the situation.

The default behaviour is to create an empty flow. Node-Red will try to deploy this empty flow to the location specified in the setting.js after pressing deploy button.

Is it used read only ? or do you need to also write it back ? What happens if it fails in between read and write - etc...
If read only - then why not always try to copy it down locally before starting Node-RED locally - that was it will always have the latest at that point in time.

I'm not sure about what you mean by read-only? Is the network location mounted to be read-only?
If you asking about failing to update flows from the editor and this due to the network issues node-red editor will flag it up.
The risk with the coping flow to the local folder is that if I will have a device that is consistently failing to mount a network drive then I will end up running an outdated version of the flows without knowing it. This means I will have to introduce version monitoring.
Now I have multiple devices loading the same flow from the network location and sharing credentials. I also have one "master" device I'm using to install/remove modules using network location as the User directory and the bash script that is executed when node red starts on the "slave" devices to sync to the local folder if needed.

By read-only I meant the end devices just run the flow and don't edit it and have to write it back - from your description of having a master flow and slave devices running it then yes - that sounds the same.

isn't that another way of saying copying the file at startup ? - So again I think we are in agreement.

And yes there is a risk that the file is always outdated - you could just try to sync/copy the file at regular intervals or somehow keep re-trying in the background - and the next time Node-RED restarts it will pick it up.

Hi.

The flow file is ignored during the sync procedure. Only node red user directory is synced to keep list and version of the modules up to date. This way I can run update on the "master" device and the slave devices will pick this up or I can trigger sync over MQTT. I'm using rsync to copy files to one of the two folders. It's always coping files to the folder that is not currently in use by node red as the user dir.
This works like that:

  1. check if sync is needed
  2. If yes check which folder is used by nod red
    3 .If A in use sync to B and vice versa
  3. modify setting.js file accordingly
  4. Prompt user to restart node-red service

Anyway we are both going out of topic here.
Is there any way to have a "second flow option" specified in the node red to be used to put things right?

There is nothing built in to do that - no. But I would look to extend what you have to include the flow file.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.