Skip to main content

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

Workflow preview

Workflow preview
100%
Auto expense tracker from LINE messages with GPT-4 and Google Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Overview Do you often forget to record expenses? 你是不是會常常忘記紀錄花費? Let Spending Tracker Bot help you! 讓 Spending Tracker Bot 來幫你! This AI image/text Spending T...

Best for

  • Personal Productivity automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.googlesheets, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.outputparserstructured

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Catalina Kuo.

Original n8n.io source

1.1 Workflow description

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

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 就會幫你整理好自動計入雲端帳本


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


Node Configurations

Webhook

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

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

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

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

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. ⚠️ 此筆資料已記錄過,不會重複記帳

Step by step teaching notes

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

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

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 2 - message

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - image

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 5 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 6 - reply_to_line

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - Get row(s) in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 8 - Merge_all

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 9 - reply_to_line_duplicated

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - reply_to_line_no_spending

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 11 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 12 - append_to_sheet1

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 13 - Aggregate

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 14 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - deduplication

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 17 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - for_deduplications

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 20 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Switch based on Expense Type

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Showing the first 24 of 25 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Auto expense tracker from LINE messages with GPT-4 and Google Sheets
Complexity advanced
Nodes 25
Categories Personal Productivity, AI Summarization
Author Catalina Kuo
Published 22 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6264/6264.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Auto expense tracker from LINE messages with GPT-4 and Google Sheets do?

Overview Do you often forget to record expenses? 你是不是會常常忘記紀錄花費? Let Spending Tracker Bot help you! 讓 Spending Tracker Bot 來幫你! This AI image/text Spending T...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity, AI Summarization use case.