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

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

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.

Test Flow :

[{"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

1 Like

Thank you so much, Worked as you explained.

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