# \[FR / PR\] Click on id in debug panel highlights node or flow

**URL:** https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988
**Category:** General
**Created:** [18 November 2023 11:17 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988 "2023-11-18T11:17:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [18 November 2023 11:17 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/1 "2023-11-18T11:17:37Z")

</div>

Quite regularly I find myself putting the `id` of a node or flow in a `msg` for debugging. To find this node / flow in my editor, I'm then copying this `id` & enter it in the search box. Works - but is a bit inconvenient.

I'm proposing to build upon an already existing feature and allow to find & highlight a node or flow on click of its `id` in the debug panel:

![highlight_node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/0/b0766d30b47241b489b5871df955d75442907693.gif)

Would you accept a PR?

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [18 November 2023 11:27 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/2 "2023-11-18T11:27:26Z")

</div>

Just curious - how do you add add node.flow id into a message?

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [18 November 2023 11:40 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/3 "2023-11-18T11:40:11Z")

</div>

`node.path` @ `function` node == `flow_id`/`node_id`

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [18 November 2023 13:51 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/4 "2023-11-18T13:51:06Z")

</div>

I've read this a few times now and I'm still clueless 🙂

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [18 November 2023 14:22 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/5 "2023-11-18T14:22:19Z")

</div>

@ralphwetzel what node is that `test` node?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [18 November 2023 14:44 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/6 "2023-11-18T14:44:53Z")

</div>

> [@cymplecy](#):
>
> I've read this a few times now

![chrome_TvmOHzIXO7](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b31231a17478bb6ceed2c10415532a449627753f.gif)

So what @ralphwetzel is sating, it will give you `flow_id` followed by a `/` followed by the `node_id`

So you can split that down further

```auto
const [flow_id, node_id] = node.path.split('/')
msg.payload = { node_id, flow_id }
return msg

```

or long hand if it helps

```auto
const path = node.path.split('/')
const flow_id = path[0]
const node_id = path[1]
msg.payload = {}
msg.payload.flow_id = flow_id
msg.payload.node_id = node_id
return msg

```

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/95c502eda8a1e6da884f27a009cd4cf240a50d61.png)

```auto
[{"id":"2a920c7a7ebdae7d","type":"inject","z":"6e46a349d744ceaa","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":2220,"y":400,"wires":[["f35955cb00abb022"]]},{"id":"f35955cb00abb022","type":"function","z":"6e46a349d744ceaa","name":"long version","func":"// long hand\nconst path = node.path.split('/')\nconst flow_id = path[0]\nconst node_id = path[1]\nmsg.payload = {} \nmsg.payload.flow_id = flow_id\nmsg.payload.node_id = node_id\nreturn msg\n\n\n","outputs":1,"timeout":30,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2260,"y":440,"wires":[["bff1bb750c152bee"]]},{"id":"bff1bb750c152bee","type":"debug","z":"6e46a349d744ceaa","name":"debug 316","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2310,"y":480,"wires":[]},{"id":"d8334fc65d995f1c","type":"inject","z":"6e46a349d744ceaa","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":2220,"y":560,"wires":[["ee1c5158c66e0dc4"]]},{"id":"ee1c5158c66e0dc4","type":"function","z":"6e46a349d744ceaa","name":"short version","func":"const [flow_id, node_id] = node.path.split('/')\nmsg.payload = { flow_id, node_id }\nreturn msg","outputs":1,"timeout":30,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2260,"y":600,"wires":[["7c3f71ea112df2af"]]},{"id":"7c3f71ea112df2af","type":"debug","z":"6e46a349d744ceaa","name":"debug 317","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2290,"y":640,"wires":[]}]

```

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [18 November 2023 14:47 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/7 "2023-11-18T14:47:19Z")

</div>

> [@ralphwetzel](#):
>
> I'm proposing to build upon an already existing feature and allow to find & highlight a node or flow on click of its `id` in the debug panel:

How would you propose to determine a string is an id? what would be the criteria to perform a node lookup? Would it be specifically if it is a property named `flow_id` or `node_id`? Would it be applied to anything that _looks like_ an ID?

---

<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 November 2023 15:26 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/8 "2023-11-18T15:26:35Z")

</div>

seeing as we all already have .\_msgid - should they not be .\_sourceid and .\_flowid ?

Then again - one of the tenets of flow programming is that nodes should be as independent as possible - ie not care where a message came from... adding the source to any message would break that in that flows could/would start to exploit that.

I guess we need to clarify the proposal - is this intended to be baked in so all msgs carry this - or just some random property as required - and then as per Steve's question do you just guess/assume any 16 char hex like string could be a link ?

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [18 November 2023 15:52 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/9 "2023-11-18T15:52:47Z")

</div>

> [@Steve-Mcl](#):
>
> How would you propose to determine a string is an id? what would be the criteria to perform a node lookup? Would it be specifically if it is a property named `flow_id` or `node_id`? Would it be applied to anything that _looks like_ an ID?

The proposal takes the string, checks if it matches the `id` of a flow or node and the creates the functionality.

---

<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 November 2023 15:55 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/10 "2023-11-18T15:55:48Z")

</div>

So it has to check every property of every msg to see if it is node/flow id like ? How does that affect performance in high volume flows ?

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [18 November 2023 15:59 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/11 "2023-11-18T15:59:23Z")

</div>

No, it's only checking properties of type string.  
Compared to the amount of processing already done to create the debug message for the sidepanel, it looks to be neglectable.

---

<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 November 2023 16:03 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/12 "2023-11-18T16:03:57Z")

