All challenges

Challenge 25

Your Own URL Shortener

Build a working link shortener in n8n: a form that makes short links, and a web address that redirects and counts every click.

AdvancedComplexity:Time: 30–40 min

Your task

Make short links for our posters and count how many people click each one. An unknown link should say so politely rather than break.

Your bonus task

Add a stats address that lists every link with its click count, most clicked first, and lock the link-making form so only your team can create new ones.

Example use cases

  • A team printing posters with a QR code who want to know which poster actually got scanned.
  • A newsletter with three links, where the only question that matters is which one people clicked.
  • Any small service that has to answer a real web request rather than only process data in the background.

Before you start

  1. 01

    Sign up for n8n Cloud or open your n8n workspace. No other account is needed, and nothing is sent anywhere.

  2. 02

    Create a Data Table called short-links with three columns: code and target as text, and clicks as a number.

  3. 03

    This challenge only works once the workflow is published: test webhook URLs stop listening after one call, while the production URL stays up. Publish first, then try the links.

  4. 04

    Keep the n8n Webhook node documentation open – the difference between the test and production URL trips up almost everyone the first time.

What the workflow must do

  1. 01

    Submitting a long address in the form returns a short code, and the link, the target and a click count of zero are stored in the Data TableA table that lives inside n8n and keeps its rows between runs, so the links and their click counts survive every execution..

  2. 02

    Opening the short address in a browser lands on the long address, and the click count for that code goes up by exactly one per visit.

  3. 03

    An address with a code nobody created answers "that short link does not exist" with a 404, and no row is touched. Bonus: the stats address lists every link, most clicked first, and the creation form asks for a username and password.

Solution

See the workflow challenge answer

Reveal the completed workflow only when you are ready to compare it with your own.

Submit as solved

Ready to submit?

Submit when your team has a working workflow to demonstrate.

Solution

Reveal the workflow solution?

This will show the completed workflow for this challenge. Are you sure you want to continue?

Mentor review

Find a mentor and ask them to review.

Show them your working workflow. Once they approve it, collect the balloon for this challenge.