# Thoughts on the use of \`link\` nodes (Asking you)

**URL:** <https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853>\
**Category:** General\
**Created:** [22 June 2024 00:26 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853 "2024-06-22T00:26:40Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 June 2024 00:26 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/1 "2024-06-22T00:26:40Z")

</div>

Quick question - I don't know if there is an easy answer to this, so I'm asking.

Way back when there were no such things as the `link-in` and `link-out` nodes.  
(I'll ignore the `call` for now)

So there were a lot of _wires_ joining code together.

Nowadays when I make code I try (yeah - it's in the name) to make things _modular_.

- Things are done in that block of code and the result is passed on.

The `link` node/s allowed all the _backward running_ wires to be _hidden_ and made for a cleaner looking flow.

So I have my _blocks of code_ (aka routines) sitting there in their little bunch/group in/on the screen.

The _output_ is then going to the next _block of code_.

Normally this would be done with the default `wire` connecting the two parts.

But I'm wondering if it is ..... nicer (?) to use the `link` nodes.  
That way you have clear demarcation between the blocks.

Yes, you can `group` the blocks of code. I do that sometimes too.

But I'd prefer to stick to one thing at a time.  
This is about using the `link` node rather than just using the default `wire` to connect blocks of code.

Thoughts?  
For/Against?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [22 June 2024 05:35 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/2 "2024-06-22T05:35:50Z")

</div>

There is no right or wrong, some people like a mess, others like it clean. I suspect that over time with expercience, one starts to optimize/compact flows.

I have a single flow that is taking many steps and it's all connected via link nodes just to make it a bit more compact within the group/layout. I wish there was a collapsible group though (with its own variables).

example monstrosity:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1cd7dc1841780c07ed7a96a0a86d3c429c26beae.png)

The link call nodes are used a lot within my flows, they are invaluable for reusables.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 June 2024 05:39 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/3 "2024-06-22T05:39:22Z")

</div>

Thanks.

I wasn't wanting to say there is/was a RIGHT and WRONG way.

I'm _seeing_ things and am wondering how others structure their flows.

---

<div class="post-metadata">

**Author:** ![MyRandomThoughts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myrandomthoughts/32/41085_2.png) [@MyRandomThoughts](https://discourse.nodered.org/u/MyRandomThoughts)\
**Post date:** [22 June 2024 07:59 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/4 "2024-06-22T07:59:16Z")

</div>

I use link nodes a lot, nothing like the monstrosity that bakman2 has done above. 🙂 If I have a flow that does one job, it will have wires throughout.

Where I use them the most is for timers as I posted [here](https://discourse.nodered.org/t/does-anyone-else-do-timers-like-this) previously, and common linking outputs - alerting, flow logging.

Oh, also make sure you name your link node pairs/partners, it helps with debugging. I also change the icons to match too.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 June 2024 08:09 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/5 "2024-06-22T08:09:47Z")

</div>

Ok.

I have a little _rule_ for the use of them myself.

If local (on the same tab) leave them shrunk.  
And **YES** names are good.

If they go between tabs, expand them to their full size.

This is ONE of the many flows I have one one RasPi

 ![Screenshot from 2024-06-22 18-05-20](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/428579b104f6d8e74875c571ffeb0fbd525b3819.png)

Interestingly opposite to you I leave the wires connected for local `inject` nodes and `debug` nodes.

Though in saying that you can see a lot of `inject` nodes on the right side of that picture.

I do appreciate what you said though. I do see uses for how you do what you do.

So if you look at that picture, most of the _blocks_ are not DIRECTLY connected to others.  
I use the `link` nodes to do that.

I think I like this because if I move one of the _blocks_ the connecting (invisible) wires aren't seen and it makes for a clearer look of things.

🤷

---

<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:** [22 June 2024 08:44 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/6 "2024-06-22T08:44:45Z")

</div>

I don't have nearly such large flows as that.  
Instead I put any self-contained processes on a separate editor tab and use link calls to connect to it.  
Examples include database insert/select, email or SMS notifications etc.  
No doubt other people prefer subflows for such tasks.

I also put the nodes which perform a defined function into a group together.  
I try to line up nodes vertically and horizontally.  
Within the group I use junctions to prevent wires crossing and passing beneath nodes.  
Connections from one group to another mostly use link calls.

Like this it's easier for me to identify the flow and nodes to update when I need to modify a program.

Here's an example

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/e/8e812c0cf780e418271e3a769e178672f0d966fc.png)

Flows with widely spaced nodes, curvy wires and a lot of link nodes give me a headache:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/f/9fa7480e897adcf35f1395fc165d7c7e1a13c641.png)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 June 2024 09:04 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/7 "2024-06-22T09:04:47Z")

