How to Restart Flows automaticaly?

Hi, I would like to ask, I am running the same flow on more machines (or the same machine more ports), and I would like to automatically update all running instances by actualized flow.
It's some way how can I do that?

I need to automatically press button on the picture

You can use a tool to call the admin API /flows endpoint on each device as long as you have permission - see the docs POST /flows : Node-RED

1 Like

Looking at that method, it isn't clear to me what the request body should contain in the case of asking for a reload.

Lets imagine following usecase:
you execute following commands on the same directory:

  • node-red -p 1880
  • node-red -p 1881

on instance running on port 1880 you do some change and when it's done you would like to apply to instance 1881 (without restarting node-red) how you can do that?

flow.json is already new because is changed by 1880 but on 1881 is loaded the old one. And I need to somehow actualize all instances. When I click on "restart flows" it do what I want, but I need to automatize it.

It can be done as suggested by dceejay, it just isn't clear to me exactly how to do it to perform the reload function described in the link.

1 Like

@strbaknxp it appears that when using POST /flows with the reload option then an empty body is sufficient.

@dceejay and @Colin,
Thank you for your response. :slight_smile:
Now I had a time to study it and it work great.
Thanks a lot for your effort.

1 Like

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