I have created quite nice workflow but then observed that something is wrong…
To make it more visible I have simplified this to simple problem with Merge node
4 blocks
- start
- IF (always false)
- Code (always return something
- Merge Code and IF
Logically Merge shroud not return anything.
But when you look at the green lines - it triggers next nodes
Is there something I don’t understand and don’t know how it works or is it just not working?
I’ve read the threads on the forums but they all refer to old versions of Merge.
Latest online n8n version.
PS: YES I know that I can create merge with Chose Branch option, but this will work only for simple cases. If I will have node CODE instead of IF (and sometime return valid data and sometime not) then Chose Branch is not enough.
Documentation of Merge states in first line:
“Use the Merge node to combine data from multiple streams, once data of all streams is available.”

{
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
20,
-80
],
"id": "7e78345e-4582-45c3-b137-0d5c05fe2142",
"name": "When clicking ‘Test workflow’"
},
{
"parameters": {
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n item.json.myNewField = 1;\n}\n\nreturn $input.all();"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
200,
20
],
"id": "da9af0ec-0b02-49e6-85ef-ac7a94ec1cae",
"name": "Code"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "1b426ded-ec07-4e36-8e29-085d43e2545f",
"leftValue": "1",
"rightValue": "0",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
200,
-100
],
"id": "3bc50cfe-cc28-47b2-ad2e-f9c2394b24d5",
"name": "If"
},
{
"parameters": {},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.1,
"position": [
480,
-80
],
"id": "09e4dbc4-10cd-45f1-a97d-3988e5ce2334",
"name": "Merge"
}
],
"connections": {
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
},
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"If": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"instanceId": "a1b4c568c99e4f8f7799fc00ae4d7e0c29a1e8ebd3776f72563c59b47eb3d28b"
}
}


