Automate expense tracking via Telegram with AI-powered voice transcription, OCR receipt scanning, and intelligent expense categorization using GPT-4o.
This agent works seamlessly with these platforms to deliver powerful automation.
Leverage OpenAI's powerful language models to generate text, answer questions, a...
Connect your Telegram bot to send messages, photos, documents and receive update...
This intelligent Telegram bot transforms how you track expenses by accepting text, voice messages, photos, and documents—then automatically processing them into structured expense data. When you send a message to your bot, it intelligently routes different input types through specialized processing: voice messages get transcribed, images get analyzed with OCR, and text gets processed directly. All inputs then flow to an AI-powered expense manager that extracts relevant information, categorizes expenses, and responds with confirmation.
Key benefits include:
This workflow is perfect for tracking business expenses, managing personal budgets, processing receipts in real-time, and maintaining expense records without switching between multiple apps.
This automation is ideal for:
Whether you're tech-savvy or just getting started with automation, this workflow provides enterprise-level expense management through the familiar Telegram interface.
Telegram powers the user interface for this workflow, receiving messages and sending responses back to users. This integration enables your bot to accept text, voice, photos, and documents while providing real-time feedback.
Setup steps:
/newbot and follow the prompts to create your bot123456789:ABCdefGHIjklMNOpqrsTUVwxyz)Important: Keep your bot token secure—anyone with this token can control your bot.
OpenAI provides the AI capabilities for transcribing voice messages, extracting text from images via OCR, and powering the intelligent expense manager that categorizes and processes your expense data.
Setup steps:
Cost considerations: This workflow uses GPT-4o, which costs approximately $0.005 per expense processed (varies based on message length and image complexity).
This node listens for incoming messages to your bot. No configuration is needed beyond connecting your Telegram integration—it automatically captures all message types (text, voice, photo, document).
What it captures: Message content, sender information, chat ID, and media file IDs.
This intelligent router directs messages to the appropriate processing path based on content type.
Configure three cases:
{{message.text}} exists{{message.voice}} exists{{message.photo}} OR {{message.document}} existsFor the /start command, configure this node to send:
Chat ID: {{trigger.message.chat.id}}
Message: Welcome! Send me your expenses as text, voice, photos, or documents. I'll help you track them automatically!
Check for Voice (If Condition): Set condition to {{trigger.message.voice}} !== undefined
Get Voice File: Configure with:
{{trigger.message.voice.file_id}}
Transcribe Voice (OpenAI):
whisper-1
{{previous.file_path}}
en (or leave blank for auto-detection)Prepare Voice Input:
processed_text with value: {{transcription.text}}
Check for Photo/Document: Condition: {{trigger.message.photo}} !== undefined OR {{trigger.message.document}} !== undefined
Get Photo File ID (Function Node):
// Photos come as array, get highest resolution
if (input.message.photo) {
return input.message.photo[input.message.photo.length - 1].file_id;
}
return input.message.document.file_id;
Get Media File: File ID: {{previous.file_id}}
OCR with Vision (OpenAI Completion):
gpt-4o
1000
Prepare Media Input:
processed_text with value: {{completion.choices[0].message.content}}
Prepare Text Input:
processed_text with value: {{trigger.message.text}}
Merge Inputs: This node automatically combines outputs from all three processing paths (text, voice, media).
Expense Manager AI Agent:
gpt-4o
0.3 (for consistent categorization)You are an expense tracking assistant. Extract and structure expense information from user input.
Always respond with:
- Amount (with currency)
- Category (food, transport, entertainment, business, utilities, other)
- Date (default to today if not specified)
- Description
- Merchant/vendor (if mentioned)
Format as a clear confirmation message.
{{merged.processed_text}}
Send AI Response:
{{trigger.message.chat.id}}
{{ai_agent.response}}
Markdown (for formatted responses)/start and verify you receive the welcome messageTest voice messages:
Test photo processing:
Test document processing:
✅ All message types receive responses within 5-10 seconds
✅ Voice transcription accuracy exceeds 95%
✅ OCR correctly extracts amounts and merchant names
✅ AI categorizes expenses consistently
✅ Responses include all required fields (amount, category, date, description)
Cause: Webhook not properly registered or workflow not activated
Solution:
Cause: OpenAI integration issue or unsupported audio format
Solution:
whisper-1) is specified correctlyCause: File size too large or GPT-4o vision not properly configured
Solution:
gpt-4o (not gpt-4 or gpt-3.5-turbo)Cause: Temperature setting too high or prompt needs refinement
Solution:
0.2-0.3 for more consistent categorizationCause: Multiple paths executing simultaneously or data structure mismatch
Solution:
processed_text fieldAfter successful setup, customize the AI prompt to match your specific expense categories and business rules. Add your preferred currency, tax handling requirements, or project codes.
Set up expense storage by adding a Google Sheets or Airtable node after the AI Agent to automatically log all processed expenses for later analysis and reporting.
Create expense reports by adding a scheduled workflow that queries your stored expenses and sends weekly or monthly summaries.
Improve accuracy by training the AI with examples:
Add validation with an additional If Condition node that checks for required fields and asks clarifying questions when information is missing.
Enable multi-user support by storing user preferences (default currency, favorite categories) in a database keyed by Telegram user ID.
Implement approval workflows for business expense tracking by adding a confirmation step with inline keyboard buttons before logging expenses.
Add receipt storage by uploading processed images to cloud storage (Dropbox, Google Drive) with organized folder structures.
Create budget alerts by checking expense totals against predefined limits and sending warnings when approaching budget thresholds.
Generate analytics by connecting to visualization tools that show spending patterns, category breakdowns, and trend analysis.
Support multiple languages by modifying the Whisper transcription to auto-detect language and adjusting the AI prompt to respond in the user's language.
Your expense tracking bot is now ready to save you hours of manual data entry while ensuring no expense goes unrecorded!