Compare Datasets does not return an empty item with “Always Output Data” enabled

I’m having trouble counting the “Different” elements produced by the Compare Datasets node.

What I’m trying to do: My project fetches an online XML file and compares it with the previously fetched version. Depending on whether differences exist, I want the workflow to take different actions.

What works: The fetching and comparison steps run correctly. The issue is with the empty output.

The problem: When the two XML files contain identical values, the “Different” output returns nothing, even though “Always Output Data” is enabled…. I expected it to return an empty array, which I could then pass into the “Count New Elements” node. An empty array should result in a count of 0, which would feed into the IF node.

Instead, the “Count New elements” node receives no input, there is nothing I can drag and drop into the “Fields to summarize/Field” section, even when I connect the “In A only” output.

What am I doing wrong here?

Information on your n8n setup

  • n8n version: 1.123.5
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): don’t know
  • Running n8n via: n8n cloud
  • Operating system: Windows

That’s a hard one, because that might be the expected behavior of this node.

What you can try, though, is to use the Merge node with a custom SQL string.

I tried to paste the workflow here, but there seems to be a bug when I paste SQL queries.