Deploy Event not fired

Hello,

I want to take some after-deployment action. So the deploy event described here RED.events : Node-RED is the one I want to use.
But somehow the event is not fired / I am not able to catch it.

I use Node Red 2.2.2 inside a NodeJS App.
If I use
RED.events.on('deploy', (params: RuntimeDeployEvent) =>
this.logger.warn('deploy', params),
);
the logger will never be called. Although the flows-event are not triggered / caught.

on the other hand
RED.events.on('runtime-event', (params: RuntimeDeployEvent) =>
this.logger.warn('runtime-event',params),
);
works well.

Any idea why the deploy event is not working as documented?

Thank's for your help
okm

The events you link to are editor events, not runtime events.

We have not published any public events in the runtime. Anything you use is internal and could theoretically change.

Having some runtime events around the deploy lifecycle is something I'm looking at for 3.0

1 Like

Hi Nick,

One thing that I would find really useful if you are looking in that area would be to have a before/after or diff of the config parameter.

In other words, some way for the function in the registerType function to be able to know what has changed pre- to post-deployment.

If there were a way to differentiate between node-red startup, initial deployment of a node and a redeployment of a node, that would also be very helpful.

1 Like

Ok, got it.
I agree with @TotallyInformation, in the end I use it for a "what has changed logic"

@knolleary Thank you. Looking forward to 3.0.

1 Like

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