Quick overview
This workflow uses a Telegram bot to guide staff through entering customer orders, saves each confirmed order as a new row in Google Sheets, and sends an on-demand or daily end-of-day summary back to Telegram.
How it works
- Triggers when a Telegram message is received by the bot.
- Checks the sender’s Telegram user ID against an allowlist and either shows a menu or blocks access.
- Guides the user through a step-by-step order form in Telegram (customer, phone, city, address, product, quantity, price, notes), validating inputs and showing the appropriate reply buttons.
- On confirmation, generates a daily incrementing order ID and appends the order to the “Orders” sheet in Google Sheets.
- Sends a Telegram confirmation message back to the staff member with the saved order ID.
- When the user requests “Today” or when the 9 PM schedule runs, reads today’s orders from Google Sheets and sends a revenue/items/city breakdown summary to the requesting chat or the configured admin chat.
Setup
- Create a Telegram bot with BotFather and add a Telegram credential in n8n for it.
- Create a Google Sheet with a tab named “Orders”, add the required header columns, and connect a Google Sheets OAuth2 credential.
- In both Google Sheets nodes, select the same spreadsheet (document ID) and ensure the target sheet name is “Orders”.
- In the Settings and Settings (Daily) nodes, set allowed_user_ids (comma-separated Telegram user IDs), admin_chat_id for daily summaries, and adjust currency, timezone, phone_regex, and order_prefix as needed.
- Activate the workflow and message /start to the bot, then add any staff user IDs that appear in the access-denied message to allowed_user_ids.