# Updating Flows Remotely

**URL:** <https://discourse.nodered.org/t/updating-flows-remotely/56904>\
**Category:** General\
**Created:** [19 January 2022 06:45 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904 "2022-01-19T06:45:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cristian](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@Cristian](https://discourse.nodered.org/u/Cristian)\
**Post date:** [19 January 2022 06:45 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/1 "2022-01-19T06:45:41Z")

</div>

Good day everyone!

I almost finished an app that will run on multiple machines (powered by Raspberry Pi's). None of these machines have a fixed IP and all of them will send some data to a server at regular intervals of time.

Is there a way to update the flows in this case? I was thinking something like when the machine sends it data to server the server notifies the machine back that a new version of SW is available the machine then will download the new flows and "somehow" deploys it.

Any help will be appreciated. Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 January 2022 08:57 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/2 "2022-01-19T08:57:02Z")

</div>

Welcome to the forum @Cristian

You could do a regular `git pull` on the server and then restart node red if it pulls anything

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [19 January 2022 09:16 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/3 "2022-01-19T09:16:29Z")

</div>

Will that update the flows or just node red? The way I read it if he changes flows on one machine then update all machines to the new flow.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 January 2022 09:42 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/4 "2022-01-19T09:42:50Z")

</div>

I meant to pull the flows from git. I am assuming they are in a git repo on GitHub or wherever.

---

<div class="post-metadata">

**Author:** ![Cristian](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@Cristian](https://discourse.nodered.org/u/Cristian)\
**Post date:** [19 January 2022 11:02 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/5 "2022-01-19T11:02:55Z")

</div>

Thank you for your answer.  
NR machine will send a request to server to check if there are any updates available. If a new version of SW is available then the server will send the updated json flows.  
Now how can I fully deploy the new version of SW automatically without any human intervetion?

---

<div class="post-metadata">

**Author:** ![Cristian](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@Cristian](https://discourse.nodered.org/u/Cristian)\
**Post date:** [19 January 2022 11:04 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/6 "2022-01-19T11:04:09Z")

</div>

Thank you for your answer.  
After pulling just overwriting the old flow will do it?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [19 January 2022 11:09 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/7 "2022-01-19T11:09:09Z")

</div>

> [@Cristian](#):
>
> how can I fully deploy the new version of SW automatically with any human intervetion?

you can try using the [Admin API Methods](https://nodered.org/docs/api/admin/methods/)  
and more specifically read how to use a POST request to [POST /flows](https://nodered.org/docs/api/admin/methods/post/flows/)  
this can automatically do a Deploy of the posted Flow

---

<div class="post-metadata">

**Author:** ![Cristian](https://avatars.discourse-cdn.com/v4/letter/c/a698b9/32.png) [@Cristian](https://discourse.nodered.org/u/Cristian)\
**Post date:** [19 January 2022 11:11 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/8 "2022-01-19T11:11:31Z")

</div>

Thank you. I will try this evening and see how it works.

---

<div class="post-metadata">

**Author:** ![deputynl](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@deputynl](https://discourse.nodered.org/u/deputynl)\
**Post date:** [19 January 2022 14:33 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/9 "2022-01-19T14:33:05Z")

</div>

Have you considered using a dynamic dns service (like duckdns) and to use machine names instead of ip addresses? This could save you the trouble of updating the flows when the IP Addresses of the machines change.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 January 2022 08:58 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/10 "2022-01-20T08:58:52Z")

</div>

> [@Cristian](#):
>
> I will try this evening and

Alternatively you can search the forum on how to restart node red from a flow, it has been discussed many times. If the flows update is done in a script then you can do the restart from there.

> [@Cristian](#):
>
> After pulling just overwriting the old flow will do it?

You should also replace package.json and package-lock.json. in fact I overwrite the full .node-red folder except the node\_modules folder. If any new node types are needed, or if any nodes need upgrading, then you also need to run `npm install` in the .node-red folder before restarting. You can determine whether you need to do that by checking whether either of the package files has changed.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 March 2022 08:59 UTC](https://discourse.nodered.org/t/updating-flows-remotely/56904/11 "2022-03-21T08:59:10Z")

</div>

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