Complete n8n Agent- Tracking Daily Expenses by Telegram in 25 Minutes (Step-by-Step Bangla Tutorial)
Table of Contents
Introduction
In this tutorial, you will learn how to create a fully automated expense tracker using n8n and Telegram. This step-by-step guide will help you set up a system that allows you to log daily expenses through Telegram, automatically organize them in Google Sheets, and get monthly summaries—all without writing any code. This is perfect for anyone looking to track their expenses easily.
Step 1: Set Up Your Telegram Bot
-
Create a Bot on Telegram:
- Open Telegram and search for the BotFather.
- Start a chat and send the command
/newbot. - Follow the prompts to name your bot and get your unique API token.
-
Get Your Bot ID:
- Use the following URL to retrieve updates and get your bot ID:
https://api.telegram.org/bot(Your_Access_Token)/getUpdates
- Use the following URL to retrieve updates and get your bot ID:
Step 2: Install n8n
-
Choose Your Hosting Option:
- You can host n8n locally or use a cloud service. If using Ngrok, download and install it to expose your local server.
-
Set Up n8n Environment:
- Follow the installation instructions on the n8n documentation.
Step 3: Create a Google Sheets Integration
-
Set Up Google Sheets:
- Create a new Google Sheet where you will log your expenses.
- Ensure you have the necessary permissions set for n8n to access this sheet.
-
Connect Google Sheets with n8n:
- In n8n, add a Google Sheets node and authenticate it with your Google account.
- Select the correct sheet and configure the fields (date, category, amount, quantity).
Step 4: Configure n8n Workflow
-
Add a Webhook Node:
- Create a Webhook node to receive messages from your Telegram bot.
- Configure the webhook URL to point to your Telegram bot.
-
Use IF Logic to Parse Messages:
- Add an IF node to check the incoming messages for specific commands (e.g., "add expense").
- Use variables to extract the necessary data from the messages, such as amount and category.
-
Log Expenses:
- Link the IF node to the Google Sheets node to log the extracted expense data.
Step 5: Automate Monthly Summaries
-
Use n8n to Schedule Monthly Reminders:
- Add a Cron node to your workflow to trigger monthly summaries.
- Configure it to send a summary message of expenses via Telegram.
-
Categorize Expenses:
- In the Google Sheets node, use formulas to categorize and summarize expenses by month.
Conclusion
You have successfully set up an automated expense tracker using n8n and Telegram. This system will allow you to log expenses effortlessly and manage your personal finances efficiently. To enhance your setup, consider exploring additional n8n features or integrating more services for your financial tracking needs. Happy tracking!