How to Create Short URLs & Track Stats with n8n Yourls Node

This n8n workflow automates creating a short URL and instantly fetching its usage statistics using the Yourls node. It saves manual effort and provides quick insights into your link’s performance.
manualTrigger
yourls
Workflow Identifier: 2401
NODES in Use: Manual Trigger, Yourls
Automate short URLs with n8n and Yourls

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

1. What This Automation Does

This workflow helps you make short URLs fast and get their click statistics right away.
The problem it solves is cutting out the slow, manual process of making short links and checking stats on Yourls.
After using this, you get short URLs and their performance numbers without extra clicks or copy-pasting.
This saves time and avoids mistakes in tracking campaign links.


2. Tools and Services Used

  • n8n: Automation platform running the workflow.
  • Yourls URL Shortener: Service to create short URLs and provide stats via API.
  • Yourls API Credentials: Needed to access Yourls programmatically.

3. How the Workflow Works

Inputs

The workflow starts with a long URL (like a blog post link).

Processing Steps

  1. First, a Manual Trigger node starts the process when you click execute.
  2. Then the first Yourls node sends the long URL to Yourls API to create a short URL.
  3. Its output (the new short URL) is passed to a second Yourls node.
  4. The second Yourls node asks Yourls API for the statistics about the short URL.

Output

You get the short URL plus detailed stats like how many times people clicked it.
This data shows up inside n8n’s output panel.


4. Beginner Step-by-Step: How to Use This Workflow in n8n

Importing the Workflow

  1. On the page with this workflow, click the Download button to get the workflow file.
  2. Open your n8n editor (if self hosting n8n, see self-host n8n for help).
  3. Click on Import from File and pick the downloaded workflow JSON file.

Configuring the Workflow

  1. Look at the Yourls nodes and set your Yourls API credentials in the credentials dropdown.
  2. If needed, change the long URL inside the first Yourls node to the URL you want to shorten.
  3. Adjust any titles or labels if you want them different.

Testing and Activating

  1. Run the workflow one time by pressing Execute Workflow on the top right.
  2. Check the output of the second Yourls node for stats data.
  3. If all looks good, toggle the workflow activation switch so you can use it anytime.

5. Customizations

  • You can let the long URL be typed in when you start the workflow by adding an input field to Manual Trigger and using expressions in Yourls nodes.
  • Add a Google Sheets node after stats fetching to save click data automatically.
  • Include an Email or Slack node to send click reports to teammates.

6. Troubleshooting Common Issues

Issue: Authentication failed in Yourls node.
Reason: API Key is wrong or expired.
Fix: Update Yourls API credentials in n8n settings and try again.

Issue: Error saying Cannot read property ‘shorturl’ of undefined.
Reason: Yourls did not produce a short URL, maybe due to bad long URL or server error.
Fix: Verify long URL formatting and test Yourls API connection manually.


7. Pre-Production Checklist

  • Make sure Yourls API credentials are valid and can create URLs.
  • Test the long URL to confirm it works and is correctly written.
  • Run manual tests in n8n to confirm URL creation and stats fetching happen.
  • Back up Yourls credentials and workflow JSON before heavy changes.

8. Deployment Guide

Turn on the workflow switch in n8n to run in production.

This workflow uses Manual Trigger but can be changed to Webhook node for automatic runs.

Keep an eye on the Executions page in n8n for any error or data logs.


9. Summary and Next Steps

✓ The workflow makes short URLs and instantly pulls stats.

✓ This cuts manual work and chance of mistakes.

✓ You get clear stats inside n8n without switching apps.

→ Next: Automate URL creation from forms or CRM.

→ Next: Add Google Sheets to track all link data.

→ Next: Connect marketing tools for better reports.

Keep trying new automations to save time.


Automate short URLs with n8n and Yourls

Visit through Desktop to Interact with the Workflow.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.