What This Workflow Does
Manual expense tracking is a universal pain point for freelancers, small business owners, and teams. This n8n automation solves that by creating a seamless, touchless pipeline from a receipt photo to a structured financial record. You simply take a picture of a receipt and send it to a dedicated Telegram bot. The workflow then uses the free OCR.space API to extract key details like the date, vendor, total amount, and taxes. This data is automatically validated, formatted, and appended to a designated Google Sheet, creating a real-time, searchable expense ledger.
The beauty of this system is its flexibility. It also supports manual text entries for cash transactions or receipts you don't have on hand. You can send a simple command like "expense coffee 5.50 food" directly to the bot, and it will be logged instantly. This dual-input method ensures no expense goes unrecorded, whether you have a physical receipt or not.
Beyond simple logging, this template establishes a foundational system for financial clarity. It eliminates data entry drudgery, reduces human error, and provides immediate visibility into spending patterns. By centralizing expenses in Google Sheets, you create a single source of truth that's ready for analysis, tax preparation, or integration with other business tools.
How It Works
The workflow is an elegant sequence of automated steps that transforms a messy receipt into clean, actionable data.
Step 1: Trigger via Telegram
The automation is initiated when you send a photo or a text command to your private Telegram bot. The Telegram Trigger node listens for new messages. If a photo is detected, it downloads the image file and prepares it for processing. If a text command is received (e.g., "income 1000 consulting"), it parses the message for amount, description, and category.
Step 2: Optical Character Recognition (OCR)
For photos, the image file is sent to the OCR.space API via an HTTP Request node. This free service analyzes the image, detects text regions, and converts the visual text into machine-readable data. It returns a JSON object containing all the text found on the receipt, often with coordinates and confidence scores for each detected word.
Step 3: Data Parsing & Cleaning
This is where the magic happens. A Function node takes the raw OCR text and applies logic to identify and extract the relevant information: the total amount, date, merchant name, and tax. This involves searching for patterns like currency symbols ($, €, £), date formats, and common retailer names. The code cleans the data, ensuring amounts are numeric and dates are standardized.
Step 4: Writing to Google Sheets
The cleaned and structured data—whether from OCR or a manual text command—is then sent to Google Sheets. The Google Sheets node appends a new row to your predefined spreadsheet. The row typically includes columns for Date, Description, Amount, Category, Type (Income/Expense), and Source (e.g., "Telegram OCR"). This creates a live, updating financial log.
Step 5: Confirmation & Logging
Finally, the workflow sends a confirmation message back to you on Telegram, confirming the entry was successfully recorded. It also includes a summary of what was logged. All actions are logged within n8n for debugging and audit purposes, giving you full visibility into the automation's operation.
Who This Is For
This template is a game-changer for individuals and businesses drowning in paper receipts and manual data entry.
Freelancers & Solopreneurs: Perfect for independent contractors, consultants, and digital nomads who need to track business expenses for tax deductions without administrative overhead. Snap a photo after a client lunch or a co-working space purchase, and it's logged.
Small Business Owners: Owners can use this to capture all business-related receipts, creating an organized digital paper trail for accounting, VAT returns, and profit/loss analysis. It's far more efficient than a shoebox full of receipts.
Remote Teams & Startups: Teams can use a shared Telegram group or bot to submit expenses. The automation can be extended to include basic approval flows or notifications to a manager, streamlining the reimbursement process.
Finance-conscious Individuals: Anyone wanting to get a better handle on personal spending can use this to automatically build a budget tracker from their daily purchases.
Pro tip: Use a dedicated Telegram channel for your business expenses. This keeps all receipt submissions in one searchable thread, providing a secondary visual audit trail alongside the structured data in Sheets.
What You'll Need
- An n8n Instance: A self-hosted n8n setup or a n8n.cloud account.
- A Telegram Bot: Created via BotFather on Telegram. You'll need the Bot Token for authentication.
- OCR.space API Key: A free API key from ocr.space/OCRAPI.
- A Google Account & Google Sheet: Create a new Google Sheet with two tabs named "Income" and "Expenses". Set up columns like:
Date,Description,Amount,Category,Type,Source. You'll need to share this sheet with a service account or enable the Google Sheets API. - Basic n8n Credentials Setup: Ability to set up credentials in n8n for Telegram Bot, Google Sheets, and HTTP Request (for OCR.space).
Quick Setup Guide
Get this automation running in your environment in under 15 minutes.
- Import the Template: Download the JSON file using the button above. In your n8n instance, go to Workflows > Import from File and select the downloaded JSON.
- Configure Credentials: Set up three sets of credentials in n8n:
- Telegram Bot API: Use the token from BotFather.
- Google Sheets: Use OAuth2 or a service account key to connect to your spreadsheet.
- OCR.space API: Add an HTTP Request credential with your free API key as a query parameter.
- Update Resource IDs: In the Google Sheets node, paste the ID of your spreadsheet (from the URL) and specify the sheet names ("Income" and "Expenses").
- Test the Trigger: Activate the workflow. Send a photo of a receipt to your Telegram bot. You should see the n8n execution trigger and, within seconds, a new row appear in your Google Sheet.
- Customize Parsing Logic (Optional): Review the Function node code. You may want to adjust the regex patterns to better match your local currency format or common merchant names on your receipts.
Key Benefits
Eliminate Manual Data Entry: Save 2-5 hours per month typically spent typing receipt details into spreadsheets. The OCR extraction is instantaneous and works 24/7.
Improve Accuracy & Compliance: Reduce human typos and misplaced decimal points. Automated logging ensures every expense is captured with a timestamp and source, creating a reliable audit trail for tax or business purposes.
Gain Real-Time Financial Visibility: Your Google Sheet becomes a live dashboard of spending. You can immediately see where money is going, categorize expenses, and make informed budgeting decisions without waiting for month-end reconciliation.
Leverage Free Tools: This workflow uses Telegram (free), OCR.space's generous free tier, and Google Sheets (free), making it a zero-cost operational solution. It demonstrates how powerful automation can be built without expensive software subscriptions.
Foundation for Advanced Automation: This template is a starting point. Once data is in Google Sheets, you can easily build additional automations: monthly expense reports, alerts for overspending, integration with accounting software like QuickBooks, or automated reconciliation with bank statements.