n8n - 💡(How to fix) Fix compare dataset - weird behavior with prefer input A Version with exclusion [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
n8n-io/n8n#29534Fetched 2026-04-30 06:43:56
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
commented ×1labeled ×1mentioned ×1subscribed ×1

Error Message

  • error: all
RAW_BUFFERClick to expand / collapse

workflow: {"nodes":[{"parameters":{},"type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[0,0],"id":"e62a4a87-9751-4549-820e-08a7de842c45","name":"Whenclicking‘Executeworkflow’"},{"parameters":{"assignments":{"assignments":[{"id":"62772f45-b639-4d26-84b2-633a0767b671","name":"sku","value":"abcd","type":"string"},{"id":"935fb007-032f-46c5-aa4e-144cde70524d","name":"qty","value":0,"type":"number"},{"id":"a0f332b8-bfde-449d-9bfc-d4cb1a90aef9","name":"animal","value":"cat","type":"string"}]},"options":{}},"type":"n8n-nodes-base.set","typeVersion":3.4,"position":[208,96],"id":"2177e9da-0d56-40c0-aae2-1f7e717b0a77","name":"qty=0"},{"parameters":{"assignments":{"assignments":[{"id":"62772f45-b639-4d26-84b2-633a0767b671","name":"sku","value":"abcd","type":"string"},{"id":"935fb007-032f-46c5-aa4e-144cde70524d","name":"qty","value":1,"type":"number"},{"id":"83e0681c-6888-46c3-ac47-2e1c7801ad17","name":"otherField","value":"yes","type":"string"}]},"options":{}},"type":"n8n-nodes-base.set","typeVersion":3.4,"position":[208,-112],"id":"723689a4-b0a6-42bf-9454-74fe54b34d5b","name":"qty=1"},{"parameters":{"mergeByFields":{"values":[{"field1":"sku","field2":"sku"}]},"resolve":"mix","exceptWhenMix":"qty","options":{"skipFields":"","multipleMatches":"first"}},"type":"n8n-nodes-base.compareDatasets","typeVersion":2.3,"position":[400,-32],"id":"120e1a17-d59f-46b3-8890-e0f2c3b9bf18","name":"CompareDatasets"}],"connections":{"Whenclicking‘Executeworkflow’":{"main":[[{"node":"qty=1","type":"main","index":0},{"node":"qty=0","type":"main","index":0}]]},"qty=0":{"main":[[{"node":"CompareDatasets","type":"main","index":1}]]},"qty=1":{"main":[[{"node":"CompareDatasets","type":"main","index":0}]]}},"pinData":{},"meta":{"instanceId":"be20fe11fc00ced591a3987ab38c88172c0aa9dfc3d5ba4109bb7a2427563d57"}}

<img width="1807" height="803" alt="Image" src="https://github.com/user-attachments/assets/952b64e0-b19b-4085-9a41-8100caecaa19" />

different branch node output: [ { "sku": "abcd", "qty": null, "otherField": "yes" } ]

I would expect the same output but with qty=0 and not null value.(same behavior with fuzzy compare enabled). Am i wrong or this is a bug?

core

  • n8nVersion: 2.17.6
  • platform: npm
  • nodeJsVersion: 22.18.0
  • nodeEnv: production
  • database: postgres
  • executionMode: scaling (single-main)
  • concurrency: -1
  • license: enterprise (production)

storage

  • success: none
  • error: all
  • progress: false
  • manual: false
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 168 hours
  • maxCount: 150000 executions

client

  • userAgent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, like gecko) chrome/147.0.0.0 safari/537.36
  • isTouchDevice: false

security

  • blockFileAccessToN8nFiles: false

Generated at: 2026-04-29T15:44:52.508Z

extent analysis

TL;DR

The issue might be related to the merge strategy in the CompareDatasets node, which could be causing the qty field to be overwritten with a null value.

Guidance

  • Review the configuration of the CompareDatasets node, specifically the mergeByFields and resolve settings, to ensure that the merge strategy is correctly defined.
  • Check the input data for the CompareDatasets node to verify that the qty field is not null before the merge operation.
  • Consider adding a default value for the qty field in the Set node to ensure that it is always populated.
  • Test the workflow with a different merge strategy, such as "overwrite", to see if the issue persists.

Example

No code example is provided as the issue is related to the configuration of the n8n workflow.

Notes

The issue might be specific to the version of n8n being used (2.17.6), and upgrading to a newer version may resolve the issue. However, without further testing, it is difficult to determine the root cause.

Recommendation

Apply a workaround by adding a default value for the qty field in the Set node, to ensure that it is always populated, until the root cause of the issue can be determined.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

n8n - 💡(How to fix) Fix compare dataset - weird behavior with prefer input A Version with exclusion [1 comments, 2 participants]