Following the long discussions around the new linkcall feature in Node-RED 5.0, we said we'd look at how to make the virtual wires visible in the editor.
By virtual wires, I'm referring to the implicit wires that exist between some nodes but aren't otherwise seen in the editor. There are two types of these virtual wires:
- The Complete/Catch/Status nodes have a virtual wire to any of the nodes they are targeting; they will get triggered when a corresponding event happens on the connected node
- The Link Call node (and, with NR5, the Function node) - which is an inline-node that can make a call to another node and get a response back.
I've spent some time today exploring what we can do. At this stage, I've focussed on the first type; this is because there is an opportunity to reuse a lot of existing code used by the link in/out nodes to draw virtual links when they are selected.
I want to really stress the point that this is a couple hours exploration of the problem. I'm not presenting a full and complete solution. Here's where I've got to:

- Selecting a Catch/Complete/Status node that is connected to specific nodes will show a virtual (dotted) wire to those nodes.
- In the case of the Catch node that can be configured to 'catch all' or 'catch in the group' - I found showing all of the resulting wires got very messy. So instead, it shows a pill with a corresponding label. Room for improvement, but a pragmatic compromise in my opinion.
There are some things that aren't working yet.
- The virtual links only show when selecting the Complete/Catch/Status node. Selecting a node at the other end doesn't show the returning link.
- The whole linkcall situation
My goal so far has been to explore the problem space, dust of areas of the code base I've not touched in some time and see how this can get added in a clean way.
Rather than hardcode knowledge of the Complete/Catch/Status nodes in the editor to do this, those nodes can provide hints to the editor as part of their definition:
Here's the Catch nodes definition. The wires function returns either an array of the nodes its connected to virtually, or a string label to show in the pill button.
virtualInput: {
wireable: false,
wires: function () {
if (this.scope === null) {
return 'all'
} else if (this.scope === "group") {
return 'group'
} else if (Array.isArray(this.scope)) {
return this.scope;
}
}
},
Again, I'm not sure if that's the right API and it may change as we tackle link call connections.
Will share more updates on this thread as my exploration progresses.


