Error finding the referenced node

Describe the problem/error/question

Hello! I will try to describe the error as much as possible.
What we did was that we made a node run at the start, and THEN we were able to reference that node wherever we want (also in loops).

Something like this - “Get owners“ runs first, and we were able to use the returned data further. For example, in a loop, we dont have to make a call to the Postgres DB every time:

Now we get an error - Error finding the referenced node

When I try to find the node, it doesn’t appear in the offered list

What is the error message (if any)?

I think it is something similar to this post:

Information on your n8n setup

  • n8n version: Version 1.106.3
  • Database (default: SQLite): Postgres
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker

hello @Emils_Bisenieks

Nodes should be chained together. You can’t split them to different paths and refer each other between paths. Consider each path as a separate execution.

In your case place the Merge node in-between.

hey @barn4k

My approach worked perfectly for 2 years without problems, but yeah, I will recheck the workflows and do the necessary edits

1 Like

The fact that it worked doesn’t mean that it was configured correctly :slight_smile:

3 Likes

To reference data from a previous node in n8n, you need to connect (chain) your nodes directly. If you don’t want to chain them, you can store the value in Redis and retrieve it later in an “unchained” node.

Sometimes, even if nodes like Switch or Aggregate are chained, they might not pass the data as expected. In those cases, make sure to enable the “Pass all data” option.

1 Like

Thanks, guys!

Did the necessary edits

Wait a minute.
It was extremely convenient and seemed like a feature because the workflows were executed from top to bottom. Most workflows use this feature, so I don’t think it’s just me.
I hope it bug and will be fixed soon…

@artemik83 Yes, I was thinking the same thing

They are executed from top to bottom (more about the logic here: Execution order in multi-branch workflows | n8n Docs), but you can’t refer to nodes between branches. You don’t even have an option to select the nodes from another branch in the node’s input.

Like in the example.

The last variable branch1_last will be calculated (if the previous branch is executed), but the second one will always throw an error (and it’s totally logical)

.

I can, and in 1.107.4 this bug fixed and you can refer to any node, which were executed in workflow and it’s super logical.

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