Hi @FullHaos
Building a Telegram bot for a fitness studio with n8n is a fantastic project, especially with features like role-based access, multi-room management, and double-booking prevention! Choosing PostgreSQL for this backend is definitely the right move over Google Calendar—relational databases handle complex constraints (like unique time slots and room concurrency) much more cleanly using database locks or transactional checks.
To help you get started with the architecture, here is a breakdown of how you can structure your n8n workflow:
* Telegram Trigger Node: Capture incoming commands or callback queries from trainers and admins.
* Router / Switch Node: Branch your workflow based on the user’s role (admin vs. trainer) to handle role-based access control.
* PostgreSQL Node: Query or update your database. For instance, to prevent double bookings, you can use a unique constraint or a transaction check ensuring the trainer and room are free during that time slot.
* Telegram Response Node: Send confirmation messages, schedules, or reminders back to the user.
A Quick Tip on Notifications & Reminders
For reminders, instead of keeping n8n running active delays, you can store scheduled notification timestamps in PostgreSQL and use an n8n Cron node running every few minutes to poll for upcoming classes that need reminders sent out.
If you ever want to scale this or want a fully custom setup, Pond AI builds custom AI agents around tools like n8n and Telegram bots. We always provide a free architecture first so you can see how everything fits together, and we offer a 7-day refund policy, meaning there’s zero risk to try us out.
Good luck with your fitness studio bot—it sounds like it’s going to save a ton of administrative headaches.