Automate an Expense Tracker with Voice Commands Using n8n, Telegram, AI Agent, and Google Sheets (No Code!)

Automate your expense tracking with voice commands using n8n, Telegram, AI, and Google Sheets — no coding needed! Follow this step-by-step guide to simplify personal finance management and log expenses effortlessly.
Build an AI-Powered Expense Tracker with n8n, Telegram, and Google Sheets
AI automation and no-code tools are a game-changer for busy individuals and teams. Instead of manual data entry, you can leverage an AI workflow to turn simple chat messages into structured expense records. Platforms like n8n combine a visual, drag‑and‑drop editor with powerful AI integrations, letting you build custom automations without writing code (github.com) (n8n.io). In this guide, we’ll show step-by-step how to use n8n to create a Telegram bot that accepts both text and voice expense entries, sends them to an AI agent for interpretation, and logs the results into Google Sheets – all with no programming required.
(n8n.io)With n8n’s flexible workflow automation, you gain the speed of no-code with the option to add custom logic or code if needed (github.com) (n8n.io). It has hundreds of integrations (including Telegram and Google Sheets), so you save yourself the headache of writing custom connectors (n8n.io) (github.com). The result is an AI-powered workflow that turns casual chat or voice notes into organized expense entries automatically. Let’s dive into the setup.
Why Use n8n for AI Automation?
- No-Code Flexibility: n8n combines “the flexibility of code with the speed of no-code” (github.com). You can build complex automations visually, or drop in custom scripts only where you need them. This means even beginners can start automating tasks like expense tracking quickly.
- Built-In AI Capabilities: n8n is an AI-native platform. You can plug in AI agents (using OpenAI, Google Gemini, etc.) as part of your flow (n8n.io). For example, you can use a ChatGPT or DeepSeek node to interpret natural-language expense descriptions.
- Rich Integrations: With over 400+ integrations available, connecting apps is trivial (github.com). In our case, n8n already supports Telegram and Google Sheets, so we don’t need any custom code to link them. As the n8n docs note, it “saves you the work of writing custom integrations” between these services (n8n.io).
- Self-Hosted & Secure: n8n can run in the cloud or on-premises, giving you control over data. This is great for sensitive info like finances. Plus, the active community and template library help you get started faster.
In short, n8n empowers you to build an AI workflow for expenses in minutes, by dragging nodes together instead of coding an entire app.
Creating a Telegram Bot
- Set up the Telegram bot. In the Telegram app, chat with t.me. Use the
/newbot
command to create a new bot, give it a name and username, and copy the API token BotFather provides (n8n.io). - Add the bot to n8n. In n8n, add a Telegram Trigger node at the start of your workflow. Paste in the bot token from BotFather and authorize the connection. This node will listen for incoming messages (text or voice) to your bot. You might want to start the conversation with your bot or add it to a group to begin receiving messages.
- Test the trigger. Once the Telegram node is activated, send a test message (e.g. “test”) to your bot. You should see the node capture the update. Now every time someone sends a message to the bot, n8n will wake up and run the workflow.
By doing this, you’ve connected Telegram to n8n. Any message sent to the bot (text or voice) will flow into your automation.
Setting Up AI Interpretation (OpenAI or DeepSeek)
Next, we need an AI node to interpret expense details from the text (or transcribed voice).
-
Configure AI credentials. In n8n’s credential manager, add your OpenAI API key (or credentials for another AI service). The Meal Nutrition template suggests: “Set up your OpenAI credentials in the n8n credential manager” (n8n.io). Similarly, if you have access to DeepSeek or Google’s AI services, you can configure those here too.
-
Add an AI node. After the Telegram trigger (and after any voice transcription step below), insert an OpenAI (ChatGPT) node (or a generic HTTP Request node if calling a different service). Point it to the API you set up. In the node’s settings, you will craft a prompt that tells the AI what to do with the message text.
-
Create the prompt. The prompt should instruct the AI to parse an expense entry. For example:
Parse the following expense message into JSON with keys "description", "cost", and "date": Message: "Dinner at cafe; 29.99 USD; 2025-05-01"
With this prompt, the AI might return:
{"description":"Dinner at cafe","cost":29.99,"date":"2025-05-01"}
You can customize the wording as needed. As one n8n example notes, the AI will “smartly parse your message to structured JSON” for easy insertion (n8n.io).
-
Map the input. Configure the AI node so that its input is the text from Telegram (for example
{{$json["text"]}}
or the result of transcription). The output fields (e.g.{{ $json["cost"] }}
) will be used to save data next.
Tip: You may want to test and tweak the prompt. The meal logger template suggests customizing the prompt in the “List of Ingredients and Nutrients” node to improve accuracy (n8n.io). Likewise, you can refine your expense prompt so the AI reliably extracts the right fields.
Transcribing Voice Messages
To support voice inputs, add a step before the AI node:
- Detect voice notes. The Telegram Trigger node can capture voice messages. In n8n, you can check if the incoming JSON has a
voice
field. If a voice note is present, add an HTTP Request or Telegram node to download the audio file. - Use AI transcription. Send the audio to an AI transcription service. For example, n8n can send the file to OpenAI’s Whisper model or to Google’s free Gemini model to get text. As the n8n Gemini example explains: “Send an audio file to your Telegram bot and get a full transcription using Gemini’s free model.” (n8n.io). In practice, this means piping the audio file to a transcription node or API call.
- Proceed with text. Take the returned text from the AI transcription and treat it as the message content. The workflow can then pass that text into the same OpenAI parsing node above. If no voice note is present, simply skip transcription and use the raw text message.
In short, n8n can automatically download voice messages and convert them to text using AI (n8n.io) (n8n.io). This lets users speak their expense entries instead of typing. After transcription, the AI interpretation step runs as usual on the resulting text.
Logging Data to Google Sheets
Finally, we save the parsed expense data into a spreadsheet.
- Set up the Google Sheet. Create a new Google Sheet (or copy the [provided template] (n8n.io)). In the n8n instructions, you “Clone this Sheet” link (File → Make a copy) (n8n.io). The sample sheet has columns like date, cost, descr (description) and msg (original message) (docs.google.com). Make sure your sheet has column headers in the first row.
- Store the Sheet ID. Copy the spreadsheet’s ID from its URL. In n8n, you can store this ID in an environment variable or directly in the Google Sheets node settings. (The n8n template advises to “store the sheet ID in the environment” for easy reuse (n8n.io).)
- Add a Google Sheets node. In your workflow, add a Google Sheets node and connect it to the AI node. Authorize it with your Google account. Set it to Append a new row. In the node’s fields, select the spreadsheet (by ID) and worksheet.
- Map the fields. For the row data, map the values from the AI output. For example, map the AI’s “date” field to the sheet’s Date column, “cost” to Cost, and “description” to Descr. You might also include the original message text if desired. Now each new expense will appear as a row. For example, the template shows entries like 2025-01-29 | 22 | car wash with the original “Expense: car wash…” text in the next column (docs.google.com).
That’s it – once this node runs, the parsed expense is logged in Google Sheets. You can then use Sheets’ built-in tools (charts, Pivot Tables, etc.) to analyze your spending.
Expanding the Workflow
Once the basics work, you can customize and expand the automation in many ways. For example:
- Prompt and Fields: You can tweak the AI prompt to handle things like multiple currencies or tax. Add new columns (e.g. Category or Project) to your sheet and adjust the AI parsing so it outputs those too. As n8n suggests, you can “add new fields in the Google Sheet and corresponding logic in the parser” for more detail (n8n.io).
- Error Handling: Use n8n’s Error Workflow or
IF
nodes to catch bad input. For example, check if the AI output is missing a field and skip writing if so. You might send yourself a notification (via Slack or email) when the workflow fails. Building a fallback or re-prompt step can handle unrecognized messages. Robust error handling prevents bad entries from polluting your sheet. - Real-World Use Cases: This setup is extremely versatile. Freelancers can snap a photo or voice-log a receipt and have it saved for client billing. Teams can share a Telegram group where everyone logs team expenses (lunch, supplies, travel) to the same sheet. Even personal budget tracking becomes easier – just text or speak your spending and it’s recorded. As one n8n community example notes, logging expenses “via simple chat message” is “very convenient” (n8n.io) when you’re on the go.
By combining no-code nodes in n8n, you’ve essentially built an AI expense agent without writing a single line of code (github.com) (n8n.io). Feel free to connect more apps – for instance, you could upload receipt images to Google Drive or send summary reports via email – to further automate your financial workflows.
Ready to build? Give it a try: clone the template sheet, paste your tokens and keys into n8n, and hit activate. You’ll soon have a smart, AI-powered expense tracker ready to use. The same principles apply to countless other AI automation ideas – so go ahead and create your own no-code AI workflows!
Sources: Official n8n workflow templates and docs (n8n.io) (n8n.io) (n8n.io) were used as references for setup and capabilities.