</div>

maybe only check those at top level directly under msg. ?

- currently I'm processing video metadata - so 25 fps, that ends up as 35-50 text properties... (all under payload).

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [18 November 2023 16:04 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/13 "2023-11-18T16:04:58Z")

</div>

One of my [contrib nodes](https://flows.nodered.org/node/@ralphwetzel/node-red-context-monitor).

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [18 November 2023 16:08 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/14 "2023-11-18T16:08:40Z")

</div>

> [@dceejay](#):
>
> maybe only check those at top level directly under msg. ?

As the feature is implemented in the process to build the debug msg output, it follows its standard creation procedure. Thus a property is populated only if visible to the user = toplevel or expanded. Consequentially the mentioned check is done as well only in those cases.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [18 November 2023 16:23 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/15 "2023-11-18T16:23:49Z")

</div>

I do feel that this has the potential for unnecessary overheads and core code complexity. It would be easily resolved if, as previously suggested, there was an agreed naming convention. Then no limits or workarounds would be necessary.

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [18 November 2023 16:30 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/16 "2023-11-18T16:30:07Z")

</div>

> [@TotallyInformation](#):
>
> there was an agreed naming convention.

🤔 How does a naming convention help you finding a node (visually) in a number of flows - based on its id?

> [@TotallyInformation](#):
>
> core code complexity

🤔 It's about 10 additional lines in a file of 1500.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [18 November 2023 16:35 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/17 "2023-11-18T16:35:54Z")

</div>

> [@ralphwetzel](#):
>
> How does a naming convention help you finding a node (visually) in a number of flows - based on its id?

That misses the point. The point being why should the debug panel processing be forced to check every string value to try and guess whether it contains a flow or node id? It should not.

Having an agreed naming convention side-steps that issue completely.

> [@ralphwetzel](#):
>
> It's about 10 additional lines in a file of 1500.

That has to be run against every string value in every debug output? When the debug panel can already be quite an overhead. And the number of lines also somewhat misses the point that every entry has to be tested to see if it as string and then has to work out if that string is a flow or node id? Doesn't that mean that every string must be compared against the full list of ids? What if there are thousands?

Unless I've missed something by only skimming this thread, this is totally unnecessary overhead, easily avoided.

I like the idea of being (optionally) able to specify some given property names that contain ID's that trace back to somewhere in my flows. I just don't want the debug panel processing to gain massive overheads to do it.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [18 November 2023 16:40 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/18 "2023-11-18T16:40:28Z")

</div>

If you click on the node name at the top of a debug message, the editor switches to that tab and flashes the border of the node.

I am not sure what this feature request provides beyond that, but it seems the debug panel message already knows which tab/flow and node sent the message?

If the requirement is to link to a node somewhere else, earlier in the flow maybe, I think predefined field names is much more sensible. Mind you, someone might want an array of these back links...

And provide the feature via a right click menu?

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [18 November 2023 17:46 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/19 "2023-11-18T17:46:24Z")

</div>

> [@TotallyInformation](#):
>
> That has to be run against every string value in every debug output?

No - as already explained.

> [@TotallyInformation](#):
>
> Unless I've missed something by only skimming this thread, this is totally unnecessary overhead, easily avoided.

Quite a strong argumentation given that you're "only skimming this thread". Feel invited to get presented the details, if you're interested...

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [18 November 2023 17:50 UTC](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988/20 "2023-11-18T17:50:05Z")

</div>

> [@jbudd](#):
>
> I think predefined field names is much more sensible.

Could you explain that? From what I read in the code base, I got the impression the ids used (e.g. for node and flow ids) are near-to-unique...

[Next page](https://discourse.nodered.org/t/fr-pr-click-on-id-in-debug-panel-highlights-node-or-flow/82988.md?page=2)
