Automated Expense Tracking and Querying via Chatbot - n8n Workflow

Use this advanced n8n workflow to track expenses instantly via Telegram (voice or text). It leverages AI agents and Google Sheets for smart financial management and analysis.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Financial professionals needing immediate, hands-free expense logging.
Users looking for easy expense tracking via a mobile app.
Developers building custom conversational bots using the n8n node system.
Anyone interested in complex n8n templates integrating voice transcription, AI agents, and spreadsheets.

Overview

Managing finances requires speed and accuracy. This sophisticated n8n workflow solves the problem of manual expense entry by turning Telegram into a smart financial assistant. Whether you speak your expenses using a voice note or type them, the robust n8n automation handles the rest. It uses AssemblyAI to transcribe voice notes, then passes the context to an advanced AI Agent powered by a large language model. This n8n agent determines if the message is a new transaction to be logged in Google Sheets or a query about past spending. This specific n8n workflow demonstrates powerful conditional logic, external API calls, and the utility of the Langchain Agent n8n node, making it one of the most useful n8n templates for personal finance. The flow even includes mechanisms to track API costs and provide responses back to the user via generated voice or text through the Telegram n8n node.

How it Works


  1. Trigger Event: The process begins with the Telegram Input n8n trigger, listening for new messages.

  2. Message Routing: The n8n workflow uses the Route by Message Type Switch n8n node to separate voice messages from text inputs.

  3. Voice Processing: For voice messages, the Telegram n8n node downloads the file. Multiple HTTP Request n8n nodes handle uploading the audio to AssemblyAI, starting transcription, and polling for results. A Wait n8n node manages the polling time.

  4. Context Retrieval: The flow uses the Read Transaction History Google Sheets n8n node to fetch recent transaction data, which provides essential context to the subsequent AI agent.

  5. AI Orchestration: The core AI Expense Analyzer agent (Langchain Agent n8n node) receives the text input (either direct or transcribed) along with transaction context. This powerful n8n agent utilizes the GPT-4.1 Mini Model and Conversation Memory to understand user intent (logging vs. querying).

  6. Tool Execution: The AI uses specialized tools like the Append Transaction to Sheet n8n node for logging expenses or the Read Sheet for Queries n8n node to answer questions about the ledger.

  7. Response Generation & Logging: After the AI executes its task, the n8n workflow calculates the API consumption (Track API Costs n8n node) and logs the expense data in a separate sheet (Log Cost to Sheet).

  8. User Reply: An HTTP Request n8n node generates a voice response (Text-to-Speech) which is sent back via a Telegram n8n node, offering a seamless conversational experience, or a standard text response. This complex n8n workflow ensures immediate, accurate feedback.

Installation Guide

To successfully deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided n8n workflow JSON code and paste it into your n8n instance using the 'Import Workflow' option.

  2. Telegram Setup: Configure the Telegram Input n8n trigger and the various Telegram output n8n nodes. You will need a Telegram Bot token and must set up the webhook URL pointing to your n8n instance.

  3. Google Sheets Credentials: Provide credentials for all Google Sheets n8n nodes. You will need to specify the Spreadsheet ID and sheet names for both the main expense ledger and the API cost tracking log.

  4. AI Service Credentials:

OpenAI: Set up credentials for the GPT-4.1 Mini Model n8n node (API Key).
AssemblyAI: Configure the HTTP Request n8n nodes used for transcription with your AssemblyAI API key.

  1. External API: If using the Text-to-Speech feature (Generate Voice Response), ensure the associated HTTP Request n8n node is configured with the correct endpoint and authorization.

  2. Activation: Once all credentials and necessary spreadsheet links are configured, activate the n8n trigger to start processing messages.

Node Details

Telegram Input (n8n trigger): The starting point of the n8n workflow, which monitors for incoming messages.
Route by Message Type (Switch n8n node): Determines the next step based on the message type (voice or text).
🎙️ Download Voice File (Telegram n8n node): Downloads the actual audio file from Telegram, preparing it for external API processing.
Upload to AssemblyAI / Start Transcription (HTTP Request n8n node): Handles the API calls necessary to upload and initiate the voice-to-text transcription service.
AI Expense Analyzer (Langchain Agent n8n node): The core intelligence, orchestrating the entire process. This specific n8n node uses the LLM and the defined tools to execute complex financial logic.
GPT-4.1 Mini Model (Langchain ChatOpenAi n8n node): Provides the language understanding and generation capabilities for the AI Agent.
Append Transaction to Sheet (Google Sheets Tool n8n node): A dedicated tool available to the AI agent, allowing it to correctly structure and log new transactions into the Google Sheet.
Read Sheet for Queries (Google Sheets Tool n8n node): Allows the AI agent to access the transaction history to answer user queries about spending patterns or balances.
Generate Voice Response (HTTP Request n8n node): Converts the final text response from the AI into an audio file for a more conversational reply.
Send Text/Voice to Telegram (Telegram n8n node): The final action of the n8n workflow, delivering the AI's answer back to the user.

Related n8n Workflows

Paid

Nodes: 14 Nodes
Updated: December 26 2025
View all
Created by

I help customers experience 10x faster ROI through AI Automation. AI Generalist | Pursuing Generative AI & ML(IIT-G) | Google Certified Prompt Engineer | Ex-VP | Ex-Microsoft | ISB Certified CTO & AI Leader | Azure & AI Strategist | 5X Azure | n8n level2 | Wellness Advocate & Cult Ninja

Featured*