# How to trigger a flow if a newer version is released?

**URL:** <https://discourse.nodered.org/t/how-to-trigger-a-flow-if-a-newer-version-is-released/75743>\
**Category:** General\
**Created:** [25 February 2023 23:02 UTC](https://discourse.nodered.org/t/how-to-trigger-a-flow-if-a-newer-version-is-released/75743 "2023-02-25T23:02:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aperture1988](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aperture1988/32/40681_2.png) [@aperture1988](https://discourse.nodered.org/u/aperture1988)\
**Post date:** [25 February 2023 23:02 UTC](https://discourse.nodered.org/t/how-to-trigger-a-flow-if-a-newer-version-is-released/75743/1 "2023-02-25T23:02:23Z")

</div>

Hello Guys,

Im looking to set up some proactive notifications to alert me when there is a new version of Node-Red available for installation. Ive been hunting around trying to find this information but keep coming up blank.

Any ideas how I can trigger a flow if the installed version of my Node-Red package is older that the current stable version?

To take this one step further also, would be great if I could also set up a trigger if an update for a pallette becomes available.

Thanks

---

<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:** [25 February 2023 23:47 UTC](https://discourse.nodered.org/t/how-to-trigger-a-flow-if-a-newer-version-is-released/75743/2 "2023-02-25T23:47:07Z")

</div>

hello .. you can use an exec node and run an `npm outdated -g node-red -json` command  
that will produce a msg if its outdated showing the current and latest version that you can later compare.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a9721626de7b20bfba55f974935c84ec99560845.png)

**Test Flow :**

```auto
[{"id":"04c5f9106d71fd16","type":"inject","z":"54efb553244c241f","name":"npm","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":290,"y":2220,"wires":[["fcab4315b32afd57"]]},{"id":"fcab4315b32afd57","type":"exec","z":"54efb553244c241f","command":"npm outdated -g npm -json","addpay":"","append":"","useSpawn":"false","timer":"","winHide":true,"oldrc":false,"name":"","x":540,"y":2220,"wires":[["a3b2d655e720507e"],[],[]]},{"id":"bcc5858fa3756b16","type":"inject","z":"54efb553244c241f","name":"node-red","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":280,"y":2360,"wires":[["ea814dc339e97c59"]]},{"id":"ea814dc339e97c59","type":"exec","z":"54efb553244c241f","command":"npm outdated -g node-red -json","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":530,"y":2360,"wires":[["a3b2d655e720507e"],[],[]]},{"id":"fdd4d5d2092cf6ed","type":"debug","z":"54efb553244c241f","name":"debug 30","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":940,"y":2280,"wires":[]},{"id":"a3b2d655e720507e","type":"json","z":"54efb553244c241f","name":"","property":"payload","action":"","pretty":false,"x":790,"y":2280,"wires":[["fdd4d5d2092cf6ed"]]}]

```

In the test flow i run a command for **npm** that i know is outdated and **node-red** that is the latest.  
i notice that if the package is updated though you dont get any result?!  
so you need to handle those cases after the json node.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/4/049958c2db6cb193a6de4ca08187b3da1e511d8a.png)

---

<div class="post-metadata">

**Author:** ![aperture1988](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/aperture1988/32/40681_2.png) [@aperture1988](https://discourse.nodered.org/u/aperture1988)\
**Post date:** [26 February 2023 08:33 UTC](https://discourse.nodered.org/t/how-to-trigger-a-flow-if-a-newer-version-is-released/75743/3 "2023-02-26T08:33:16Z")

</div>

Thank you so much, Worked as you explained.

---

<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:** [12 March 2023 08:33 UTC](https://discourse.nodered.org/t/how-to-trigger-a-flow-if-a-newer-version-is-released/75743/4 "2023-03-12T08:33:49Z")

</div>

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