{
  "name": "IF + Merge pattern (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": "## IF + Merge pattern that always continues (unboxth.xyz)\n\nIf splits leads by plan, each branch tags its items, and a Merge in **Append** mode joins them.\n\nAppend needs data on at least one input (v1 execution order), so this keeps working when every lead is `pro` or every lead is `free` and one If output is empty. Try it: edit `Sample leads` so all plans are `pro`.\n\nDon't swap Append for *Choose Branch*: that mode waits for data on both inputs and would stop here.\n\nCheck **Settings > Execution Order = v1** on older workflows. Checked against docs.n8n.io on 4 Nov 2026.",
        "height": 360,
        "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": "396abcaf-6c74-578e-a6db-9151b7992620",
      "name": "Sample leads",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        240,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "return [\n  { json: { email: 'ana@example.com', plan: 'pro' } },\n  { json: { email: 'li@example.com', plan: 'free' } },\n  { json: { email: 'sam@example.com', plan: 'pro' } },\n];"
      }
    },
    {
      "id": "9c5f0b0a-d3ed-5b14-b12c-c0131da70e75",
      "name": "Plan is pro?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        480,
        300
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "3c2b743e-b18d-5b19-a781-be770802586a",
              "leftValue": "={{ $json.plan }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "rightValue": "pro"
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "c4e8951b-c698-5913-88d6-7b402e51f345",
      "name": "Tag: priority",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        740,
        200
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "047867f9-a31c-5e04-b54b-b82136b6b5ec",
              "name": "tier",
              "value": "priority",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      }
    },
    {
      "id": "c3e63248-9c77-5225-ae9d-ccb1897e39b0",
      "name": "Tag: standard",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        740,
        420
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "e1b925c6-d3d3-5b4e-a3c0-21b1fb4f512a",
              "name": "tier",
              "value": "standard",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      }
    },
    {
      "id": "4cff65b9-210c-54e8-9cda-8e228b086bb5",
      "name": "Merge (Append)",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        1000,
        300
      ],
      "parameters": {
        "mode": "append",
        "numberInputs": 2
      }
    },
    {
      "id": "c4f413f4-fa86-5461-8bf2-699abd7fe19a",
      "name": "Continue once with all leads",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1240,
        300
      ],
      "parameters": {}
    }
  ],
  "connections": {
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "Sample leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sample leads": {
      "main": [
        [
          {
            "node": "Plan is pro?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Plan is pro?": {
      "main": [
        [
          {
            "node": "Tag: priority",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Tag: standard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tag: priority": {
      "main": [
        [
          {
            "node": "Merge (Append)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tag: standard": {
      "main": [
        [
          {
            "node": "Merge (Append)",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge (Append)": {
      "main": [
        [
          {
            "node": "Continue once with all leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true
  }
}