Custom API Endpoint for TinyURL Link Shortening - n8n Workflow

Use this powerful n8n workflow to create a custom API endpoint that shortens links instantly using TinyURL, ideal for integrating link management into any application via a simple n8n trigger.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers who require a fast, reliable, private API service for URL shortening without exposing TinyURL credentials publicly.
Users of n8n templates looking for a pre-built API gateway solution.


  • Automation specialists needing to integrate link management into custom scripts or other n8n workflow processes.

Overview

This specialized n8n workflow transforms a standard HTTP POST request into a functional URL shortening service using the TinyURL API. It addresses the common need to rapidly generate shortened links from external applications or other automations. By setting up a dedicated n8n trigger, you ensure that external services can communicate securely and receive an immediate response. This n8n workflow is highly efficient, utilizing a powerful n8n node for HTTP requests to manage the complex API interaction, making it a valuable addition to your collection of n8n templates.

How it Works

This automation begins with a dedicated n8n trigger awaiting a specific request:


  1. Webhook Trigger: The Receive Link Webhook n8n trigger waits for a POST request at the specified path (shorten-link). This request is expected to contain the target long URL, your TinyURL apikey, and optionally, an alias or description in its JSON body.

  2. API Call: The Create TinyURL n8n node takes the data received by the n8n trigger and constructs a POST request to the TinyURL API endpoint (https://api.tinyurl.com/create). Crucially, the n8n node extracts the required apikey for authentication and the target url for shortening.

  3. Response Handling: The API response, which contains the newly generated shortened URL, is passed to the final Respond with Shortened URL n8n node.

  4. Completion: This final n8n node immediately sends the API response back to the original caller of the n8n workflow, completing the link shortening process instantly.

Installation Guide


  1. Import: Copy the entire n8n workflow JSON provided and import it into your n8n instance.

  2. Activate Webhook: Locate the Receive Link Webhook n8n trigger node. Note the unique URL provided by n8n. This is the endpoint your external application will call.

  3. Test/Configure: Ensure your calling application sends a POST request with a JSON body structured like:

{
"apikey": "YOURTINYURLAPIKEY",
"url": "https://your-long-url.com/page/data",
"alias": "optional_alias"
}

  1. Credentials: This n8n workflow dynamically injects credentials (API Key) from the incoming webhook request body, meaning no fixed credentials are required within the n8n node itself, simplifying maintenance compared to many other n8n templates.

Node Details

This n8n workflow utilizes core nodes to achieve its goal:

Receive Link Webhook (n8n trigger):
Function: Acts as the entry point and n8n trigger for the entire n8n workflow. It listens for external POST requests.
Key Configuration: Configured to the path /shorten-link and set to respond using a dedicated response node (responseNode).
Create TinyURL (HTTP Request n8n node):
Function: Executes the external API request to TinyURL, transforming the input data into the required JSON payload.
Key Configuration: Uses dynamic expressions to pull url, alias, and description from the incoming webhook body into the JSON request payload. The apitoken is passed securely as a query parameter, also pulled dynamically via ={{ $json.body.apikey }}.
Respond with Shortened URL (Respond to Webhook n8n node):
Function: Immediately sends the output from the Create TinyURL n8n node back to the system that initiated the n8n trigger, providing real-time results.
* Key Configuration: Set to respond with allIncomingItems to send the complete API response back to the caller.

Related n8n Workflows

Free

Nodes: 4 Nodes
Updated: December 26 2025
View all
Created by
ist00dent
ist00dent

I’m a dedicated automation engineer passionate about no-code and low-code solutions. I design and implement robust n8n workflows—integrating APIs, databases, and messaging—to eliminate manual tasks and accelerate delivery. Leveraging Python and C#, I build scalable, adaptable automations that empower teams to focus on high-value work.

Featured*