Bug: Merge node makes all preceding nodes execute

Describe the problem/error/question

I have a Merge node, which is being executed even if the first input doesn’t produce any items. In the example (which is a reduced version of a real world workflow) the first input isn’t even connected to any trigger and somehow produce an empty item.

Please share your workflow

{
  "meta": {
    "instanceId": "3977ceab16aa77b555d3b8af690dedcf8304697d1219f3313692e426a8cc1908"
  },
  "nodes": [
    {
      "parameters": {},
      "id": "72b1e69f-fb98-499e-91e5-9cb37ecdc1f2",
      "name": "When clicking \"Execute Workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        1040,
        300
      ]
    },
    {
      "parameters": {},
      "id": "81b4cff1-5c78-4969-b4b5-e5e98b17caff",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1700,
        60
      ]
    },
    {
      "parameters": {
        "mode": "combine",
        "combinationMode": "multiplex",
        "options": {}
      },
      "id": "0c7d8121-228e-4c1b-bccb-1980bcdd7a9a",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 2,
      "position": [
        2100,
        140
      ]
    },
    {
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": true,
              "value2": true
            }
          ]
        }
      },
      "id": "e0ef4bb8-a358-4900-96bf-171a942f42db",
      "name": "IF true",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1360,
        300
      ]
    }
  ],
  "connections": {
    "When clicking \"Execute Workflow\"": {
      "main": [
        [
          {
            "node": "IF true",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Operation, do nothing": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF true": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}```

## Information on your n8n setup
- **n8n version:**  0.225.2
- **Database:** SQLite
- **n8n EXECUTIONS_PROCESS setting (default: own, main):** main
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** Docker
- **Operating system:** Centos 7

That is not a bug but rather currently expected behaviour. It is however planned to change that with the upcoming n8n version 1.0. There is already a PR:

Is there a containment for this problem?
This behaviour creates undefined behavior, because it force the node to produce data that it shouldn’t, and this leads to data corruption.

Hi @AutoBot, you can find quite a few topics around this here on the forum including suggestions on how to work around this (for example this one).

The link shared by Jan above also includes instructions on how to deploy a preview n8n version already including the new behaviour avoiding the execution of all input branches.

1 Like

New version [email protected] got released which includes the GitHub PR 4238.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.