{
  "name": "Discord server anti-impersonation / scammer tracker with data tables",
  "nodes": [
    {
      "id": "d82794e8-3d69-475a-9508-f8c3cb8c9e21",
      "name": "Hourly Check Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        384,
        976
      ]
    },
    {
      "id": "f0a0411a-89cd-4e3e-afe4-eaaa3512fb5e",
      "name": "Configuration Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        976
      ]
    },
    {
      "id": "981376ca-b0e4-4375-88db-9079b7baa343",
      "name": "Get All Server Members",
      "type": "n8n-nodes-base.discord",
      "position": [
        832,
        976
      ]
    },
    {
      "id": "c8a0fa51-c0d2-433f-953f-8ba981fe0b55",
      "name": "Collection Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        752
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "269f9dc0-6ddd-42b8-9739-801302a06058",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1040,
        976
      ]
    },
    {
      "id": "22ae2bd3-f173-486b-8ca0-3a9ce814e76d",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1280,
        976
      ]
    },
    {
      "id": "c3f5359b-ae56-402d-a40d-179f3a13d6ae",
      "name": "If userid does not exist",
      "type": "n8n-nodes-base.if",
      "position": [
        1760,
        976
      ]
    },
    {
      "id": "614dc5d0-dc35-442a-97ad-0b79a3934b8d",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        2272,
        1360
      ]
    },
    {
      "id": "b60d2d7b-2fb0-4248-8eff-5d9f8a464f38",
      "name": "nickname changed",
      "type": "n8n-nodes-base.discord",
      "position": [
        2976,
        1408
      ]
    },
    {
      "id": "db5c4a89-0df3-4ab0-9a9c-a0477a270ae0",
      "name": "add new user to database",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1936,
        960
      ]
    },
    {
      "id": "94b5f1dc-8d27-4ece-ad9c-4be6a4c8f501",
      "name": "insert user changes to new database",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3168,
        1408
      ]
    },
    {
      "id": "014c01df-0145-45da-ae59-3062c7e1135b",
      "name": "Get row(s) from main DB",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2064,
        1376
      ]
    },
    {
      "id": "996990c4-1ec3-4cae-860e-186810ccfb52",
      "name": "Get row(s) from new DB",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2528,
        1376
      ]
    },
    {
      "id": "6004280c-ecb0-453a-b18a-5a097cdce74f",
      "name": "If userID does not exist",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1568,
        976
      ]
    },
    {
      "id": "f2dda0d7-9a89-4c8d-80d5-2689a6ccd90e",
      "name": "is the new change recorded already",
      "type": "n8n-nodes-base.if",
      "position": [
        2960,
        1760
      ]
    },
    {
      "id": "f56cfe71-98c4-4276-b50b-16be31bb0dad",
      "name": "new name and un is recorded, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        3168,
        1744
      ]
    },
    {
      "id": "7aaa1f12-7a65-4317-89ea-82567c8d2776",
      "name": "Switch1",
      "type": "n8n-nodes-base.switch",
      "position": [
        2768,
        1376
      ]
    },
    {
      "id": "eca6abab-23ac-4fed-b065-cf5e4751eaec",
      "name": "Analysis Section1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2720,
        1680
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "b0e9642a-d736-46df-bffd-384176db3d21",
      "name": "nickname changed again",
      "type": "n8n-nodes-base.discord",
      "position": [
        2736,
        2112
      ]
    },
    {
      "id": "bb868e94-3d2d-45b4-b733-1f2b482db63d",
      "name": "aggregate all necessary data",
      "type": "n8n-nodes-base.set",
      "position": [
        2960,
        2112
      ]
    },
    {
      "id": "c45f8aec-9d37-45ec-87bb-3be61df30795",
      "name": "Analysis Section2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3136,
        1984
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "af1aa655-452d-44ac-9c45-dea2d9714d26",
      "name": "If both username and nickname was changed but user ID is the same",
      "type": "n8n-nodes-base.if",
      "position": [
        3200,
        2480
      ]
    },
    {
      "id": "51e7340f-6ecb-4bb9-bbae-33c9d06ff7b1",
      "name": "If username and nickname hasn't been changed",
      "type": "n8n-nodes-base.if",
      "position": [
        3216,
        2112
      ]
    },
    {
      "id": "3d1715c4-f19a-4626-88ed-22319226e77b",
      "name": "Analysis Section3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3120,
        2352
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "c9c55748-2972-4c45-ae14-d2e6989802f3",
      "name": "if username is the same but nickname is diff",
      "type": "n8n-nodes-base.if",
      "position": [
        3200,
        2848
      ]
    },
    {
      "id": "78399929-db98-4f02-ac15-954b111b9ba0",
      "name": "if username is the same but nickname is diff1",
      "type": "n8n-nodes-base.if",
      "position": [
        3424,
        2944
      ]
    },
    {
      "id": "0e40ca0c-ef45-41ab-b7da-372d7032085e",
      "name": "update both column in records",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3424,
        2480
      ]
    },
    {
      "id": "84bd797a-b26c-4eb6-8a44-3af10a8f5add",
      "name": "update only nickname column",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3632,
        2880
      ]
    },
    {
      "id": "a84f27f7-1844-421b-bb20-dbadce3fa995",
      "name": "update only username on record",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3424,
        2768
      ]
    },
    {
      "id": "c56d4cce-14ee-490c-ad35-d2473b402266",
      "name": "Analysis Section4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3136,
        2688
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "b03e28f9-c68a-45e8-a47d-7d98caac0e1d",
      "name": "No Operation, do nothing1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        4032,
        3056
      ]
    },
    {
      "id": "180d1126-01d3-4bfd-94e3-2b89e64843b8",
      "name": "error handling",
      "type": "n8n-nodes-base.discord",
      "position": [
        3632,
        3056
      ]
    },
    {
      "id": "5a7dc64d-1b2f-4229-a2f2-f0df6f6a58d6",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        496
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "e027cb5f-7841-42e5-aa58-c36a4e7760b8",
      "name": "Comparison Logic Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2032,
        1248
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "97ea6528-1614-42fe-85ab-43966fac6f3c",
      "name": "Analysis Section5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        880
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "f2c70799-b3d2-4f96-9f02-f31b3a3d97f7",
      "name": "Analysis Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2720,
        1984
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Get row(s) from new DB",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get row(s) from new DB",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch1": {
      "main": [
        [
          {
            "node": "nickname changed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "is the new change recorded already",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "error handling": {
      "main": [
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "If userID does not exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "nickname changed": {
      "main": [
        [
          {
            "node": "insert user changes to new database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hourly Check Trigger": {
      "main": [
        [
          {
            "node": "Configuration Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configuration Settings": {
      "main": [
        [
          {
            "node": "Get All Server Members",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Server Members": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) from new DB": {
      "main": [
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "nickname changed again": {
      "main": [
        [
          {
            "node": "aggregate all necessary data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) from main DB": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If userID does not exist": {
      "main": [
        [
          {
            "node": "If userid does not exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If userid does not exist": {
      "main": [
        [
          {
            "node": "add new user to database",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get row(s) from main DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add new user to database": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Operation, do nothing1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update only nickname column": {
      "main": [
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "aggregate all necessary data": {
      "main": [
        [
          {
            "node": "If username and nickname hasn't been changed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update both column in records": {
      "main": [
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update only username on record": {
      "main": [
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "is the new change recorded already": {
      "main": [
        [
          {
            "node": "new name and un is recorded, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "nickname changed again",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "insert user changes to new database": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "new name and un is recorded, do nothing": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If username and nickname hasn't been changed": {
      "main": [
        [
          {
            "node": "No Operation, do nothing1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If both username and nickname was changed but user ID is the same",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if username is the same but nickname is diff": {
      "main": [
        [
          {
            "node": "update only username on record",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "if username is the same but nickname is diff1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if username is the same but nickname is diff1": {
      "main": [
        [
          {
            "node": "update only nickname column",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "error handling",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If both username and nickname was changed but user ID is the same": {
      "main": [
        [
          {
            "node": "update both column in records",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "if username is the same but nickname is diff",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}