Automated expense tracking from emails & Telegram with Gemini AI & Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 23 nodes and runs on Telegram events (message) (plus 1 other trigger). Along the way it connects Telegram, Google Gemini Chat Model, Gmail and Google Sheets.
How it runs
Trigger: On Telegram events (message) (plus 1 other trigger).
- Information extraction from telegram input (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model
- Extract the email only from specified bank/UPI apps or the transactions made from them (Code): runs custom JavaScript code
- Raw check if the transaction is 'Budget' or 'Expense' (If): checks a condition and branches into true / false
- Generate the structured data from the raw emails (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model
- Budget information extractor (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model; output parser: Structured Output Parser
- Expense information extractor (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model; output parser: Structured Output Parser
- Extract the information and parse it (Information Extractor): extracts structured fields from text with AI, with model: Google Gemini Chat Model
- Check if the transaction is 'Budget' or 'Expense' (If): checks a condition and branches into true / false
- Check if the transaction is 'Credit' or 'Debit' (If): checks a condition and branches into true / false
- Append transaction data to budget sheet (Google Sheets): append
…plus 4 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.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger).
Nodes used (10)
- Telegram Trigger
n8n-nodes-base.telegramTrigger - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Gmail Trigger
n8n-nodes-base.gmailTrigger - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - Telegram
n8n-nodes-base.telegram - Code
n8n-nodes-base.code - Information Extractor
@n8n/n8n-nodes-langchain.informationExtractor
From the author
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. This n8n template automatically parses bank transaction emails (HDFC, Indian Bank, Indian Overseas Bank, UPI apps like Google pay, Paytm, etc.) - The from…