# Should debug nodes be capable of passing the message forwards?

**URL:** <https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044>\
**Category:** Core Development\
**Created:** [1 February 2025 12:19 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044 "2025-02-01T12:19:20Z")\
**Posts on this page:** 20\
**Page:** 4

<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:** [2 February 2025 19:48 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/61 "2025-02-02T19:48:45Z")

</div>

Right click, but since the status shows off its on or off, a simple click would work.

Anyway, I'm not developing this node and I have no expectation that anyone else will.

Just pondering alternatives.

---

<div class="post-metadata">

**Author:** ![ziga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ziga/32/98138_2.png) [@ziga](https://discourse.nodered.org/u/ziga)\
**Post date:** [2 February 2025 20:39 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/62 "2025-02-02T20:39:07Z")

</div>

logIO version 1.2.0 released: [node-red-log-io (node) - Node-RED](https://flows.nodered.org/node/@zigasebenik/node-red-log-io)

- adds output port (in all modes, so it never breaks chain between connected nodes) and passes input messages forward
- moves button on top of the node

---

<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:** [2 February 2025 20:56 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/63 "2025-02-02T20:56:40Z")

</div>

Sorry for slow reply - personally I find that even worse than the overlayed button/port. But yeah - it's not about me 🙂  
(but the hiding is good so not too intrusive)

---

<div class="post-metadata">

**Author:** ![moonrockfamily](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/moonrockfamily/32/75521_2.png) [@moonrockfamily](https://discourse.nodered.org/u/moonrockfamily)\
**Post date:** [5 February 2025 18:26 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/64 "2025-02-05T18:26:04Z")

</div>

I like this direction for Node-Red. Spent a bit of time with [https://nifi.apache.org/](https://nifi.apache.org/) and liked some of the cross-cutting flow control and audit concerns it takes seriously and factors into pluggable repositories...[Apache NiFi Overview](https://nifi.apache.org/docs/nifi-docs/html/overview.html)

---

<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:** [16 July 2025 10:15 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/65 "2025-07-16T10:15:21Z")

</div>

Is any of this "pass-through debug" / "test point" stuff likely to be implemented for Node-red 5.0?

---

<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:** [16 July 2025 10:52 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/66 "2025-07-16T10:52:57Z")

</div>

I really hope so. And I hope it solves the multiple editors issue ([ref](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/54))

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [17 July 2025 08:47 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/67 "2025-07-17T08:47:35Z")

</div>

> [@jbudd](#):
>
> "test point"

The message tracer over in the [introspection](https://flows.nodered.org/node/@gregoriusrippenstein/node-red-contrib-introspection) package does work well enough for me - just saying if you want debug a) without deploying b) without adding debug nodes.

In Erlang-Red I even added to the right button menu because the sidebar was too much work:

 ![Screenshot 2025-07-17 at 10.44.02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1b6ed58ceaeb3bc8a7c00c37e3893106969c62e1.png)

The node gets a green dot that can be used to deactivate the debugging again:

 ![Screenshot 2025-07-17 at 10.45.28](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/349e79a0fe76cc0cf5524100698d8495278b7ed8.png)

Debugging multiple nodes at one time is possible.

---

<div class="post-metadata">

**Author:** ![Urs-Eppenberger](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/urs-eppenberger/32/28_2.png) [@Urs-Eppenberger](https://discourse.nodered.org/u/Urs-Eppenberger)\
**Post date:** [18 July 2025 05:39 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/68 "2025-07-18T05:39:37Z")

</div>

The debugging node is an essential part of node-red. It supports the culture behind node-red. Start, check the output, add another node to modify the output, improve step by step. Over the development of a flow I usually start to remove debug nodes to pretty things up, move the nodes closer to keep things visible on the screen. So far so good.  
But half a year later I need to change something because there is a new device and then I need to add all the debug stuff again etc etc. I'm, coming from electronics, where you have test points on the circuit board. A debug node which hands the signal/message through seems a very logical thing to mee. And it would fit with the step-by-step development node-red supports.

I recently played a little bit with n8n. They use a different approach. The output of a 'node' can be seen when you click on it. It is part of the configuration window. I prefer the node-red way.

---

<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 July 2025 09:21 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/69 "2025-07-18T09:21:38Z")

</div>

Quick note, I am going to try to build something that does a through debug. May call it `through-bug`. 🙂

Just a simple experiment for now to see how useful it might be.

---

<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 July 2025 10:06 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/70 "2025-07-18T10:06:37Z")

</div>

I am thinking of a debug handling process allowing _each node in a flow_ to have a virtual debug node connected, _both at the input and output_ connector.  
I'm sure there's nothing novel here but I have not seen the approach discussed in any detail.

- A new message property msg.\_debug eg `{"input": false, "output": true}`.
- The same property for each editor tab.
- A new core config node `Debug Handler`. This would hold a switch `true/false` and some debug handling code (see later).
- Modification to the message passing code.

### Core message handling code

Change the core message passing code (I have no idea how Node-red does this, in particular how it handles passing a message to a node and then receiving it back for passing on down the line).  
This has a minimum **processing overhead** of two tests of the global debug handler switch, held in memory and set at deploy.

```auto
When passing a message, 
IF the global Debug Handler === `true`  
    IF (msg._debug.input === `true`)
        Pass the message, target node id and flow id(?) to the Debug Handler.
Pass the message to the target node as now.
After processing
IF the global Debug Handler === `true`
    IF (msg._debug.output === `true`)
        Pass message, just executed node id and flow id(?) to the Debug Handler.
Continue normal processing

```

### Debug handler

This might be called up to twice for each node in a flow, before the node is executed and after it completes. But only if debug is turned on globally, and for the node itself.  
A minimal debug handler would output the message to the debug panel, if debug is turned on for this flow, cf the current debug node set to "Complete message object".  
The code to achieve this is provided by default in the Debug Handler config node.  
It could do more though, the user might change the code to

- Dump the message to a file.
- Pass it to an external process.
- Custom handling by user ID.

### Changes to individual nodes

We would need a way to turn input and output flags on and off for each node.  
Could the core node-config and flow config dialogs be amended to do this without needing to modify individual core and contrib nodes? (where to save the flags?)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/03014c9d0e7aff4638dd310a18fa98b5d62ae2b6.png)

### Visual indication in editor of debug on

Possibilities? Sorry, ugly arrows.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d956edea7118930082d10ea73b14b0e642375cd6.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/b/4bb19ac025f7a89943be0598762361aed354737f.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/958d0c5bfe2ed1b2de6649883275bdaba7b1c521.png)

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [18 July 2025 10:07 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/71 "2025-07-18T10:07:58Z")

</div>

> [@Urs-Eppenberger](#):
>
> The debugging node is an essential part of node-red. It supports the culture behind node-red.

That's well said and I don't see the Node-RED culture as being a "developer culture" rather a "put something together and it works" culture. Node-RED target audience isn't developers and that's a pity.

Hence this discussion on debug nodes - there shouldn't be any debug nodes. Just as a programming language does not have "debug code". You use a debugger for that.

This is where developers and Node-RED users differ: as a developer I want to be able to debug a _running_ system and not redeploy and check what's going on. I can't be restarting production systems just because I forgot to add a debug node somewhere.

Hence why not just improve the "debugger package" to make debugging live systems simpler. Without having to deploy all the time. Its hard to unlearn this "add a debug node, redeploy and hope". Hope that the error happens again. But that's what I'm trying to do. Its far more efficient and makes for simpler flows, i.e. no debug nodes all over the place.

The deactive bug on a debug node is a symptom for "well I added a debug, and I might need again, but I'm not sure because I don't really know what's going on". So I turn it off. But perhaps it should be on again. Oh, too late, bug just happened.

Debug nodes tend not to be removed. Hence the cluttering up flows. Hence making the minification of nodes, especially debug nodes. All a kind of "hack" around the actual problem that it is hard to debug a live node red flow.

---

<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 July 2025 10:45 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/72 "2025-07-18T10:45:33Z")

</div>

> [@gregorius](#):
>
> Just as a programming language does not have "debug code".

Urgh! You've not seen my code then! 😳

> [@gregorius](#):
>
> can't be restarting production systems just because I forgot to add a debug node somewhere.

Of course, any production environment would be working on test and dev environments for debugging anyway. 😉

> [@gregorius](#):
>
> Hence why not just improve the "debugger package" to make debugging live systems simpler.

Possibly because "debugging" in node-red is not just debugging the _system_ but also debugging a _flow_. And these are, of course, two completely different things.

The debugger can be useful for debugging the system (though even there, I would argue that log outputs are also critical to debugging complex systems like Node-RED) but are really not useful for debugging flows.

Really, the `debug` node probably should have been called the `print` or `output` node. Since that is really what it does. It lets us monitor what is happening to the FLOWs rather than the SYSTEM.

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [18 July 2025 11:17 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/73 "2025-07-18T11:17:37Z")

</div>

Thanks for capturing my sentiment. Code has debug code but it doesn’t have a debug command was what I meant. We build debug code from print statements and don’t have `debug(…)` inbuilt command in the language.

Calling debug node the print node would clarify that. Or perhaps call it “outject” as counterpoint to inject. After all both nodes only function when the editor is connected to the server.

I see using a debug as a kind of code smell but introspecting/analysing a system a good way to understand the system.

---

<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 July 2025 12:59 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/74 "2025-07-18T12:59:37Z")

</div>

Working name for my experimental node is:

```txt
threw-out

```

🤣

If you want to try it out, please install my testbed from GitHub.

> **[GitHub - TotallyInformation/Node-RED-Testbed: A blank canvas to test out ideas for Node-RED...](https://github.com/TotallyInformation/Node-RED-Testbed)**
>
> A blank canvas to test out ideas for Node-RED custom nodes

```bash
cd ~/.node-red
npm install totallyinformation/Node-RED-Testbed

```

It doesn't do a lot right now but if you turn on the checkbox, it will output any input message (in full up to the debug msg length limit) to the debug panel.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/6/966c43b7e52708f2315e0f6f6d7b81d63eb76446.png)

---

<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 July 2025 16:31 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/75 "2025-07-18T16:31:10Z")

</div>

> [@TotallyInformation](#):
>
> ```auto
> npm install totallyinformation/Node-RED-Testbed
> 
> ```

After doing that I don't see a threw-out node.

The startup log gives me this (might have already been there!)

```auto
18 Jul 17:28:24 - [info] Loading palette nodes
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at Object.dirname (node:path:1384:5)
    at loadNodeLocales (/usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js:234:35)
    at loadPluginConfig (/usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js:331:11)
    at loadModuleTypeFiles (/usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js:83:31)
    at loadModuleFiles (/usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js:122:60)
    at load (/usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js:43:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}
⚙️ [nr-class:NrNode:constructor] >> dummy-do-not-use
⚙️ [ti-class:constructor] >> ti-class
⚙️ [nr-class:NrNode:start] >> ti-class

```

---

<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 July 2025 17:08 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/76 "2025-07-18T17:08:43Z")

</div>

Oops, my bad! That only works if you have the manual node-red bug fix I identified earlier! Sorry about that. Let me fix it and I'll update.

---

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [18 July 2025 17:12 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/77 "2025-07-18T17:12:17Z")

</div>

What if we could enable debugging in a node instead of having a node for debugging?

- User opens node config form
- User select "Debug" tab (new tab available to every node)
- Debug node config form opens (the same the current config node has). An additional prop could appear in the form to let Users configure "log input" or "log output". Or allow only debugging outputs or inputs.
- User save the changes
- a new UI feature, like an icon, appears somewhere in the node to tell users it has debug enabled

When a node has debugging configured, Node-RED core will pass log the output before sending the message forward

---

<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 July 2025 17:13 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/78 "2025-07-18T17:13:05Z")

</div>

Done! If you reinstall, it should work.

Please note that the various advanced settings don't yet work. You will always get the full msg output at present. I'll fix that at some point soon.

I got myself sidetracked by trying to make the default node setting not to show the label. But it seems this isn't possible! There is some secret magic that lets the link nodes default to not showing labels but we mere pleb's aren't allowed to do it. ☹

---

<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 July 2025 17:14 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/79 "2025-07-18T17:14:59Z")

</div>

> [@AllanOricil](#):
>
> What if we could enable debugging in a node ?

Personally, I think I would end up getting in a complete mess with that. "Darn it, which nodes did I turn debugging on for?!" - I prefer to see a node.

---

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [18 July 2025 17:17 UTC](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044/80 "2025-07-18T17:17:35Z")

</div>

> [@TotallyInformation](#):
>
> Personally, I think I would end up getting in a complete mess with that. "Darn it, which nodes did I turn debugging on for?!"

The ones that have the new icon or some other UI feature that makes it very clear for the User that debugging is enabled for that node.

[Previous page](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044.md?page=3)

[Next page](https://discourse.nodered.org/t/should-debug-nodes-be-capable-of-passing-the-message-forwards/95044.md?page=5)
