Create and manage short URLs with Telegram bot, MongoDB and Nginx redirects
Ready for 3.0What this workflow does
This workflow has 22 nodes and runs on Telegram events (message) (plus 1 other trigger). Along the way it connects Telegram and MongoDB.
How it runs
Trigger: On Telegram events (message) (plus 1 other trigger).
- Is it reply? (If): checks a condition and branches into true / false
- take short code (Edit Fields (Set)): sets 1 field: shortCode
- Clean Data (Code): runs custom JavaScript code
- take URL (Code): runs custom JavaScript code
- short code exist? (MongoDB): uses MongoDB
- Reply Data (Edit Fields (Set)): sets 2 fields: longUrl, shortUrl
- Not Valid URL? (If): checks a condition and branches into true / false
- short code exist? (Edit Fields (Set)): sets 2 fields: exist, longUrl
- Exist? (MongoDB): uses MongoDB
- Not Valid URL (Telegram): uses Telegram
…plus 10 more steps. See the full node list below.
Services it uses
Other Telegram + MongoDB templates (10)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (8)
- Telegram Trigger
n8n-nodes-base.telegramTrigger - MongoDB
n8n-nodes-base.mongoDb - Telegram
n8n-nodes-base.telegram - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - Webhook
n8n-nodes-base.webhook - Code
n8n-nodes-base.code - Respond to Webhook
n8n-nodes-base.respondToWebhook
From the author
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 data stored in MongoDB, and redirects handled efficiently via…