TikTok Username Extraction from Any Video Link Format - n8n Workflow

Use this powerful n8n workflow to reliably extract the creator's username from any TikTok video or profile link format, including short URLs. A highly useful n8n template for reliable data extraction.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Marketing professionals needing clean user handles for large-scale social data collection.

  • Developers or analysts seeking a reliable method for URL resolution and data parsing in an n8n workflow.

  • Users looking for advanced examples of using the n8n HTTP Request node and regex for web extraction.

  • Anyone who needs ready-to-use n8n templates for social media automation.

Overview

Handling social media links can be tricky, especially when mobile apps generate shortened or highly parameterized URLs that obscure the essential data, like the creator's username. This robust n8n workflow solves this by reliably resolving complex TikTok links, including those starting with vm.tiktok.com. The process leverages the n8n HTTP Request node to effectively 'unfold' the redirect, capturing the full canonical URL. Once the canonical URL is secured, a precise regular expression is applied within a Set n8n node to extract the exact username handle (without the '@' symbol). This ensures the resulting data is clean and actionable, providing a powerful n8n template for accurate social media data retrieval.

How it Works

This efficient n8n workflow follows a multi-stage validation and resolution process:


  1. Initiation (n8n trigger): The On form submission n8n trigger starts the process when a user inputs a TikTok link.

  2. Initial Validation: The If invalid TikTok link n8n node checks if the input link is missing the word 'tiktok'. If invalid, the workflow stops and notifies the user.

  3. Username Check: The If final TikTok link n8n node determines if the input link already contains the '@' symbol, which suggests it is a direct or canonical link.

  4. Link Resolution (If needed): If the '@' symbol is absent (indicating a shortened mobile link), the Get final link of TikTok video n8n node executes an HTTP request configured specifically to capture the redirection data. The subsequent Extract final TikTok video link n8n node then parses the response data using regex to retrieve the canonical URL.

  5. Extraction: Regardless of the path, the Extract username of TikTok creator/video link n8n node uses a specific regex (/@([^/?]+)//) on the resolved link to isolate the creator's username, ensuring the n8n workflow retrieves clean data.

  6. Final Validation and Output: The If the username is null n8n node ensures the extraction was successful. If so, the Display the creator's username n8n node presents the retrieved username back to the user via the form interface, confirming the success of the n8n workflow.

Installation Guide


  1. Download the JSON: Save the provided n8n workflow JSON code.

  2. Import: In your n8n instance, click 'New' and select 'Import from JSON'. Paste the downloaded code.

  3. Form Activation: The workflow uses an On form submission n8n trigger. After activating the workflow, open the trigger n8n node and use the provided form URL to test the automation.

  4. No Credentials Needed: This specific n8n workflow uses core nodes (HTTP Request, Set, If) and does not require external service credentials.

Node Details

On form submission (n8n trigger): Serves as the starting point, initiating the entire n8n workflow based on user input of the TikTok creator/video link:.
If invalid TikTok link & If final TikTok link (If n8n node): These powerful flow control n8n nodes manage conditional logic, validating the link structure and determining if URL resolution via HTTP is necessary.
Get final link of TikTok video (HTTP Request n8n node): Crucial for link normalization. It fetches the short link while configured to not follow redirects, allowing the n8n workflow to analyze the response for the full canonical URL.
Extract final TikTok video link (Set n8n node): Uses regular expressions on the HTML data returned by the previous n8n node to isolate the full, canonical TikTok URL.
Extract username of TikTok creator/video link (Set n8n node): Performs the final data manipulation, applying a specific regex pattern (/@([^/?]+)//) to extract only the creator's handle from the clean URL data. This is a core data processing step in this n8n template.
Display the creator's username (Form n8n node): Provides the final output, displaying the successfully extracted username back to the user.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

Featured*