{
  "name": "Merge never fires: empty branch fix (unboxth.xyz)",
  "nodes": [
    {
      "id": "5413f9fb-c8bc-5d65-ad07-357dc99ec8f5",
      "name": "About this workflow",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -80
      ],
      "parameters": {
        "content": "## Merge never fires: empty-branch demo (unboxth.xyz)\n\nClick **Execute workflow**, then compare the three lanes.\n\n**Lane A (stalls):** Merge in *Choose Branch > Wait for All Inputs to Arrive* needs data on BOTH inputs. Input 1 gets 0 items, so the Merge never runs and `A: never runs` stays grey.\n\n**Lane B (fix 1):** Merge in *Append* mode runs when at least one input has data (v1 execution order).\n\n**Lane C (fix 2):** keep Choose Branch, but turn on **Settings > Always Output Data** on the empty node, so input 1 receives one empty item and the Merge can run. If you use that input's data later, filter out the empty item.\n\nBuilt from docs.n8n.io + Merge V3 source, checked 4 Nov 2026.",
        "height": 380,
        "width": 620,
        "color": 5
      }
    },
    {
      "id": "95c448ef-56ff-5a43-9b69-66d8b1fa9617",
      "name": "When clicking 'Execute workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        380
      ],
      "parameters": {}
    },
    {
      "id": "8370e9d1-4e91-5f1a-8228-a8ac8bdfb5e2",
      "name": "CRM leads (0 items)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        260,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "// Simulates a lookup that finds nothing (e.g. no new CRM leads today).\n// A node that returns zero items ends its branch: nothing is sent on.\nreturn [];"
      }
    },
    {
      "id": "8da0ac0e-3088-5eeb-8598-e59d71fb50e6",
      "name": "Form leads (2 items)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        260,
        500
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "// Simulates a lookup that does return data.\nreturn [\n  { json: { email: 'ana@example.com', source: 'form' } },\n  { json: { email: 'li@example.com', source: 'form' } },\n];"
      }
    },
    {
      "id": "a53e771f-c19b-57f7-a31f-d883a1bcb242",
      "name": "A: Merge (Choose Branch, stalls)",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        560,
        220
      ],
      "parameters": {
        "mode": "chooseBranch",
        "numberInputs": 2,
        "chooseBranchMode": "waitForAll",
        "output": "specifiedInput",
        "useDataOfInput": 2
      }
    },
    {
      "id": "f69e91e6-4a61-5b00-92ae-bdd2fa7a895b",
      "name": "A: never runs",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        820,
        220
      ],
      "parameters": {}
    },
    {
      "id": "7a1ee4ce-d68e-5b42-8651-6be5af7c343d",
      "name": "B: Merge (Append, fix)",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        560,
        420
      ],
      "parameters": {
        "mode": "append",
        "numberInputs": 2
      }
    },
    {
      "id": "86515f15-aa61-5410-bb8e-62a85344f551",
      "name": "B: continues with 2 items",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        820,
        420
      ],
      "parameters": {}
    },
    {
      "id": "c04cca3d-a668-5d5e-a12b-77bfc79fc982",
      "name": "C: CRM leads + Always Output Data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        260,
        720
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "// Simulates a lookup that finds nothing (e.g. no new CRM leads today).\n// A node that returns zero items ends its branch: nothing is sent on.\nreturn [];"
      },
      "alwaysOutputData": true
    },
    {
      "id": "91450577-2e2f-5cda-9947-9a387f2b8a0c",
      "name": "C: Merge (Choose Branch)",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        560,
        720
      ],
      "parameters": {
        "mode": "chooseBranch",
        "numberInputs": 2,
        "chooseBranchMode": "waitForAll",
        "output": "specifiedInput",
        "useDataOfInput": 2
      }
    },
    {
      "id": "cff1235d-9ec1-5d60-9226-f290bd299724",
      "name": "C: continues with form leads",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        820,
        720
      ],
      "parameters": {}
    }
  ],
  "connections": {
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "CRM leads (0 items)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Form leads (2 items)",
            "type": "main",
            "index": 0
          },
          {
            "node": "C: CRM leads + Always Output Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CRM leads (0 items)": {
      "main": [
        [
          {
            "node": "A: Merge (Choose Branch, stalls)",
            "type": "main",
            "index": 0
          },
          {
            "node": "B: Merge (Append, fix)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form leads (2 items)": {
      "main": [
        [
          {
            "node": "A: Merge (Choose Branch, stalls)",
            "type": "main",
            "index": 1
          },
          {
            "node": "B: Merge (Append, fix)",
            "type": "main",
            "index": 1
          },
          {
            "node": "C: Merge (Choose Branch)",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "A: Merge (Choose Branch, stalls)": {
      "main": [
        [
          {
            "node": "A: never runs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "B: Merge (Append, fix)": {
      "main": [
        [
          {
            "node": "B: continues with 2 items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "C: CRM leads + Always Output Data": {
      "main": [
        [
          {
            "node": "C: Merge (Choose Branch)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "C: Merge (Choose Branch)": {
      "main": [
        [
          {
            "node": "C: continues with form leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true
  }
}