Hook for all Nodes

Is there a workaround, or a feature to run some code at the begin / end of each Node-RED nodes ?

The underlaying idea is (for instance) to compute the CPU time / duration to better understand what slow the work:

  • on a Node
  • or a group of Nodes
  • or a SubFlow

We can add a callback/event hook on our own custom nodes but we can't do the same on nodes like HTTP Nodes.

See the metrics logging option in settings.js

The ability to add custom code into the message routing path is on the roadmap, but is not there today. In fact, as I described in the recent blog post, the Pluggable Message Routing feature has just dropped out of the 1.0 plan - but will be a priority after 1.0 ships.