Back to Catalog

Auto expense tracker from LINE messages with GPT-4 and Google Sheets

Catalina KuoCatalina Kuo
575 views
2/3/2026
Official Page

截圖 20250723 14.35.00.png

Overview

Do you often forget to record expenses?

你是不是會常常忘記紀錄花費?

Let Spending Tracker Bot help you!

讓 Spending Tracker Bot 來幫你!

This AI image/text Spending Tracker LINE Bot Workflow allows you to quickly create a customized spending tracker robot without writing a line of code. At any time, you can speak or send a photo, and the AI will parse it and automatically log the expense to your cloud ledger.

這套 AI 圖片文字記帳 LINE Bot Workflow ,讓你不用寫一行程式碼,就能快速打造一個量身訂製的記帳機器人。無論何時,只需要口述或發送一張照片,AI 就會幫你整理好自動計入雲端帳本

<br />

Preparation

① Enable the Google Sheets API in GCP and complete the OAuth setup ② Create the Google Sheet and populate the field names (Feel free to modify based on your own needs) ③ Configure the Webhook URL in the LINE Developers Console ④ OpenAI API Key

① 在 GCP 啟用 Google Sheets API,並完成 OAuth ② 建立並填好 Google Sheet 欄名 (按照自己的需求做更動) ③ 於 LINE Developers 控制台設定 Webhook URL ④ OpenAI API Key

<br />

Node Configurations

Webhook

1753178215306.jpg 1753178274098.jpg Purpose: The URL is used to receive incoming requests from LINE. Configuration: Paste this URL into the Webhook URL field in your LINE Developers Console.

用途: 要接收 Line 的 URL 設定: 將 URL 放到 Line Webhook URL

Switch based on Expense Type & Set/Https

截圖 20250723 14.35.05.png Purpose: To distinguish whether the incoming message is text or an image. Configuration: Use a Switch node to route the flow accordingly.

用途: 區分 text 或 image 設定: switch 分流

AI Agent

截圖 20250722 17.55.27.png Purpose: To extract and organize the required fields. Configuration: Chat Model & Structured Output Parser.

用途: 整理出需要的欄位 設定: Chat Model & Structured Output Parser

Create a deduplication field

Purpose: To prevent duplicate entries by creating a unique "for_deduplication" field. Configuration: Join multiple field names using hyphens (-) as separators.

用途: 確保不會重複寫入,先創建一個"去重使用"欄位 設定: 用 - 連接多個欄位

Aggregrate & Merge_all

截圖 20250722 17.53.55.png Purpose: To prevent duplicate entries in the data table. Configuration: Read the Google sheet, extract the existing "for_deduplication" column into a dedupeList, and compare it against the newly generated "for_deduplication" value from the previous step.

用途: 防止重複寫入資料表 設定:讀取雲端表,將原本的"去重使用欄位"整理成dedupeList,與前一步整理好的"去重使用"欄位做比對

Response Switch

截圖 20250723 14.33.55.png Purpose: To route data and send appropriate replies based on the content. Configuration: Use the replyToken to respond after branching logic. Depending on the result, either write to the data table or return a message:

  1. ✅ Expense recorded successfully: <for_deduplication>
  2. Irrelevant details or images will not be logged.
  3. ⚠️ This entry has already been logged and will not be duplicated.

用途: 資料分流,回應訊息 設定:使用 replyToken ,資料分流後,寫入資料表或回應訊息

  1. ✅ 記帳成功 : <去重使用欄位>
  2. 不相關明細或圖片,不會計入
  3. ⚠️ 此筆資料已記錄過,不會重複記帳 截圖 20250723 14.29.32.png 截圖 20250723 14.29.41.png 截圖 20250723 14.29.08.png
<br />

Step by step teaching notes

【Auto Expense Tracker from LINE Messages with GPT-4 and Google Sheets】

【AI 圖片文字記帳 Line Bot,自動記帳寫入 Google Sheet】

n8n Auto Expense Tracker from LINE Messages with GPT-4 and Google Sheets

This n8n workflow automates the process of extracting expense details from LINE messages using GPT-4 and recording them into a Google Sheet. It's designed to streamline personal or business expense tracking by intelligently parsing natural language messages.

What it does

