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:
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.
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.
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…
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.
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)