Can a function node detect when re-deployed?

I'm thinking that the answer is no but just checking

Simon

Hi Simon,

Isn't the close event what you are looking for?

Bart

I was looking to restore the status text - now that I can use Blockly to set it :slight_smile: - when a re-deploy takes place

The Close event tells you when the node is being closed, but there is no equivalent event in the Function node for when it is created as part of a deploy.

Maybe there should be....

1 Like

For a function node (basically a flow) just add an inject node that triggers once. That can run into a function node which updates what you need.

The inject once node is I think a good and adequate solution to the detecting a flow startup, even as a complete node-red newbie it was obvious to me as a way to do it and I, perhaps mistakenly, assumed it was the reason for the inject once option. But with the addition of persistent across restart storage, I think a "flow is stopping" hook would be essential to insure that persistent storage gets flushed properly.

Yes - that's the workaround I'm currently using

Node red will look after that for you, you don't need to worry about it.