If I perform a data-merge over a function after a “split in batch” and then check the variable “isDev” from the “.env”-function defined before (before the split in batch) for “true” after the batch I get true AND false in one pass. For checkup: Function2 has a console.log($node[".env"].json["isDev"]);
Is this a bug or a feature?
For a better understanding I have built a pseudo-workflow.
The workflow was executed on version 0.95.1
In the real Zenario a http request with different configurations is executed within the “Split in Batch”. The result should and will be summarized afterwards.
Hey I also had a problem with If statement did you check for whitespace? I kept getting false and then I copied the value for the bool in " edit expression" and noticed there was a space after Yes. When I put the space in the evaluation it returned true like expected. I did not look through your code yet but will soon. So it was "Yes " instead of “Yes” in the result box.
Thx for sharing
For me it might not have been the problem with whitespaces, but much more the understanding of the batch processing of the results.
If multiple objects are returned, each one is checked. Thus in the result also an IF node can be true AND false. But NEVER for the same line/object.
It doesn’t look like the true branch is being triggered from your screenshot it is instead the node after it, Without seeing the full workflow I suspect you have a merge node somewhere along that path which will always expect 2 inputs to run and it doesn’t have one it will go back to a point that it can find some data.
As @jon said that is currently expected behavior. Is, however, planned to change that in the future, probably with the upcoming n8n version 1.0. Here is already a PR: