{
  "name": "Extract TikTok usernames from any video or creator link format",
  "nodes": [
    {
      "id": "403c12fe-20b6-4fc5-93ee-ab9b26c304c8",
      "name": "If invalid TikTok link",
      "type": "n8n-nodes-base.if",
      "position": [
        -272,
        112
      ]
    },
    {
      "id": "73c6e396-f835-446f-8ef5-0ca3daaf230f",
      "name": "Extract username of TikTok creator/video link",
      "type": "n8n-nodes-base.set",
      "position": [
        576,
        176
      ]
    },
    {
      "id": "b5532f7c-73a7-4ecc-8abe-fadb27837c79",
      "name": "Get  final link of TikTok video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        160,
        304
      ]
    },
    {
      "id": "ad8d1445-be09-4be1-9d81-625b70f88a6b",
      "name": "Extract final TikTok video link",
      "type": "n8n-nodes-base.set",
      "position": [
        368,
        304
      ]
    },
    {
      "id": "bf6c655f-fe4e-42fe-87ea-2fa854972305",
      "name": "If final TikTok link",
      "type": "n8n-nodes-base.if",
      "position": [
        -32,
        192
      ]
    },
    {
      "id": "6b26b51d-eb28-43bd-88bb-72de572577d8",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -576,
        112
      ]
    },
    {
      "id": "b18bd6ce-a0ed-4347-aa96-53ab85af6447",
      "name": "Invalid link",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        128,
        0
      ]
    },
    {
      "id": "00dc2cae-06bf-4b32-9804-6da01d394a93",
      "name": "Inform the link is invalid",
      "type": "n8n-nodes-base.form",
      "position": [
        -32,
        0
      ]
    },
    {
      "id": "7118efb8-ef17-4064-948c-dc67e7acec16",
      "name": "If the username is null",
      "type": "n8n-nodes-base.if",
      "position": [
        768,
        176
      ]
    },
    {
      "id": "7078cbb5-fa2a-4484-a8ad-b4d2d18005a3",
      "name": "Username is null/empty",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        1216,
        48
      ]
    },
    {
      "id": "fb4e51b1-8318-4650-9302-375f09c20708",
      "name": "Inform an error retrieving the username",
      "type": "n8n-nodes-base.form",
      "position": [
        1008,
        48
      ]
    },
    {
      "id": "563f8214-4524-422f-a57e-73dd515f4441",
      "name": "Display the creator's username",
      "type": "n8n-nodes-base.form",
      "position": [
        1008,
        288
      ]
    },
    {
      "id": "c57b0292-b789-4b77-8323-900a0761ea71",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        -80
      ],
      "parameters": {
        "width": 336,
        "height": 352,
        "content": "## Decide the input method\n\n**If you don't want to use a form**, you can perfectly change this node to another one also called _\"On form submission\"_ that gets the link and assigns it to a variable ca"
      }
    },
    {
      "id": "70530a04-1c09-4d5b-9f53-40f7299fab75",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -192
      ],
      "parameters": {
        "width": 352,
        "height": 352,
        "content": "## Decide what happens when the link is invalid\n\n**If you don't want to inform the user through the form** that the link is invalid, you can change this section."
      }
    },
    {
      "id": "f3750292-c1de-4e3f-96f2-d4f29a61616c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -48
      ],
      "parameters": {
        "width": 2048,
        "height": 560,
        "content": ""
      }
    },
    {
      "id": "48a10b71-373a-4050-b517-aeedad827793",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        -176
      ],
      "parameters": {
        "width": 432,
        "height": 416,
        "content": "## Decide what happens when the username retrieval fails\n\n**If you don't want to inform the user through the form** that the an unexcpeted error ocurred while retrieving the username, you can change t"
      }
    },
    {
      "id": "2ee12dba-cd19-41b2-8090-9e74b6256f86",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        256
      ],
      "parameters": {
        "width": 432,
        "height": 416,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Decide where to send the creator's username\n\n**If you don't want to inform the user through the form** about the retrieved username ( _{{ $json.username }}_ ), you can send the us"
      }
    },
    {
      "id": "99f54d0a-05e3-4972-958e-269bfcbabe44",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        0
      ],
      "parameters": {
        "width": 496,
        "height": 464,
        "content": "## What does this do?\n\nImagine you want to **automate a task** where, based on a TikTok video link, **you must retrieve the username of the creator of that video**.\n\nMany people may think that it's en"
      }
    }
  ],
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "If invalid TikTok link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If final TikTok link": {
      "main": [
        [
          {
            "node": "Extract username of TikTok creator/video link",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get  final link of TikTok video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If invalid TikTok link": {
      "main": [
        [
          {
            "node": "Inform the link is invalid",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If final TikTok link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If the username is null": {
      "main": [
        [
          {
            "node": "Inform an error retrieving the username",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Display the creator's username",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Inform the link is invalid": {
      "main": [
        [
          {
            "node": "Invalid link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract final TikTok video link": {
      "main": [
        [
          {
            "node": "Extract username of TikTok creator/video link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get  final link of TikTok video": {
      "main": [
        [
          {
            "node": "Extract final TikTok video link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Inform an error retrieving the username": {
      "main": [
        [
          {
            "node": "Username is null/empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract username of TikTok creator/video link": {
      "main": [
        [
          {
            "node": "If the username is null",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}