Yourls URL Management Tool Server for AI Agents - n8n Workflow

Use this advanced n8n workflow to expose Yourls functionality—shortening, expanding, and statistics retrieval—as callable tools for AI agents, leveraging the n8n trigger functionality.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI Developers and Engineers who need to integrate proprietary or self-hosted services like Yourls into their LLM agents.
System Administrators managing Yourls instances looking for powerful automation interfaces.
Users seeking specialized n8n templates to build complex AI-powered automation.
Anyone interested in extending the capabilities of their AI models using specialized n8n node components.

Overview

Integrating custom tooling with modern AI agents can be complex, especially when dealing with self-hosted services like Yourls. This powerful n8n workflow solves this by creating an accessible tool server. By utilizing the specific LangChain/MCP (Multi-Chain Prompting) n8n trigger, this setup exposes three critical Yourls functions: shortening a URL, expanding a short URL, and retrieving usage statistics for a given link. This n8n workflow allows an external AI application to dynamically select and execute these operations as needed, greatly extending the utility of the AI agent while ensuring secure access through a robust n8n node implementation. This particular architecture highlights how flexible n8n can be when acting as a middle layer for AI automation.

How it Works

This n8n workflow operates as a specialized tool server, waiting for requests from an external AI agent or LangChain application. The flow begins with the dedicated Yourls Tool MCP Server n8n trigger. This specialized n8n trigger component stands ready to accept structured requests (or calls) from the AI system. Instead of proceeding sequentially, the subsequent Yourls n8n node operations (Expand a URL, Shorten a URL, and Get stats for a URL) are configured as callable tools connected back to the initial n8n trigger. When the AI agent determines it needs to shorten a link, it sends a structured request to the n8n trigger. The n8n system then executes the corresponding Shorten a URL n8n node and returns the result—the shortened URL—back to the requesting AI agent. This mechanism allows the AI agent to intelligently choose the correct Yourls tool based on the user's prompt, making this one of the most versatile n8n templates available for AI integration.

Installation Guide

To deploy this useful n8n workflow, follow these steps:


  1. Import the JSON: Copy the provided JSON data and navigate to your n8n instance. Click 'New' > 'Import from JSON' and paste the code.

  2. Configure Credentials: Before using the Yourls nodes, you must set up your Yourls API credentials.

Find any of the Yourls Tool n8n node (e.g., 'Shorten a URL').
In the credentials section, click 'Create New'.
* Provide your Yourls URL and your API signature/key.

  1. Activate the Workflow: Ensure the Yourls Tool MCP Server n8n trigger is correctly configured with a webhook path (this is usually set automatically upon import).

  2. Connect the AI Agent: The webhook URL generated by the n8n trigger (found when clicking on the Yourls Tool MCP Server node) must be provided to your external AI Agent framework (e.g., LangChain or similar tool-calling setup) as the endpoint for Yourls tool operations. The n8n workflow is now ready to serve the AI agent.

Node Details

Yourls Tool MCP Server (n8n trigger):
Function: This specialized n8n trigger initiates the workflow when an external AI agent calls one of the exposed Yourls tools.
Key Configuration: It is configured as a LangChain/MCP trigger, meaning it is designed specifically for receiving structured tool-call requests from an AI environment.

Expand a URL (Yourls Tool n8n node):
Function: Executes the Yourls expansion function, taking a short link provided by the AI agent and returning the original, long URL.
Key Configuration: Configured to use the 'Expand' operation.

Shorten a URL (Yourls Tool n8n node):
Function: Executes the core Yourls functionality, taking a long URL input from the AI agent and returning a newly generated short link.
Key Configuration: Configured to use the 'Shorten' operation.

Get stats for a URL (Yourls Tool n8n node):
Function: Retrieves usage statistics, such as click count and creation date, for a specific short URL as requested by the AI agent.
Key Configuration: Configured to use the 'Stats' operation. This demonstrates the versatility of this specific n8n node.

Related n8n Workflows

Paid

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

A hacker by nature, programmer by trade ⚒️ I'm looking to collaborate on things that save human labor 📫 How to reach me Github👇 -> Discord

Featured*