{
  "name": "Find KlickTipp tags to remove by prefix",
  "nodes": [
    {
      "id": "b2eabd36-8caa-4d1d-90b9-19ba3851df80",
      "name": "Sticky Note: Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        256
      ],
      "parameters": {
        "width": 1120,
        "height": 1484,
        "content": "## Overview\n\nThis sub-workflow determines **which KlickTipp tags should be removed** from a contact by comparing:\n\n- a **tag prefix scope** (for example `Zoho |`)\n- a list of **tags that should be kep"
      }
    },
    {
      "id": "303a1833-5382-4cb2-a7ad-edcbb9cc1601",
      "name": "Sticky Note: Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2400,
        256
      ],
      "parameters": {
        "width": null,
        "height": 420,
        "content": "## Input"
      }
    },
    {
      "id": "f2e1c517-f827-45ca-b6ea-2d66b79c0175",
      "name": "Input: Prefix + Tags to keep",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        2464,
        416
      ]
    },
    {
      "id": "d0c28656-36d2-43ce-a290-5412a5ff1ffb",
      "name": "Sticky Note: Input1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2656,
        256
      ],
      "parameters": {
        "width": 384,
        "height": 420,
        "content": "## Determine tags to remove"
      }
    },
    {
      "id": "fbe7d730-22c9-4d00-a578-062caf0cc07f",
      "name": "Sticky Note: Input2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3056,
        256
      ],
      "parameters": {
        "width": null,
        "height": 420,
        "content": "## Resolve tag differences"
      }
    },
    {
      "id": "c72e8ae0-0d34-4281-b1a3-270e3f6b3331",
      "name": "Sticky Note: Input3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3312,
        256
      ],
      "parameters": {
        "width": null,
        "height": 420,
        "content": "## Select tags to remove"
      }
    },
    {
      "id": "fac5d805-c496-4214-b4ec-5fcb84b0f511",
      "name": "Sticky Note: Input4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3568,
        256
      ],
      "parameters": {
        "width": 448,
        "height": 420,
        "content": "## Output: tags to remove\n\nReturns `tagNamesToRemove[]`"
      }
    },
    {
      "id": "cf894d81-5fb7-405b-ae18-ca6ccb75b672",
      "name": "List all tags",
      "type": "n8n-nodes-klicktipp.klicktipp",
      "position": [
        2880,
        352
      ]
    },
    {
      "id": "cf7026dc-1a8e-4b82-88eb-1f97e47b4ec2",
      "name": "Match keep vs all tags",
      "type": "n8n-nodes-base.merge",
      "position": [
        3136,
        416
      ]
    },
    {
      "id": "9f11978f-135b-4d4a-87a7-500cf72b9e35",
      "name": "Collect tags to remove",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3632,
        416
      ]
    },
    {
      "id": "e0799526-5b17-478d-b4e6-441287e91bda",
      "name": "Keep only tags with prefix",
      "type": "n8n-nodes-base.filter",
      "position": [
        3376,
        416
      ]
    },
    {
      "id": "31f797bb-e85e-4ae0-ac26-5e135d669f63",
      "name": "Build prefixed tag names",
      "type": "n8n-nodes-base.set",
      "position": [
        2704,
        512
      ]
    },
    {
      "id": "d1c24b9e-b693-4a4b-8bbe-8432f53b5ab0",
      "name": "Split prefixed tags",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2880,
        512
      ]
    },
    {
      "id": "649ffcb3-d2ff-4b78-9a16-8d72390e6ef1",
      "name": "Set tagNamesToRemove",
      "type": "n8n-nodes-base.set",
      "position": [
        3840,
        416
      ]
    }
  ],
  "connections": {
    "List all tags": {
      "main": [
        [
          {
            "node": "Match keep vs all tags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split prefixed tags": {
      "main": [
        [
          {
            "node": "Match keep vs all tags",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Collect tags to remove": {
      "main": [
        [
          {
            "node": "Set tagNamesToRemove",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Match keep vs all tags": {
      "main": [
        [
          {
            "node": "Keep only tags with prefix",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build prefixed tag names": {
      "main": [
        [
          {
            "node": "Split prefixed tags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep only tags with prefix": {
      "main": [
        [
          {
            "node": "Collect tags to remove",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Input: Prefix + Tags to keep": {
      "main": [
        [
          {
            "node": "List all tags",
            "type": "main",
            "index": 0
          },
          {
            "node": "Build prefixed tag names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}