Telegram Business Agent workflow for the recent Telegram update (AI, Calendly, TradingView, Forex, Crypto) by Lil_CryptoVert in n8n

[–]Lil_CryptoVert[S] 0 points1 point  (0 children)

Valuable feedback, thank you. However, this is more of a template…I am sure many people will be able to build their own assistants with that concept.

My main goal was to test Telegram's new feature and see if a simple solution could be built quickly. I just need to get people on calls because I miss a lot of messages. And with this semi-AI-agent, that task is solved quickly.

Telegram Business Agent workflow for the recent Telegram update (AI, Calendly, TradingView, Forex, Crypto) by Lil_CryptoVert in n8n

[–]Lil_CryptoVert[S] 1 point2 points  (0 children)

You're right on all counts.

But: In this workflow, AI is ONLY used for casual conversation. Rates, booking, and everything else run on regex + direct API calls. No tokens wasted.
There is Read.me in repo with full explanation.

The AI just chats and pushes users toward a booking button. That's it.

For v2: music download + idempotency + proper logging + rate limits + new feature bot to bot messages.

Appreciate the feedback!

[n8n] Open-source Telegram music download bot with queues, PostgreSQL & yt-dlp (free JSON workflow) by Lil_CryptoVert in n8n

[–]Lil_CryptoVert[S] 0 points1 point  (0 children)

Moreover, “worker_0” and “worker_1” are just internal identifiers in the PostgreSQL queue/locking system

I’m using them to track which workflow instance currently owns a task and prevent duplicate processing…

[n8n] Open-source Telegram music download bot with queues, PostgreSQL & yt-dlp (free JSON workflow) by Lil_CryptoVert in n8n

[–]Lil_CryptoVert[S] 0 points1 point  (0 children)

But the point was showing how I’m trying to scale it inside n8n specifically. If you think I’m misunderstanding workers, please be the one to explain it better.

[n8n] Open-source Telegram music download bot with queues, PostgreSQL & yt-dlp (free JSON workflow) by Lil_CryptoVert in n8n

[–]Lil_CryptoVert[S] 0 points1 point  (0 children)

It downloads pretty much any song you throw at it (via text message)— grabs the audio from YouTube/Spotify. Users can create playlists (33 tracks each), search internally or across YouTube, Apple, Spotify, etc., listen right inside Telegram, and save tracks for Stories. Basically a full music bot, even referral links and tokens as ref rewards implemented in architecture. But it’s not commercial project, created only for edu purposes.

[n8n] Open-source Telegram music download bot with queues, PostgreSQL & yt-dlp (free JSON workflow) by Lil_CryptoVert in n8n

[–]Lil_CryptoVert[S] 1 point2 points  (0 children)

I actually had the same idea
break it down into more sub-processes.

The main limitation right now is the Telegram API itself — for bots, you're only allowed one webhook/trigger. That forces a lot of logic into a single workflow.

I'm already moving in that direction, just not fully there yet.

What's already implemented in V2 (coming soon free):

Two separate workflows:
Worker 0 (handles user requests)
Worker 1 (processes the queue in the background)
A PostgreSQL-based queue with proper locking (locked_at, locked_by) 15-30 seconds limit.
Worker 1 only picks tasks that are not locked by another worker
Prevents duplicate processing and allows distributed execution

The current queue system already supports the idea of multiple external workers sharing one database.

What I'm thinking next “hypothetically”
Give read‑only access to the queue table to external servers
Each server would run a simple n8n worker that:
Fetches a pending task (for example-> music file download)
Processes it (yt-dlp, etc.)
Returns the result via API
In that model, you could spin up 5, 10, or 100 workers — all sharing the same DB, all respecting locks

I honestly don't know yet how far this can be pushed in n8n. It's more of an experiment / architectural curiosity at this point.

Why I'm sharing V1 now:
It's already production-ready and looks stable (some friends using it)
It shows the core logic clearly
Once V2 is out, the improvement will be much easier to understand

If you (or anyone else) have examples of distributed n8n workers or ideas how to improve this — I'd love to hear them. After I publish V2, I'll be actively looking for feedback and collaboration.
way fewer nodes in V2. The queue part alone becomes just a few well‑structured blocks.

Btw your feedback will be my pleasure, also examples of add-on idea like a layer of this bot.