Block 1 - Telegram Trigger
- Type / Role
- n8n-nodes-base.telegramTrigger - telegramTrigger
- Config choices
- Version 1.2
This workflow is provided as-is. Please review and test before using in production.
This workflow contains community nodes that are only compatible with the self hosted version of n8n. This workflow allows you to create and manage custom short URLs directly via Telegram, with all ...
n8n-nodes-base.telegramtrigger, n8n-nodes-base.mongodb, n8n-nodes-base.telegram, n8n-nodes-base.stickynote, n8n-nodes-base.if, n8n-nodes-base.set, n8n-nodes-base.webhook, n8n-nodes-base.code
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Rudi Afandi.
Original n8n.io sourceThis workflow contains community nodes that are only compatible with the self-hosted version of n8n.
This workflow allows you to create and manage custom short URLs directly via Telegram, with all data stored in MongoDB, and redirects handled efficiently via Nginx.
This flow provides a seamless URL shortening experience:
Create via Telegram: Send a long URL to your bot. It will ask if you want a custom short code.
Store in MongoDB: All long URLs and their corresponding short codes are securely stored in your MongoDB instance.
Fast Redirects: When a user accesses a short URL, Nginx forwards the request to a dedicated n8n webhook, which then quickly redirects them to the original long URL.
This setup is straightforward, especially if you already have a running n8n instance and a VPS.
Difficulty: Medium (Basic n8n/VPS knowledge required)
Estimated Time: 15-30 minutes
n8n Instance & VPS: Ensure you have n8n running on your VPS (e.g., 2 core 2GB, as you have).
Telegram Bot: Create a new bot via @BotFather and get your Bot Token. Add this as a Telegram credential in n8n.
MongoDB Database: Set up a MongoDB instance (either on your VPS or a cloud service like MongoDB Atlas). Create a database and a collection (e.g., url or short_urls). Add your MongoDB credentials in n8n.
Here's MongoDB data structure JSON:
>[ {"_id": "686a11946a48b580d72d0397", "longUrl": "https://longurl.com/abcdefghijklm/", "shortUrl": "short-code"} ]
Domain/Subdomain: Point a domain or subdomain (e.g., s.yourdomain.com) to your VPS IP address. This will be your short URL base.
Nginx/Caddy Configuration: Configure your web server (Nginx or Caddy) on the VPS to proxy requests from your short URL domain to the n8n webhook for redirects. (Detailed Nginx config is provided as sticky notes in the redirect workflow)
Import both provided n8n workflows (Telegram URL Shortener Creator and URL Redirect Handler).
Activate both workflows.
Crucial: Set an environment variable in your n8n instance (or .env file) named SHORTENER_DOMAIN with the value of your short URL domain (e.g., https://s.yourdomain.com).
Refer to sticky notes inside the workflows for detailed node configurations and expressions.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
Showing the first 24 of 29 workflow blocks. Download the JSON for the full node graph.
| Workflow | Create and manage short URLs with Telegram bot, MongoDB and Nginx redirects |
|---|---|
| Complexity | advanced |
| Nodes | 29 |
| Categories | Miscellaneous |
| Author | Rudi Afandi |
| Published | 06 Jul 2025 |
Use the JSON export at /data/workflows/5709/5709.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
This workflow contains community nodes that are only compatible with the self hosted version of n8n. This workflow allows you to create and manage custom short URLs directly via Telegram, with all ...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Miscellaneous use case.