Track receipt expenses from Telegram using Google Gemini and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 25 nodes and runs on Telegram events (message). Along the way it connects Google Sheets, Telegram, Google Drive and Google Gemini Chat Model.
How it runs
Trigger: On Telegram events (message).
- Normalize Message Fields (Edit Fields (Set)): sets 6 fields: chatId, messageId, caption…
- Route by Message Type (Switch): routes items into 2 branches
- Read All Expenses from Sheets (Google Sheets): uses Google Sheets
- Download Receipt File (Telegram): work with file
- Ask for Receipt Prompt (Telegram): uses Telegram
- Filter: keeps only the items that match a condition
- AI Receipt Vision Chain (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Vision Model; output parser: Build Receipt Schema
- Upload Receipt to Google Drive (Google Drive): uses Google Drive
- Summarize: summarizes / groups the items
- Prepare Extracted Fields (Edit Fields (Set)): sets 18 fields: receiptId, receiptKey, messageId…
…plus 12 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (13)
- Edit Fields (Set)
n8n-nodes-base.set - Switch
n8n-nodes-base.switch - Google Sheets
n8n-nodes-base.googleSheets - Filter
n8n-nodes-base.filter - Summarize
n8n-nodes-base.summarize - Aggregate
n8n-nodes-base.aggregate - Telegram
n8n-nodes-base.telegram - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - If
n8n-nodes-base.if - Google Drive
n8n-nodes-base.googleDrive - Telegram Trigger
n8n-nodes-base.telegramTrigger - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
From the author
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…