See llms.txt for all machine-readable content.

Back to Templates

Manage fitness class bookings with Telegram and data tables

Quick overview

This workflow runs a Telegram booking bot for a fitness studio, storing class schedules and member bookings in n8n Data Tables, enforcing capacity limits, and sending daily class reminders.

How it works

  1. Triggers when a new Telegram message is received and parses the command and arguments from the message text.
  2. When users send /classes, it reads active classes from an n8n Data Table, calculates remaining spots from capacity and booked_count, and replies in Telegram.
  3. When users send /book CODE, it looks up the class by code in an n8n Data Table, checks availability, records the booking in a bookings Data Table, increments the class booked_count, and confirms or rejects the booking in Telegram.
  4. When users send /cancel CODE, it finds the user’s active booking in the bookings Data Table, marks it cancelled, decrements the class booked_count, and sends a Telegram confirmation or “no booking found” message.
  5. When users send /mybookings, it fetches the user’s active bookings from the bookings Data Table and returns a list in Telegram.
  6. When admins send /addclass with class details, it verifies the sender against a configured admin ID list, inserts the class into the classes Data Table, and replies with either a success message or usage/authorization guidance.
  7. Runs daily on a schedule, loads all booked bookings, checks whether each class is active and scheduled for today, and sends Telegram reminders to the booked users.

Setup

  1. Create and connect a Telegram bot credential, and ensure it is selected for the Telegram trigger and all Telegram send actions.
  2. Create two n8n Data Tables (for example, studio_classes and studio_bookings) with the columns used in this workflow (classes: code, title, room, day, start_time, capacity, booked_count, active; bookings: code, user_id, user_name, status, created_at) and update each Data Table node to point to your table IDs.
  3. In the configuration step, set studio_name and optionally set admin_ids to a comma-separated list of Telegram numeric chat IDs to enable /addclass.
  4. Review the daily schedule trigger time (currently 08:00) and adjust it to match your studio’s timezone and preferred reminder time.