Voice-Controlled AI Assistant for Expense Tracking via Google Sheets - n8n Workflow

Instantly log and query your finances using voice commands, Siri, and Google Sheets. This powerful n8n workflow uses an AI Agent to interpret natural language inputs.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Users seeking hands-free, voice-activated expense tracking (e.g., via Siri or iOS Shortcuts).

  • Developers looking for advanced n8n templates combining AI agents and external services.

  • Finance enthusiasts who need a seamless way to log transactions without opening apps.

  • Anyone utilizing n8n to connect conversational AI with Google Sheets operations.

Overview

Manual entry often leads to inaccuracies and procrastination in personal finance tracking. This advanced n8n workflow solves this by creating an intelligent, voice-first expense logging system. By leveraging a Webhook n8n trigger linked to a voice assistant (like Siri), the user’s natural language input is immediately sent to an AI Agent. This specialized n8n node, powered by models like Gemini (via OpenRouter), is trained to distinguish between two key actions: recording a new transaction or reading/summarizing past expenses. It determines the necessary fields (Date, Amount, Category) and executes the correct Google Sheets n8n node (Append or Read). This comprehensive n8n template ensures rapid, accurate, and context-aware financial management, making it easier than ever to maintain detailed records.

How it Works

The n8n workflow operates in a rapid sequence designed for real-time voice response:


  1. Trigger: The process starts with the Recieve n8n trigger, configured as a Webhook (POST method). This endpoint is called by the voice assistant (e.g., a Siri Shortcut) carrying the user's voice input in the body.

  2. Input Formatting: The subsequent FormatInput code n8n node extracts the raw input text and formats the current timestamp, preparing variables for the AI Agent.

  3. AI Orchestration: The AI Agent n8n node takes the lead. It utilizes the OpenRouter Chat Model (running Gemini) and Simple Memory to maintain conversational context. Crucially, its system prompt dictates that it must act as a personal finance assistant, deciding whether to use the Append tool (to record data) or the Read tool (to query data), often inferring missing details (like date or category).

  4. Tool Execution: Depending on the AI's decision, it calls the appropriate Google Sheets n8n node. If appending, the AI provides a structured JSON payload which is mapped directly to the columns of the overall Google Sheet.

  5. Output Generation: The AI Agent’s response (which summarizes the action in Hong Kong Chinese, as per instructions) is passed to the FormatOutput code n8n node, which cleans the text by removing newlines.

  6. Response: Finally, the Respond n8n node uses the clean text to deliver an immediate, conversational reply back to the originating Webhook call, completing the voice interaction loop.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import the n8n Workflow: Import the provided JSON data into your n8n instance.

  2. Set up Credentials:

Google Sheets: Set up your Google Sheets OAuth2 API credentials. Ensure the credentials have access to the specified 'aipersonalexpense' spreadsheet and the 'overall' sheet used for logging.
OpenRouter: Configure your OpenRouter API credentials for the OpenRouter Chat Model n8n node. Alternatively, you can swap this for an OpenAI or local AI n8n node, provided you update the AI Agent configuration accordingly.

  1. Configure the n8n Trigger: Activate the Recieve Webhook n8n trigger. Copy the unique URL generated by the active webhook.

  2. Google Sheet Setup: Ensure your Google Sheet template includes the expected column headers (Date, Type, Name, Amount, expenses/incomes, created time) for the Append n8n node to function correctly.

  3. Voice Assistant Setup (Siri/iOS Shortcut): Configure your voice assistant shortcut (e.g., Siri Shortcut as detailed in the Sticky Note) to POST the voice input as JSON to the Webhook URL obtained in step 3. The input JSON structure expected by the FormatInput n8n node is {"input": "[user voice text]"}.

Node Details

Recieve (Webhook): The starting n8n trigger for the workflow. It receives POST requests, typically from a mobile shortcut, initiating the voice process. It is configured to wait for and return a response via the Respond n8n node.
FormatInput (Code): This preparatory n8n node extracts the user's voice message (body.input) into the rawinput variable and calculates current date/time variables, providing context for the subsequent AI step.
AI Agent (Langchain Agent): The intelligence core n8n node. It determines intent based on the user's rawinput. Key configuration includes a detailed system message that guides the AI to utilize specific tools (Append and Read) and requires the output to be localized (Hong Kong Chinese).
OpenRouter Chat Model (Langchain): The Language Model n8n node used by the Agent. This is configured to use a cost-effective and fast model (Gemini-2.0-flash-lite) for rapid response times essential for a voice assistant.
Simple Memory (Langchain): A memory buffer n8n node connected to the AI Agent to maintain short conversational context across follow-up queries.
Append (Google Sheets Tool): An action n8n node. It is called by the AI Agent to write new transaction data. Configuration uses $fromAI() expressions to dynamically map structured data extracted by the AI (Date, Name, Amount, etc.) into the specified Google Sheet.
Read (Google Sheets Tool): An action n8n node. It is called by the AI Agent when the user requests a summary or history query, fetching data for the AI to analyze and summarize.
FormatOutput (Code): Cleans the final text output generated by the AI Agent, specifically removing newline characters to ensure smooth delivery back to the voice assistant interface.


  • Respond (Respond to Webhook): The final n8n node, responsible for sending the clean, conversational reply back to the calling webhook client (Siri/Shortcut).

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Ai Lin ⌘
Ai Lin ⌘

Featured*