This workflow performs the following key steps:

  1. Listens for LINE Messages: It acts as a webhook listener, waiting for incoming messages from LINE.
  2. Extracts Expense Data with AI: It uses an OpenAI Chat Model (GPT-4) in conjunction with a Structured Output Parser to extract specific expense details (e.g., item, amount, category) from the received LINE message text.
  3. Formats Data: It prepares the extracted data into a structured format suitable for Google Sheets.
  4. Records to Google Sheets: It appends the parsed expense information as a new row in a designated Google Sheet.
  5. Handles Errors/Responses: It can be extended to provide feedback or handle cases where expense data cannot be extracted.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running n8n instance.
  • LINE Account: A LINE Developers account with a Messaging API channel configured to send webhook events to your n8n instance.
  • OpenAI API Key: An API key for OpenAI (specifically for GPT-4 or a compatible chat model).
  • Google Account: A Google account with access to Google Sheets. You'll need to create a new spreadsheet or use an existing one for your expense data.
  • n8n Credentials: Configured credentials in n8n for:
    • LINE (for the Webhook trigger)
    • OpenAI (for the OpenAI Chat Model node)
    • Google Sheets (for the Google Sheets node)

Setup/Usage

  1. Import the Workflow:
    • Download the workflow JSON.
    • In your n8n instance, go to "Workflows" and click "New".
    • Click the "Import from JSON" button and paste the workflow JSON.
  2. Configure Credentials:
    • Locate the "Webhook" node and ensure it's configured to receive messages from your LINE Messaging API channel. You'll need to copy the webhook URL from this node and paste it into your LINE Developers console.
    • Locate the "OpenAI Chat Model" node and configure your OpenAI API key credential.
    • Locate the "Google Sheets" node and configure your Google Sheets credential. Specify the Spreadsheet ID and Sheet Name where you want to record expenses.
  3. Activate the Workflow:
    • Once all credentials and configurations are set, activate the workflow by toggling the "Active" switch in the top right corner of the n8n editor.
  4. Send LINE Messages:
    • Send a message to your LINE bot/channel with your expense details, for example: "I spent $25.50 on groceries today." or "Coffee for $4.20, category food."
    • The workflow will automatically process the message, extract the expense, and add it to your Google Sheet.

This workflow provides a powerful foundation for automated expense tracking directly from your LINE conversations.

Related Templates

Send WooCommerce cross-sell offers to customers via WhatsApp using Rapiwa API

Who Is This For? This n8n workflow enables automated cross-selling by identifying each WooCommerce customer's most frequently purchased product, finding a related product to recommend, and sending a personalized WhatsApp message using the Rapiwa API. It also verifies whether the user's number is WhatsApp-enabled before sending, and logs both successful and unsuccessful attempts to Google Sheets for tracking. What This Workflow Does Retrieves all paying customers from your WooCommerce store Identifies each customer's most purchased product Finds the latest product in the same category as their most purchased item Cleans and verifies customer phone numbers for WhatsApp compatibility Sends personalized WhatsApp messages with product recommendations Logs all activities to Google Sheets for tracking and analysis Handles both verified and unverified numbers appropriately Key Features Customer Segmentation: Automatically identifies paying customers from your WooCommerce store Product Analysis: Determines each customer's most purchased product Smart Recommendations: Finds the latest products in the same category as customer favorites WhatsApp Integration: Uses Rapiwa API for message delivery Phone Number Validation: Verifies WhatsApp numbers before sending messages Dual Logging System: Tracks both successful and failed message attempts in Google Sheets Rate Limiting: Uses batching and wait nodes to prevent API overload Personalized Messaging: Includes customer name and product details in messages Requirements WooCommerce store with API access Rapiwa account with API access for WhatsApp verification and messaging Google account with Sheets access Customer phone numbers in WooCommerce (stored in billing.phone field) How to Use — Step-by-Step Setup Credentials Setup WooCommerce API: Configure WooCommerce API credentials in n8n (e.g., "WooCommerce (get customer)" and "WooCommerce (get customer data)") Rapiwa Bearer Auth: Create an HTTP Bearer credential with your Rapiwa API token Google Sheets OAuth2: Set up OAuth2 credentials for Google Sheets access Configure Google Sheets Ensure your sheet has the required columns as specified in the Google Sheet Column Structure section Verify Code Nodes Code (get paying_customer): Filters customers to include only those who have made purchases Get most buy product id & Clear Number: Identifies the most purchased product and cleans phone numbers Configure HTTP Request Nodes Get customer data: Verify the WooCommerce API endpoint for retrieving customer orders Get specific product data: Verify the WooCommerce API endpoint for product details Get specific product recommend latest product: Verify the WooCommerce API endpoint for finding latest products by category Check valid WhatsApp number Using Rapiwa: Verify the Rapiwa endpoint for WhatsApp number validation Rapiwa Sender: Verify the Rapiwa endpoint for sending messages Google Sheet Required Columns You’ll need two Google Sheets (or two tabs in one spreadsheet): A Google Sheet formatted like this ➤ sample The workflow uses a Google Sheet with the following columns to track coupon distribution: Both must have the following headers (match exactly): | name | number | email | address1 | price | suk | title | product link | validity | staus | | ---------- | ------------- | ----------------------------------------------- | ----------- | ----- | --- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- | -------- | | Abdul Mannan | 8801322827799 | contact@spagreen.net | mirpur dohs | 850 | | Sharp Most Demanding Hoodie x Nike | https://yourshopdomain/p-img-nike | verified | sent | | Abdul Mannan | 8801322827799 | contact@spagreen.net | mirpur dohs | 850 | | Sharp Most Demanding Hoodie x Nike | https://yourshopdomain/p-img-nike | unverified | not sent | | Abdul Mannan | 8801322827799 | contact@spagreen.net | mirpur dohs | 850 | | Sharp Most Demanding Hoodie x Nike | https://yourshopdomain/p-img-nike | verified | sent | Important Notes Phone Number Format: The workflow cleans phone numbers by removing all non-digit characters. Ensure your WooCommerce phone numbers are in a compatible format. API Rate Limits: Rapiwa and WooCommerce APIs have rate limits. Adjust batch sizes and wait times accordingly. Data Privacy: Ensure compliance with data protection regulations when sending marketing messages. Error Handling: The workflow logs unverified numbers but doesn't have extensive error handling. Consider adding error notifications for failed API calls. Product Availability: The workflow recommends the latest product in a category, but doesn't check if it's in stock. Consider adding stock status verification. Testing: Always test with a small batch before running the workflow on your entire customer list. Useful Links Dashboard: https://app.rapiwa.com Official Website: https://rapiwa.com Documentation: https://docs.rapiwa.com Support & Help WhatsApp: Chat on WhatsApp Discord: SpaGreen Community Facebook Group: SpaGreen Support Website: https://spagreen.net Developer Portfolio: Codecanyon SpaGreen