</div>

> [@jbudd](#):
>
> Within the group I use junctions to prevent wires crossing and passing beneath nodes.

You've lost me there.

What is the difference between `junction` and `link` nodes?

I sort of agree with your second picture, but shall accept that when _designing_ something my flows look like that sometimes. 😉

Interestingly I am turning to the thinking that within a _group_ (block) I won't use `link` nodes.  
The only `link` nodes are the main input or output of that _group_.

---

<div class="post-metadata">

**Author:** ![MyRandomThoughts](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/myrandomthoughts/32/41085_2.png) [@MyRandomThoughts](https://discourse.nodered.org/u/MyRandomThoughts)\
**Post date:** [22 June 2024 09:31 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/8 "2024-06-22T09:31:41Z")

</div>

Your screenshots are how I work too. The second one would only be used to determine how to get something to work and lay it out correctly.

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

This is one example of how I use the link nodes.  
This group is just to display a nice interface on the dashboard for controlling one of my wireless speakers.

Top input is from my music flow that formats a `msg` object.  
Bottom input is for enable/disable of the controls when performing long actions (skip album/artist)  
Output is for change in volume, track or play/pause control.

I format it this way, so that I just need to copy/paste the entire group for a new speaker and change a couple of things. Very modular.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 June 2024 09:35 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/9 "2024-06-22T09:35:40Z")

</div>

I need to go that extra distance to change the icon of the `link` node.

I guess I have that extra bit of effort to apply.

But a good idea.  
Though I'm not sure the in/outputs are that definable.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [22 June 2024 10:19 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/10 "2024-06-22T10:19:15Z")

</div>

> [@Trying\_to\_learn](#):
>
> What is the difference between `junction` and `link` nodes?

junction:

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

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 June 2024 10:19 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/11 "2024-06-22T10:19:49Z")

</div>

Ah, thanks. Yeah. Silly me.

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [22 June 2024 11:04 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/12 "2024-06-22T11:04:15Z")

</div>

this is one of my earlier flow, still working perfectly, so did not bother to disturb. although, if i want to try do some modification, i get lost.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/f/af306eb33471b07d2e15396a1691e7e36374dd6f.png)

after getting more tips and experience from the forum, this is what my newer flow looks like, grouping them and connecting with link nodes, does appear better.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/a/dab6d49fa2a157725b17f52db6dea624a75bf9c2.png)

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

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 June 2024 11:06 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/13 "2024-06-22T11:06:51Z")

</div>

Strange, I can't see the second picture.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [22 June 2024 11:34 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/14 "2024-06-22T11:34:22Z")

</div>

> [@Trying\_to\_learn](#):
>
> I can't see the second picture

> [@Thoughts on the use of \`link\` nodes (Asking you)](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/6):
>
> I don't have nearly such large flows as that. Instead I put any self-contained processes on a separate editor tab and use link calls to connect to it. Examples include database insert/select, email or SMS notifications etc. No doubt other people prefer subflows for such tasks. I also put the nodes which perform a defined function into a group together. I try to line up nodes vertically and horizontally. Within the group I use junctions to prevent wires crossing and passing beneath nodes. …

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 June 2024 20:41 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/15 "2024-06-22T20:41:01Z")

</div>

Oops, that

> I can't see the second picture

was for @smanjunath211

I see all 3 pictures in the reply, but if I click on any of them I am only offered 2 to see in a larger scale.

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [23 June 2024 01:49 UTC](https://discourse.nodered.org/t/thoughts-on-the-use-of-link-nodes-asking-you/88853/16 "2024-06-23T01:49:25Z")

</div>

> [@Trying\_to\_learn](#):
>
> but if I click

strange, I cant click it too.
