Create and Manage Short URLs with Telegram Bot, MongoDB and Nginx Redirects — Workflow n8n

Élevé complexité Déclencheur22 nœuds🏷️ Miscellaneouspar Rudi Afandi

Aperçu

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 Nginx.

How it works 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 cod

Nœuds utilisés

TelegramMongoDBCode

Aperçu du workflow

Validating
Link not valid
Creating new link
Handle Redirects
Link exist, ask another one
Workflow 1: Create Short URL
I. Main Message & Reply Detection
- Telegram Trigger: Receives all Telegram messages.
- Is it Reply? (IF): Checks if message is a reply.
- True: Reply (-> Code)
- Fal
Workflow 2: URL Redirect Handler
- Webhook (Webhook Trigger): Receives short URL request
- Data2 (Set): Extracts short code from webhook URL.
Exist?2 (MongoDB - Find): Finds orig
T
Telegram Trigger
Insert shortCode
New link
Exist?
N
no exist?
E
exist?
W
Webhook
I
Is it reply?
R
Reply Data
askShortCode
Clean Data
askShortCode1
V
Valid URL
take URL
N
Not Valid URL?
Not Valid URL1
T
take short code
short code exist?
S
short code exist?1
I
If short code exist
4
404 page
S
shortCode Data
22 nodes20 edges

Comment ça fonctionne

  1. 1

    Déclencheur

    Le workflow démarre avec un déclencheur déclencheur.

  2. 2

    Traitement

    Les données transitent par 22 nœuds, connecting code, if, mongodb.

  3. 3

    Sortie

    Le workflow termine son automatisation et livre le résultat à la destination configurée.

Détails des nœuds (22)

TE

Telegram

telegram

#1
MO

MongoDB

mongoDb

#2
CO

Code

code

#3

Comment importer ce workflow

  1. 1Cliquez sur le bouton Télécharger JSON à droite pour enregistrer le fichier du workflow.
  2. 2Ouvrez votre instance n8n. Accédez à Workflows → Nouveau → Importer depuis un fichier.
  3. 3Sélectionnez le fichier create-and-manage-short-urls-with-telegram-bot-mongodb-and-nginx-redirects téléchargé et cliquez sur Importer.
  4. 4Configurez les identifiants pour chaque nœud de service (clés API, OAuth, etc.).
  5. 5Cliquez sur Tester le workflow pour vérifier que tout fonctionne, puis activez-le.

Ou collez directement dans n8n → Importer depuis JSON :

{ "name": "Create and Manage Short URLs with Telegram Bot, MongoDB and Nginx Redirects", "nodes": [...], ...}

Intégrations

codeifmongodbrespondtowebhooksettelegramtelegramtriggerwebhook

Obtenir ce workflow

Téléchargez et importez en un clic

Télécharger JSONVoir sur n8n.io
Nœuds22
Complexitéhigh
Déclencheurtrigger
CatégorieMiscellaneous

Créé par

Rudi Afandi

Rudi Afandi

@fanfanra

Tags

codeifmongodbrespondtowebhooksettelegramtelegramtriggerwebhook

Nouveau sur n8n ?

n8n est un outil d'automatisation de workflows gratuit et open-source. Hébergez-le vous-même ou utilisez la version cloud.

Obtenir n8n gratuitement →

Related Miscellaneous Workflows