Quick overview
This workflow listens for incoming Telegram messages, pulls an FAQ from Google Sheets, and uses Google Gemini to reply in the customer’s language while keeping short chat history. It classifies whether a human needs to step in, logs each exchange to Sheets, and alerts the owner on Telegram when needed.
How it works
- Triggers when a customer sends a message to your Telegram bot.
- Loads your business details and reads the full FAQ table from Google Sheets.
- Uses Google Gemini (with a 10-message chat memory per chat) to generate a reply strictly from the FAQ and business info, then sends the response back to the customer on Telegram.
- Uses Google Gemini again to classify the exchange as “Answered” or “Needs a person” based on the customer message and the bot’s reply.
- Appends the conversation details to a Google Sheets Log tab, marking whether human help is required.
- If the message needs a person, sends a Telegram alert to the owner and logs the handoff to Google Sheets.
Setup
- Create a Telegram bot with @BotFather and add Telegram credentials for the Telegram Trigger and Telegram send-message nodes.
- Add a Google Gemini API credential (from Google AI Studio) and connect it to both Gemini nodes.
- Add Google Sheets credentials and create a spreadsheet with a “FAQ” tab (Question, Answer columns) and a “Log” tab (Time, Customer, Message, Reply, Needs a person columns).
- In the workflow settings fields, fill in your owner Telegram chat ID plus the FAQ and Log Google Sheets document IDs.
Requirements
- A Telegram bot created with @BotFather
- A Google Gemini API key (the free tier is enough to start)
- A Google account for Sheets, with a FAQ tab and a Log tab
Customization
- Change the categories in Needs a person? to decide which messages reach you.
- Add or edit rows in the FAQ tab at any time; the next message already uses them, with no workflow edits.