Breaking change on If nodes + $items()?

Executing the following simple workflow on n8n 0.201.0 and 0.209.4 returns different results:

On version 0.201.0, the ‘length’ parameter on the last node is 1.
On version 0.209.4, the same parameter is 0.

I’ve observed a change in behavior related to the $items() function for multi-output nodes such as IF nodes.

While $items() would return the items of the branch that was pertinent to the flow of the workflow (true if it followed the true branch on the execution, and false otherwise), now it always returns the items of the true branch, even if it followed the false branch, and even if it is directly connected to the ‘false’ output of an IF node.

I question if this is intentional behavior, as it is not listed as a breaking change on the changelog.

1 Like

Thanks a lot for making us aware of that!

That does not sound like something that we did on purpose. First, it is a breaking change, as you pointed out, and secondly, does it behave now wrong.

Looks like it broke with version 0.205.0.

We will investigate and then get back to you.

2 Likes

While we investigate you could also try the new expression syntax, which is $(‘node_name’).all()

Docs here: Built in methods and variables reference - n8n Documentation

1 Like

Thank you for your fast reply @jan. I’m glad I could help somehow.
And thanks @sirdavidoff. As you pointed out, $('false').all(1) works just fine for the present example, just as $input.all().

A PR to fix the issue got created which should go out on Monday with a bug-fix release.

1 Like

Fix got released with [email protected]

1 Like