{
  "name": "Merge double run fix (unboxth.xyz)",
  "nodes": [
    {
      "id": "5413f9fb-c8bc-5d65-ad07-357dc99ec8f5",
      "name": "About this workflow",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -60
      ],
      "parameters": {
        "content": "## Downstream node runs twice: demo (unboxth.xyz)\n\nClick **Execute workflow**.\n\n**Lane A (runs twice):** two branches wired straight into one input of `A: Send summary`. Each incoming connection gives that node its own run, so it shows 2 runs (runIndex 0 and 1), each seeing half the data.\n\n**Lane B (fix):** each branch goes into its own Merge input (Append). The Merge combines them in one run, so `B: Send summary` runs once and sees all 4 items.\n\nRule: one wire per Merge input. Built from docs.n8n.io + n8n community answers, checked 4 Nov 2026.",
        "height": 340,
        "width": 620,
        "color": 5
      }
    },
    {
      "id": "95c448ef-56ff-5a43-9b69-66d8b1fa9617",
      "name": "When clicking 'Execute workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        300
      ],
      "parameters": {}
    },
    {
      "id": "6e7de32a-6fe1-5451-80a2-48367a9ffd80",
      "name": "Stripe customers (2 items)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        260,
        260
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return [\n  { json: { email: 'ana@example.com', source: 'stripe' } },\n  { json: { email: 'li@example.com', source: 'stripe' } },\n];"
      }
    },
    {
      "id": "e0b01355-4527-5db0-b95f-fc11e39fe745",
      "name": "HubSpot contacts (2 items)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        260,
        460
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return [\n  { json: { email: 'sam@example.com', source: 'hubspot' } },\n  { json: { email: 'kai@example.com', source: 'hubspot' } },\n];"
      }
    },
    {
      "id": "715dc982-e905-579b-a309-a296e6a6e028",
      "name": "A: Send summary (runs twice)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        160
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "// Shows how many times this node ran and what it saw.\n// $runIndex starts at 0, so a second run shows runIndex: 1.\nreturn [{ json: { runIndex: $runIndex, itemsSeen: $input.all().length,\n  sources: $input.all().map(i => i.json.source) } }];"
      }
    },
    {
      "id": "9fc84776-f11b-53a8-996a-a43a6da4167f",
      "name": "B: Merge (Append)",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        600,
        460
      ],
      "parameters": {
        "mode": "append",
        "numberInputs": 2
      }
    },
    {
      "id": "33311fb6-38f0-54ee-96b4-2383391efa06",
      "name": "B: Send summary (runs once)",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        860,
        460
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "// Shows how many times this node ran and what it saw.\n// $runIndex starts at 0, so a second run shows runIndex: 1.\nreturn [{ json: { runIndex: $runIndex, itemsSeen: $input.all().length,\n  sources: $input.all().map(i => i.json.source) } }];"
      }
    }
  ],
  "connections": {
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "Stripe customers (2 items)",
            "type": "main",
            "index": 0
          },
          {
            "node": "HubSpot contacts (2 items)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stripe customers (2 items)": {
      "main": [
        [
          {
            "node": "A: Send summary (runs twice)",
            "type": "main",
            "index": 0
          },
          {
            "node": "B: Merge (Append)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot contacts (2 items)": {
      "main": [
        [
          {
            "node": "A: Send summary (runs twice)",
            "type": "main",
            "index": 0
          },
          {
            "node": "B: Merge (Append)",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "B: Merge (Append)": {
      "main": [
        [
          {
            "node": "B: Send summary (runs once)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true
  }
}