# How to find a Junction

**URL:** <https://discourse.nodered.org/t/how-to-find-a-junction/93461>\
**Category:** General\
**Created:** [25 November 2024 21:41 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461 "2024-11-25T21:41:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [25 November 2024 21:41 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/1 "2024-11-25T21:41:09Z")

</div>

I inserted a Junction in a flow, but the crafty beggar was nowhere to be found. I did find it eventually but there must be an easier way to find one than searching every mm of the editor. That (hopefully) being the case - how do I find them?

---

<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:** [25 November 2024 22:02 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/2 "2024-11-25T22:02:36Z")

</div>

Not sure how much help this is but here is a flow to find which tabs contain junctions. You have to specify the name of your flows file. It includes, free of charge, a junction.

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

```auto
[{"id":"c49df6e16a547839","type":"tab","label":"Find Junctions","disabled":false,"info":"","env":[]},{"id":"e883c99617400e92","type":"junction","z":"c49df6e16a547839","x":560,"y":80,"wires":[[]]},{"id":"4cf40830ba8fe0a6","type":"file in","z":"c49df6e16a547839","name":"","filename":"/home/pi/.node-red/flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":300,"y":100,"wires":[["350662d71f70af2f"]]},{"id":"350662d71f70af2f","type":"json","z":"c49df6e16a547839","name":"","property":"payload","action":"","pretty":false,"x":150,"y":160,"wires":[["253619dd52d5e7c2"]]},{"id":"9e2c8711f4b584b0","type":"inject","z":"c49df6e16a547839","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":100,"wires":[["4cf40830ba8fe0a6"]]},{"id":"92bd6c51687e5b5f","type":"debug","z":"c49df6e16a547839","name":"Junctions with outgoing wires","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":140,"wires":[]},{"id":"92f88dd682af2d65","type":"function","z":"c49df6e16a547839","name":"function 29","func":"let tablist = flow.get(\"tablist\")\nfor (let i in msg.payload) {\n let newmsg = {}\n if (msg.payload[i].type == \"junction\") {\n newmsg.payload = {\"id\": msg.payload[i].id, \"Tab\": tablist[msg.payload[i].z]}\n if (msg.payload[i].wires[0].length == 0) {\n node.send([null, newmsg])\n }\n else {\n node.send([newmsg, null])\n }\n }\n}\n\n","outputs":2,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":160,"wires":[["92bd6c51687e5b5f"],["5ca5b2d76cf25068"]]},{"id":"5ca5b2d76cf25068","type":"debug","z":"c49df6e16a547839","name":"Junctions with no outgoing wires","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":180,"wires":[]},{"id":"253619dd52d5e7c2","type":"function","z":"c49df6e16a547839","name":"Find tab names","func":"let tablist = {}\nfor (let i in msg.payload) {\n let newmsg = {}\n if (msg.payload[i].type == \"tab\") {\n tablist[msg.payload[i].id] = msg.payload[i].label\n }\n}\nflow.set(\"tablist\", tablist)\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":160,"wires":[["92f88dd682af2d65"]]}]

```

---

<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:** [25 November 2024 22:29 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/3 "2024-11-25T22:29:11Z")

</div>

So I started to reply with _You can search by type:junction. You can also view all nodes in the info sidebar._

But then thought better and checked - but neither of those statements are true 😳

Issue raised.

> <https://github.com/node-red/node-red/issues/4967>
>
> \### Current Behavior
> 
> Originally raised here: https://discourse.nodered.org/t/ho…w-to-find-a-junction/93461
> 
> The way to locate junctions is by visual inspecting the entire workspace of each tab.
> 
> The following searches do not work:
> \- \`junction\` 
> \- \`type:junction\` 
> \- \`is:modified\`
> 
> For completeness, I also tried \`is:junction\`
> 
> 
> Additionally, junctions cannot be seen in the info sidebar 
> 
> \### Expected Behavior
> 
> To be able to find junctions 
> 
> \### Steps To Reproduce
> 
> Add or modify a junction, try to find it. 
> 
> \### Example flow
> 
> \`\`\`
> paste your flow here
> \`\`\`
> 
> 
> \### Environment
> 
> \- Node-RED version: 4.0.5
> \- Node.js version:
> \- npm version:
> \- Platform/OS:
> \- Browser:

---

<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:** [25 November 2024 22:41 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/4 "2024-11-25T22:41:49Z")

</div>

One of the reasons we didn't add this is because Junctions don't have properties such as a name - so it didn't feel useful to show search results where you cannot actually distinguish the results. This is also why they don't get listed in the info sidebar.

We can revisit the search aspect.

---

<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:** [25 November 2024 22:47 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/5 "2024-11-25T22:47:52Z")

</div>

Yeah, agree, but with my hindsight glasses on, I can see a benefit to searching by type.

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [25 November 2024 22:49 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/6 "2024-11-25T22:49:32Z")

</div>

Yes I already tried those options before asking the question. I think, for me, the issue is the fact that the junction does not appear at the insert point. If I knew WHERE it was going to end up I would be a happy bunny.

Of course having a way to find them after the even would also be useful

---

<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:** [25 November 2024 23:46 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/7 "2024-11-25T23:46:18Z")

</div>

> [@Buckskin](#):
>
> I think, for me, the issue is the fact that the junction does not appear at the insert point.

Yes that's frustrating!

You can make them stand out in the editor with an editor CSS file

```auto
.red-ui-flow-junction-background {
        fill: yellow;
}

```

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [25 November 2024 23:54 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/8 "2024-11-25T23:54:39Z")

</div>

I will try that. I also have a copy of your 'find a node' flow is the 'find a junction' an offshoot of that?

---

<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:** [25 November 2024 23:57 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/9 "2024-11-25T23:57:56Z")

</div>

> [@Buckskin](#):
>
> is the 'find a junction' an offshoot of that?

I don't know!  
I just logged in to my experimental Node-red machine and searched for "junction" thinking it would find all the junctions.  
It didn't, instead it found the flow "Find junctions"

---

<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:** [26 November 2024 09:08 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/10 "2024-11-26T09:08:36Z")

</div>

> [@jbudd](#):
>
> > [@Buckskin](#):
> >
> > I think, for me, the issue is the fact that the junction does not appear at the insert point.
> 
> Yes that's frustrating!

Aside from the search question, it would be helpful to understand what is happening when you insert the junction for it not to appear where you are inserting it.

1. How are you inserting the junction?
2. Once you found the junction, how far off was it?

---

<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:** [26 November 2024 09:34 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/11 "2024-11-26T09:34:14Z")

</div>

I alos have this problem from time to time

When you right click on a wire and insert junction, it seems to be inserted half-way along the wire and not at the insertion point

This can often be behind existing nodes which is why the problem occurs

---

<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:** [26 November 2024 10:14 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/12 "2024-11-26T10:14:17Z")

</div>

You most often want to insert junctions when the desktop is pretty congested.

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

I'd like to insert a junction in the wires leading from the triggers to the function so I highlight the wires, place the cursor where I want the junction, right click and insert.  
It gets inserted in all those wires, good.  
But it's not where the cursor is. Instead it's near the middle of the wires and of course the wires are all redrawn.

![junction](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/a/3ad7b85e21e21b1f021e83531e92c736b19198fd.gif)

Junctions getting created beneath other nodes can occur, but I find it unusual. This

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/0/006e46e4e8d1aa51b1893a9e4a10a9983eb03548.png)  
Results in this  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/c/dcd9de6ad1516a4e03f9eef037deb04f7a924918.png)  
**The joined/redrawn wires are deselected.**

1. It would be better if the junction is inserted at [the grid point closest to] the cursor.
2. Selecting the redrawn wires and new junction would make it's location clearer. cf a moved/modified/inserted node is highlighted by the blue dot.
3. Actually the selected appearance of a junction is pretty subliminal. Maybe a fill rather than an outline would be better?

ps Sometimes wires are too close together to easily select the right ones.  
If you instead drag to select a bunch of nodes and their wires then insert a junction, it does a good job of not messing up what links where, but inserts a junction in each wire.

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 November 2024 10:32 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/13 "2024-11-26T10:32:00Z")

</div>

> [@jbudd](#):
>
> the selected appearance of a junction is pretty subliminal. Maybe a fill rather than an outline would be better?

Personally I would prefer it to be a little larger, sometimes I find it tricky to select the input or output rather than the body, making connecting up a problem sometimes.

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [26 November 2024 10:45 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/14 "2024-11-26T10:45:47Z")

</div>

Right click, insert Junction. Above and to the left. About 24 squares above and 10 squares to the left (Grid squares)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 November 2024 10:49 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/15 "2024-11-26T10:49:45Z")

</div>

@knolleary there appears to be a problem with right click \> insert when zoomed. If I zoom out three times and then try, it inserts at the wrong point.

---

<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:** [26 November 2024 10:52 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/16 "2024-11-26T10:52:14Z")

</div>

So I think there are two separate issues here:

1. inserting a link into a wire defaults to placing the junction at the mid-point of the wire, rather than where the user clicked.
2. if the workspace is zoomed, the insert position is not calculated correctly

If anyone wants to get an issue raised, that would be appreciated.

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [26 November 2024 11:35 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/17 "2024-11-26T11:35:45Z")

</div>

Done, under 'Inserting a Junction Issues'. Hope it is OK as this is the first time I have raised an issue on Github

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 November 2024 11:47 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/18 "2024-11-26T11:47:16Z")

</div>

> [@Buckskin](#):
>
> Done, under 'Inserting a Junction Issues'

Could you post a link to it here please, so we can easily find it.

---

<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:** [26 November 2024 13:09 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/19 "2024-11-26T13:09:37Z")

</div>

Here it is - [Inserting A Junction Issues · Issue #4969 · node-red/node-red · GitHub](https://github.com/node-red/node-red/issues/4969)

Thanks @Buckskin - good first issue!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 December 2024 13:10 UTC](https://discourse.nodered.org/t/how-to-find-a-junction/93461/20 "2024-12-10T13:10:32Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
