# Live-updating nodes

**URL:** <https://discourse.nodered.org/t/live-updating-nodes/67777>\
**Category:** Developing Nodes\
**Created:** [16 September 2022 01:23 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777 "2022-09-16T01:23:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![kakyoism](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kakyoism/32/46283_2.png) [@kakyoism](https://discourse.nodered.org/u/kakyoism)\
**Post date:** [16 September 2022 01:23 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/1 "2022-09-16T01:23:18Z")

</div>

I'd love to do the following without restarting Node-RED server:

1. Adding new nodes
2. Removing nodes
3. Updating a node's behaviours and appearances

I want user to simply reload the Node-RED page in the web browser to have all these up to date.

#3 seems doable:  
With JS, I imagine dynamic behaviours can be achieved through some dependency injection tricks, but not sure if I can change certain things such as a node's name, colour, or its editor layout without restarting node-red.

But I'm not sure how to make #1 and #2 happen.

Are there any standard facilities or best practice regarding this with Node-RED?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 September 2022 07:02 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/2 "2022-09-16T07:02:36Z")

</div>

> [@kakyoism](#):
>
> I want user to simply reload the Node-RED page in the web browser to have all these up to date.

For example, this make little sense by itself. I mean what is it you expect? For contrib nodes to be automatically updated because the user refreshed their browser? How do you expect the runtime (where nodes run - server side) to be instructed that an update is needed?  
I am certain you know what you want/need but it isnt 100% clear to me.

  

> [@kakyoism](#):
>
> I'd love to do the following without restarting Node-RED server:

> [@kakyoism](#):
>
> Adding new node

Already possible via palette manager and [API](https://nodered.org/docs/api/admin/methods/post/nodes/)

  

> [@kakyoism](#):
>
> Removing nodes

Already possible via palette manager and [API](https://nodered.org/docs/api/admin/methods/delete/nodes/module/) however a restart of the runtime is required to fully unload the module from memory.

  

> [@kakyoism](#):
>
> Updating a node's behaviours and appearances

Your own node? Other or CORE nodes? What do you mean?

  

* * *
  

NOTE: As you posted in #creating-nodes - I have assumed you are creating a contrib node-red node?

---

<div class="post-metadata">

**Author:** ![kakyoism](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kakyoism/32/46283_2.png) [@kakyoism](https://discourse.nodered.org/u/kakyoism)\
**Post date:** [16 September 2022 08:24 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/3 "2022-09-16T08:24:56Z")

</div>

@Steve-Mcl I was talking about my own custom nodes exclusively.  
Those nodes are used internally and will not be published.  
Sorry for the confusion.

Thanks for the tip about the palette. I'll take a look.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 September 2022 08:31 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/4 "2022-09-16T08:31:39Z")

</div>

In which case it sounds like you need to provide your internal node-red servers with an internal custom catalog so that your private nodes can be presented to the private node-red servers

Here is such an example using another node-red to host the catalog: [Serving my own catalog via Node-RED - #11 by shrickus](https://discourse.nodered.org/t/serving-my-own-catalog-via-node-red/41040/11)

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [2 November 2022 13:38 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/5 "2022-11-02T13:38:28Z")

</div>

> [@Steve-Mcl](#):
>
> using another node-red to host the catalog

Hah, in fact I was using the same node-red instance to limit itself... I just love how customizable node-red is!

---

<div class="post-metadata">

**Author:** ![Steveorevo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steveorevo/32/33290_2.png) [@Steveorevo](https://discourse.nodered.org/u/Steveorevo)\
**Post date:** [28 November 2022 18:55 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/6 "2022-11-28T18:55:05Z")

</div>

I too have a question about restarting or “reloading” Node-RED; possible from the API?

Use case:  
I have a node that syncs functions and templates for use with an external editor; in the latter part it alters the flow file and currently instructs users to “restart node red to see changes take effect”.

> **[GitHub - Steveorevo/node-red-flow2src: This node will write template and...](https://github.com/steveorevo/node-red-flow2src)**
>
> This node will write template and function node source code properties to a src sub-folder adjacent to the project's flows file; allowing for easy editing in external editors. - GitHub - Steveo...

Another use case with hack:  
I created a project for creating nodes and when alterations are made refreshing the browser is trivial; but restarting Node-RED is essential to pickup changes to node\_modules. This is probably too low-level as it’s more than just altering nodes and deploying. To accomplish this, it uses an exec. shell to re-start Node-RED but this requires that it knows where Node-RED is and is aware of the prior PID. It’s complicated and not FlowForge compatible but its target is lower level Node devs anyways.

> **[GitHub - Steveorevo/node-maker: A set of subflows that can be used to quickly...](https://github.com/steveorevo/node-maker)**
>
> A set of subflows that can be used to quickly create a new Node-RED node, its property panels, and initial behavior. - GitHub - Steveorevo/node-maker: A set of subflows that can be used to quickly...

Perhaps just for flow2src, is there anyway to invoke reloading a project’s flow file from the API?

---

<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:** [28 November 2022 20:46 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/7 "2022-11-28T20:46:20Z")

</div>

> Perhaps just for flow2src, is there anyway to invoke reloading a project’s flow file from the API?

See the `reload` action available on [POST /flows : Node-RED](https://nodered.org/docs/api/admin/methods/post/flows/)

---

<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:** [28 November 2022 20:53 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/8 "2022-11-28T20:53:53Z")

</div>

It isn't clear to me from the docs what one provides in the request body for the `reload` action.

---

<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:** [28 November 2022 20:56 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/9 "2022-11-28T20:56:17Z")

</div>

An empty body is sufficient

---

<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:** [28 November 2022 20:58 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/10 "2022-11-28T20:58:14Z")

</div>

Great, thanks.

---

<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:** [27 January 2023 20:58 UTC](https://discourse.nodered.org/t/live-updating-nodes/67777/11 "2023-01-27T20:58:50Z")

</div>

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