RapiwaBy Rapiwa
183

Track SDK documentation drift with GitHub, Notion, Google Sheets, and Slack

📊 Description Automatically track SDK releases from GitHub, compare documentation freshness in Notion, and send Slack alerts when docs lag behind. This workflow ensures documentation stays in sync with releases, improves visibility, and reduces version drift across teams. 🚀📚💬 What This Template Does Step 1: Listens to GitHub repository events to detect new SDK releases. 🧩 Step 2: Fetches release metadata including version, tag, and publish date. 📦 Step 3: Logs release data into Google Sheets for record-keeping and analysis. 📊 Step 4: Retrieves FAQ or documentation data from Notion. 📚 Step 5: Merges GitHub and Notion data to calculate documentation drift. 🔍 Step 6: Flags SDKs whose documentation is over 30 days out of date. ⚠️ Step 7: Sends detailed Slack alerts to notify responsible teams. 🔔 Key Benefits ✅ Keeps SDK documentation aligned with product releases ✅ Prevents outdated information from reaching users ✅ Provides centralized release tracking in Google Sheets ✅ Sends real-time Slack alerts for overdue updates ✅ Strengthens DevRel and developer experience operations Features GitHub release trigger for real-time monitoring Google Sheets logging for tracking and auditing Notion database integration for documentation comparison Automated drift calculation (days since last update) Slack notifications for overdue documentation Requirements GitHub OAuth2 credentials Notion API credentials Google Sheets OAuth2 credentials Slack Bot token with chat:write permissions Target Audience Developer Relations (DevRel) and SDK engineering teams Product documentation and technical writing teams Project managers tracking SDK and doc release parity Step-by-Step Setup Instructions Connect your GitHub account and select your SDK repository. Replace YOURGOOGLESHEETID and YOURSHEET_GID with your tracking spreadsheet. Add your Notion FAQ database ID. Configure your Slack channel ID for alerts. Run once manually to validate setup, then enable automation.

Rahul JoshiBy Rahul Joshi
31

Automate Gmail responses with GPT and human-in-the-loop verification

Try It Out! This n8n template uses AI to automatically respond to your Gmail inbox by drafting response for your approval via email. How it works Gmail Trigger monitors your inbox for new emails AI Analysis determines if a response is needed based on your criteria Draft Generation creates contextually appropriate replies using your business information Human Approval sends you the draft for review before sending Auto-Send replies automatically once approved Setup Connect your Gmail account to the Gmail Trigger node Update the "Your Information" node with: Entity name and description Approval email address Resource guide (FAQs, policies, key info) Response guidelines (tone, style, formatting preferences) Configure your LLM provider (OpenAI, Claude, Gemini, etc.) with API credentials Test with a sample email Requirements n8n instance (self-hosted or cloud) Gmail account with API access LLM provider API key Need Help? Email Nick @ nick@tropicflare.com

Nick CanfieldBy Nick Canfield
88