Check executed previous notes

Describe the problem/error/question

I want to check the IF node to get the output using $node or $('IF Node'). The second method always giving empty when the IF is false. I also want to get does a node is executed. So, here are 5 questions I want to ask:

  1. Why does values cannot be retrieve when the IF is false using `$(‘IF node)’ method?
  2. Why does when I drag a propertise from the left side, would give $node which NOT documented. I try to grasp this method, and this only method would works when the IF node is false.
  3. If I make a mistake is 2nd question, could you show the documentation how to use $node?
  4. When a non executed node be retrieve by $node or $('IF node'), why doesn’t this both return undefined like a normal Javascript. Why should it return “Please execute the node first”?
  5. Why can’t I check if a node is executed using 'A not executed node' in $node?

Well, I know I can use the Merge nodes to do a Waiting. But it just make my workflow too long, because I have much not executed nodes which I should add Merge node as many as the not-executed-node. The workflow I design in this question is just an example. The truth is, Q3 and Q4 would use IF Node to check 1. whenever a node is executed; 2. also check the data inside it. I also try to use optional chain like a normal Javascript $('Not Executed Node')?.all(), and it return “Please execute the node first”.

Update: When I use Merge for waiting, some nodes (and unfortunately, the one should not be executed) in a line with Merge would be forcely executed randomly. It also make the Merge return values which it shouldn’t. This is why I also not using Merge.

In summary:
Why don’t it just works like a normal Javascript? Why can’t to just use optional chaining ?. or as simple as 'some props' in $node just to check the not executed nodes?

What is the error message (if any)?

  • no data, execute "IF4" node first
  • No data found for item-index: "0"
  • 'Any Nodes' in $node always false

Please share your workflow

The workflow below would works because I comment the problematic lines. Please uncomment to simulate my question.

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.227.0
  • Database (default: SQLite): Default 8gears/n8n-helm-chart
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker, Helm Chart
  • Operating system: Docker

Sadly do not have much time right now but part of the answer is that you run a very old n8n version. Back then we used different syntax which got deprecated since then and so the docs removed for it. If you upgrade to a current version, it will use the new syntax.

That will also solve your merge node issue:

Alright, I will try to update to latest version.