Hello n8n Community! ![]()
I wanted to share a comprehensive automation system I built for a Spa/Salon business. This system manages the entire lifecycle of a booking—from the initial customer message to revenue reporting—using n8n, Telegram, Google Sheets, and Google Calendar.
Here is a breakdown of how the system works.
1. System Overview
The system consists of 5 main workflows that work together to replace manual administrative tasks:
-
Workflow C - New Order Processing: Automatically handles manual entries from Google Sheets, calculates revenue, creates calendar events, and notifies the team.
-
Workflow D (Chat) - Telegram Booking Bot: Parses natural language messages from customers (e.g., “Book for Anna, 2 PM”) using Regex and saves them to the database.
-
Workflow D (Form) - Web Booking: A clean n8n Form for standardized booking input.
-
Workflow B - Staff Reminders: A background cron job that scans upcoming appointments and tags the specific staff member on Telegram 2 hours before the service.
-
Workflow E - Revenue Reporting: Generates a weekly financial report with “Top Staff” and “Top Services” rankings and sends it to the management group.
2. Block-by-Block Analysis
Workflow C: New Order Processing (From Sheets)
Trigger: Row Added in Google Sheets (when a receptionist manually enters a booking).
-
Get Price List: Fetches service prices from a config sheet.
-
Code Node: Matches the requested service strings with the price list to auto-calculate
Revenue. -
Update Row: Writes the calculated revenue back to the Sheet.
-
Google Calendar: Creates a time-block event for the appointment.
-
Telegram: Sends a “New Booking” notification to the general group.
Workflow D (Chat): Telegram Booking Bot
Trigger: Telegram Trigger (listens for messages).
-
Switch Node: Routes commands (e.g.,
/bookingsends a Form link) vs. normal text (processed for booking info). -
Code Node (Regex): Extracts
Customer Name,Phone,Service, andTimefrom the chat message. -
Append Row: Saves the extracted data into Google Sheets.
-
Response: The bot replies to confirm the booking was saved.
Workflow B: Staff Reminders (The “No-Show” Killer)
Trigger: Schedule Trigger (Runs every minute).
-
Get Appointments: Fetches today’s bookings.
-
Filter Logic: Checks if
(Appointment Time - Current Time) <= 120 minutesANDSystem_Notified != TRUE. -
Notify Staff: Sends a Telegram message tagging the specific staff member (e.g.,
@StaffName). -
Update Row: Marks the row as
Notifiedto prevent duplicate alerts.
Workflow E: Revenue Reporting
Trigger: Weekly Schedule (e.g., Sunday at 10 PM).
-
Analysis: Aggregates data from the current month.
-
Logic: Calculates Total Revenue, ranks Staff by performance, and identifies Top Services.
-
HTML Formatting: Formats the message nicely (using bold text and code blocks for currency) for Telegram.
-
Archive: Saves the report summary to a “Monthly_Report” sheet.
3. Workflow Summary Table
Here is the technical logic behind the nodes:
| Workflow | Node Name | Functional Role | Logic/Notes |
|---|---|---|---|
| New Order | Code (Calc Revenue) | Calculation | Uses JS includes() to match service names with prices. |
| New Order | Create Event | Calendar Integration | Converts formats to ISO Date for Google Calendar. |
| Chat Bot | Switch | Routing | Separates Slash Commands (/book) from natural text. |
| Chat Bot | Code (Extract) | Parsing | Uses Regex to handle price shortcuts (e.g., “500k” → 500,000). |
| Reminder | Filter Coming Soon | Logic | Filters: Diff <= 120 mins & Notified is FALSE. |
| Reporting | Send Message | Reporting | Uses HTML Parse Mode for rich text in Telegram. |