Automated Financial Tracker: Telegram Invoices to Notion with AI Summaries & Reports
Tired of manually logging every expense? Streamline your financial tracking with this powerful n8n workflow!
Snap a photo of your invoice in Telegram, and let AI (powered by Google Gemini) automatically extract the details, record them in your Notion database, and even send you a quick summary. Plus, get scheduled weekly reports with charts to visualize your spending. Automate your finances, save time, and gain better insights with this easy-to-use template!
Transform your expense tracking from a chore into an automated breeze. Try it out!
This workflow revolutionizes how you track your finances by automating the entire process from invoice capture to reporting. Simply send a photo of an invoice or receipt to a designated Telegram chat, and this workflow will:
This workflow is perfect for individuals, freelancers, or small teams looking to effortlessly manage their expenses without manual data entry.
The workflow is divided into two main parts:
Part 1: Real-time Invoice Processing & Logging (## Auto Notes Transaction with Telegram and Notion database
)
Telegram Trigger | When recive photo
): Activates when a new photo is sent to the configured Telegram chat.Get Info Photo from telegram chat
): Retrieves the details of the received photo.Get Image Info
): Prepares the image data.Google Gemini Chat Model
& Basic LLM Chain
):
Parse To your object | Table
): Structures the AI's JSON output for easier handling.Split Out | data transaction
): If an invoice contains multiple items, this node splits them into individual records.Record To Notion Database
): Each transaction item is added as a new page/entry in your specified Notion database, mapping fields like Name, Quantity, Price, Total, Category, Date, and Tax.Sendback to chat and give summarize text
): The summary message generated by the AI is sent back to the original Telegram chat.Part 2: Scheduled Financial Reporting (## Schedule report to send on chanel or private message
)
Schedule Trigger | for send chart report
): Runs at a predefined interval (e.g., every week) to generate reports.Get Recent Data from Notions
): Fetches transaction data from the Notion database for a specific period (e.g., the past week).Summarize Transaction Data
): Aggregates the data, for example, by summing up the 'total' amount for each 'category'.Convert Data to JSON chart payload
): Transforms the summarized data into a JSON format suitable for generating a chart (e.g., labels for categories, data for spending amounts).Generate Chart
): Uses the QuickChart node to create a visual chart (e.g., a bar chart) from the prepared data.Send Chart Image to Group or Private Chat
): Sends the generated chart image to a specified Telegram chat ID or group.Name
(Title), Quantity
(Number), Price
(Number), Total
(Number), Category
(Select), Date
(Text or Date), Tax
(Number)). Share this database with your Notion integration./start
to your bot in the chat you want to use for sending invoices. n8n will then capture the Chat ID.Google Gemini Chat Model
):
Basic LLM Chain
node and adjust if necessary (e.g., date format, categories).Record To Notion Database
:
={{ $json.name }}
) to your Notion database columns.Get Recent Data from Notions
:
Send Chart Image to Group or Private Chat
):
Chat ID
for the group or private chat where you want to receive the reports.Schedule Trigger | for send chart report
):
(These are suggestions. You would place these directly into the sticky notes within your n8n workflow editor.)
Existing High-Level Sticky Notes:
## Auto Notes Transaction with Telegram and Notion database
## Schedule report to send on chanel or private message
Specific Sticky Notes to Add:
Telegram Trigger | When recive photo
:📸 INVOICE INPUT 📸
Bot listens here for photos of your receipts/invoices.
Ensure your Telegram Bot API token is set in credentials.
Google Gemini Chat Model
& Basic LLM Chain
:🤖 AI MAGIC HAPPENS HERE 🧠
- Image is sent to Google Gemini for data extraction.
- Check 'Basic LLM Chain' to customize the AI prompt (e.g., categories, output format).
- Requires Google Gemini API credentials.
Parse To your object | Table
:✨ STRUCTURING AI DATA ✨
Converts the AI's text output into a usable JSON object.
Check the schema if you modify the AI prompt significantly.
Record To Notion Database
:📝 SAVING TO NOTION 📝
- Extracted transaction data is saved here.
- Configure with your Notion API key & Database ID.
- Map fields correctly to your database columns!
Sendback to chat and give summarize text
:💬 TRANSACTION SUMMARY 💬
Sends a confirmation message back to the user in Telegram
with a summary of the recorded expense.
Schedule Trigger | for send chart report
:🗓️ REPORTING SCHEDULE 🗓️
Set how often you want to receive your spending report (e.g., weekly, monthly).
Get Recent Data from Notions
:📊 FETCHING DATA FOR REPORT 📊
- Retrieves transactions from Notion for the report period.
- Default: "Past Week". Adjust filter as needed.
- Requires Notion API credentials & Database ID.
Summarize Transaction Data
:➕ SUMMARIZING SPENDING ➕
Aggregates your expenses, usually by category,
to prepare for the chart.
Convert Data to JSON chart payload
(Code Node):🎨 PREPARING CHART DATA 🎨
This Code node formats the summarized data
into the JSON structure needed by QuickChart.
Generate Chart
(QuickChart Node):📈 GENERATING VISUAL REPORT 📈
Creates the actual chart image based on your spending data.
You can customize chart type (bar, pie, etc.) here.
Send Chart Image to Group or Private Chat
:📤 SENDING REPORT TO TELEGRAM 📤
- Delivers the generated chart to your chosen Telegram chat/group.
- Set the correct Chat ID and Bot API token.
🔑 CREDENTIALS NEEDED 🔑
Remember to set up API keys/tokens for:
- Telegram
- Google Gemini
- Notion
💡 CUSTOMIZE ME! 💡
- Adjust AI prompts for better accuracy.
- Change Notion database structure.
- Modify report frequency and content.