Track receipt expenses from Telegram using Google Gemini and Google Sheets
Quick overview Youtube Video: https://youtu.be/7GqvPmAHm1A
Quick overview
Youtube Video: https://youtu.be/7GqvPmAHm1A
This workflow captures receipt photos sent to a Telegram bot, uses Google Gemini (via an AI agent) to extract structured expense details, checks Google Sheets for duplicates by message ID, and either warns about duplicates or appends the expense and replies with a confirmation summary.
How it works
- Triggers when a new message is received by your Telegram bot.
- Normalizes the incoming Telegram payload and checks whether the message includes a receipt photo.
- If no photo is attached, sends a Telegram reply asking the user to upload a clear receipt image.
- If a photo is attached, downloads the image from Telegram and sends it to Google Gemini to extract receipt fields as JSON.
- Parses and validates the extracted data (including a confidence score) and flags the receipt for review if key fields are missing or uncertain.
- Looks up the Telegram message ID in a Google Sheets “Expenses” sheet to detect whether the receipt has already been logged.
- If it is a duplicate, sends a duplicate notice via Telegram; otherwise appends the expense to Google Sheets and sends a formatted summary back to the user.
Setup
- Create a Telegram bot with BotFather, add your Telegram credentials in n8n, and ensure the workflow is allowed to receive messages from your bot.
- Add Google Gemini (Google PaLM) API credentials for the Google Gemini chat model used by the AI agent.
- Add Google Sheets OAuth2 credentials and set the target spreadsheet and “Expenses” sheet in the Google Sheets nodes.
- Ensure your “Expenses” sheet includes a column named
messageId(and optionally the other mapped columns likemerchant,receiptDate,total, andreceiptId) so duplicate detection and appends work correctly.
production deployment
Need this workflow deployed or tailored for your business?
I customize n8n pipelines, build proprietary API nodes, and connect production databases with sub-100ms reliability.
creator
iamvaar
Top 50 Verified Creator
AI Automation Engineer building production-grade n8n systems, custom nodes, and LLM pipelines.
n8n.io/creators/iamvaarspecs
related automations
More workflows from iamvaar
Send and track Slack invoice requests with Gemini, Google Sheets and Gmail
Quick overview Youtube Video: https://youtu.be/42-oHh9w9Eo This workflow listens for Slack @mentions, uses Google Gemini to classify the request and extract invoice details, the...
Trigger HVAC upsell campaigns from weather data and handle bookings with GoHighLevel, WhatsApp, WeatherAPI and Gemini
Project Overview: Automated Climate-Driven HVAC Upsell & AI Concierge
Send multi-carrier shipping quotes via WhatsApp with Gemini and ShipEngine
Quick overview Youtube Video: https://youtu.be/jIGBUW1Sx0?si=BNXzk95soO0Nefan
Want this workflow running in your stack?
Book a free 30-minute session. I'll inspect your current infrastructure, review required API credentials, and map out the deployment.