# Hook for all Nodes

**URL:** https://discourse.nodered.org/t/hook-for-all-nodes/10326
**Category:** Feature Requests
**Created:** [18 April 2019 08:49 UTC](https://discourse.nodered.org/t/hook-for-all-nodes/10326 "2019-04-18T08:49:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JpEncausse](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jpencausse/32/2561_2.png) [@JpEncausse](https://discourse.nodered.org/u/JpEncausse)
#### Post date: [18 April 2019 08:49 UTC](https://discourse.nodered.org/t/hook-for-all-nodes/10326/1 "2019-04-18T08:49:45Z")

</div>

Hello,  
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.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [18 April 2019 09:00 UTC](https://discourse.nodered.org/t/hook-for-all-nodes/10326/2 "2019-04-18T09:00:36Z")

</div>

See the metrics logging option in settings.js

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [18 April 2019 09:26 UTC](https://discourse.nodered.org/t/hook-for-all-nodes/10326/3 "2019-04-18T09:26:17Z")

</div>

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](https://nodered.org/blog/2019/04/05/accelerating-the-roadmap), the Pluggable Message Routing feature has just dropped out of the 1.0 plan - but will be a priority after 1.0 ships.
