# Updating a Node-RED flow from the file system

**URL:** https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205
**Category:** General
**Created:** [30 June 2020 08:39 UTC](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205 "2020-06-30T08:39:58Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![vp2021](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vp2021](https://discourse.nodered.org/u/vp2021)
#### Post date: [30 June 2020 08:39 UTC](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205/1 "2020-06-30T08:39:58Z")

</div>

Hello,

I would like to know if it is possible to update and deploy a node-RED "flow" just by modifying files.

Let me explain: If for example I have 10 machines with Node-RED, I would like to be able to update their flow and deploy it without having to go through the Node-RED GUI, but simply by modifying a file via SSH.

The idea would be to modify 1x the flow via the Node-RED GUI and then push the new flow + deploy it via SSH on the 10 other endpoints.

Is this possible?

Thanks for your help.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [30 June 2020 10:52 UTC](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205/2 "2020-06-30T10:52:04Z")

</div>

Flows are just stored as a file on disk - so you could certainly scp your flows (and credentials) files to all of the devices and then restart Node-RED on each of them to pickup the changes.

---

<div class="post-metadata">

### Author: ![vp2021](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vp2021](https://discourse.nodered.org/u/vp2021)
#### Post date: [30 June 2020 11:58 UTC](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205/3 "2020-06-30T11:58:32Z")

</div>

Okay. And do you know where the file contains the "Flow" Node-RED on the disk?  
Thank you

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [30 June 2020 12:04 UTC](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205/4 "2020-06-30T12:04:15Z")

</div>

Node-RED logs the full path of the flow file it is using when it starts. It will typically be in `~/.node-red`

---

<div class="post-metadata">

### Author: ![vp2021](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vp2021](https://discourse.nodered.org/u/vp2021)
#### Post date: [2 July 2020 07:07 UTC](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205/5 "2020-07-02T07:07:41Z")

</div>

I saw that the flows are saved in the following file: "/root/.node-red/flows\_.json"

I've taken the following steps:

1. Realization of a flow in Node-RED
2. Deploy the Flow
3. Copy the file "/root/.node-red/flows\_.json" to a temporary directory
4. Delete the flow in Node-RED
5. Deploys the changes
6. Copy the ".json" file from the temporary folder to "./node-red".

After that, I don't see the old flow in Node-RED again. How can I make Node-RED read this file and display it to me again without using the Node-RED GUI and the "import" function, but just by copying this file ?

I looked, and it seems that the "flows\_.json" file is the only file that is modified when I modify a flow and click on "Deploy".

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [2 July 2020 07:21 UTC](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205/6 "2020-07-02T07:21:32Z")

</div>

You need to restart Node-RED to load the changed flows.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [2 July 2020 07:25 UTC](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205/7 "2020-07-02T07:25:05Z")

</div>

Or push the flow to the running instance using ~~node-red-admin tool or~~ a suitable curl command. You will then still need to refresh the browser.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [2 July 2020 07:28 UTC](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205/8 "2020-07-02T07:28:20Z")

</div>

> [@dceejay](#):
>
> Or push the flow to the running instance using node-red-admin tool

Umm, not an existing feature of node-red-admin.

But yes, a curl command to trigger a reload is also doable.

---

<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: [16 July 2020 07:28 UTC](https://discourse.nodered.org/t/updating-a-node-red-flow-from-the-file-system/29205/9 "2020-07-16T07:28:23Z")

</div>

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