See llms.txt for all machine-readable content.

Back to Templates

Log Telegram orders with Google Sheets and send daily sales summaries

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

  1. Triggers when a Telegram message is received by the bot.
  2. Checks the sender’s Telegram user ID against an allowlist and either shows a menu or blocks access.
  3. 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.
  4. On confirmation, generates a daily incrementing order ID and appends the order to the “Orders” sheet in Google Sheets.
  5. Sends a Telegram confirmation message back to the staff member with the saved order ID.
  6. 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

  1. Create a Telegram bot with BotFather and add a Telegram credential in n8n for it.
  2. Create a Google Sheet with a tab named “Orders”, add the required header columns, and connect a Google Sheets OAuth2 credential.
  3. In both Google Sheets nodes, select the same spreadsheet (document ID) and ensure the target sheet name is “Orders”.
  4. 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.
  5. 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.