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:
- Why does values cannot be retrieve when the IF is false using `$(‘IF node)’ method?
- Why does when I drag a propertise from the left side, would give
$nodewhich NOT documented. I try to grasp this method, and this only method would works when theIF nodeis false. - If I make a mistake is 2nd question, could you show the documentation how to use
$node? - When a non executed node be retrieve by
$nodeor$('IF node'), why doesn’t this both returnundefinedlike a normal Javascript. Why should it return “Please execute the node first”? - 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 firstNo data found for item-index: "0"'Any Nodes' in $nodealwaysfalse
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