AI Expense Tracker: Voice & Text via Telegram with Cost Tracking
This n8n Automation workflow tracks and queries your expenses effortlessly through Telegram using voice or text messages. This AI-powered workflow transcribes voice input via AssemblyAI, processes transactions with a GPT-4.1 mini agent, stores data in Google Sheets with comprehensive timestamp metadata, and responds with both voice and text confirmations.
Key Features:
- Multi-modal input: Send expenses via voice messages or text
- Intelligent processing: AI agent automatically categorizes transactions, calculates running balance, and handles multiple expenses in a single message
- Conversational queries: Ask questions like "What did I spend on food last week?"
- Voice responses: Get spoken confirmations using OpenAI TTS
- Smart alerts: Automatic Gmail notifications for low balance thresholds
- Cost tracking: Monitors and logs all API usage costs (LLM + TTS) in USD and INR
馃幆 Use Cases
路聽聽聽Personal Finance Management :Track daily expenses, manage budgets,understand spending patterns with minimal effort.
路聽聽Business Expense Tracking :Log business expenses on-the-go with automatic categorization and detailed audit trails.
路聽聽Shared Household Budgets :Multiple family members can contribute expenses through a shared Telegram bot.
路聽聽Freelancer Income & Expense Tracking :Track both credits (client payments) and debits (business expenses) in one place.
路聽聽API Cost Monitoring :Perfect for developers and businesses monitoring AI API usage and costs.
Each transaction includes detailed metadata (timestamps, categories, run IDs, source text) enabling powerful time-based analytics and queries.
馃攧 Workflow Architecture
Entry & Routing (Telegram)
- Telegram trigger receives message
- Router determines if voice or text
- Processing notification sent to user
Voice Processing Path (AssemblyAI)
- Download voice file from Telegram
- Upload audio to AssemblyAI
- Start transcription job
- Poll until transcription completes
- Extract transcript text
Text Processing Path
- Direct text extraction from message
- Pass to core processing
Core Processing (AI Agent)
- Read transaction history from Google Sheets
- Calculate starting balance and generate Run ID
- AI Agent (GPT-4.1 mini) processes request:
- Parse transaction details
- Determine type (credit/debit)
- Categorize expense
- Calculate new balance
- Generate all timestamp metadata
- Execute tool calls:
- Append Transaction: Write to sheet with full metadata
- Read Sheet: Query existing transactions
- Send Email Alert: Trigger on low balance
- Track token usage and API costs
Post-Processing
- Generate voice response (OpenAI TTS)
- Send voice confirmation to Telegram
- Send text confirmation to Telegram
- Log API costs (LLM + TTS) to sheet
Track & query expenses via Telegram (voice,text) to Google Sheets using AI Track your expenses effortlessly using voice or text messages through Telegram. Powered by AI for intelligent categorization, automatic balance calculation, and comprehensive cost analytics.