個人支出トラッカー
中級
これはPersonal Productivity分野の自動化ワークフローで、15個のノードを含みます。主にCron, Webhook, Function, GoogleSheets, RespondToWebhookなどのノードを使用。 WebhooksとGoogle Sheets自動化追跡システムで個人支出を管理する
前提条件
- •HTTP Webhookエンドポイント(n8nが自動生成)
- •Google Sheets API認証情報
カテゴリー
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "E1CD2pH99IVoXnwp",
"meta": {
"instanceId": "922f87b0adfedb3ae09541ddf50e19d9af2c8cfac1d8da5d9cd4cdfe64d30bee",
"templateCredsSetupCompleted": true
},
"name": "Personal expense tracker",
"tags": [],
"nodes": [
{
"id": "0dc9105c-6579-4bde-b831-b993ac6e1a54",
"name": "支出入力 Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
240,
100
],
"webhookId": "expense-tracker-api",
"parameters": {
"path": "add-expense",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 1
},
{
"id": "17662aeb-97d6-468e-b1d1-2b82a44dfbb9",
"name": "支出データの検証とフォーマット",
"type": "n8n-nodes-base.function",
"position": [
540,
100
],
"parameters": {
"functionCode": "// Validate and format expense data\nconst body = $input.first().json.body || {};\n\nconst expense = {\n date: body.date || new Date().toISOString().split('T')[0],\n category: body.category || 'Other',\n description: body.description || 'No description',\n amount: parseFloat(body.amount) || 0,\n payment_method: body.payment_method || 'Cash'\n};\n\n// Validate amount\nif (expense.amount <= 0) {\n throw new Error('Amount must be greater than 0');\n}\n\n// Validate category\nconst validCategories = ['Food', 'Transport', 'Shopping', 'Bills', 'Entertainment', 'Health', 'Other'];\nif (!validCategories.includes(expense.category)) {\n expense.category = 'Other';\n}\n\n// Format amount to 2 decimal places\nexpense.amount = Math.round(expense.amount * 100) / 100;\n\nreturn { json: expense };"
},
"typeVersion": 1
},
{
"id": "0a4044a1-f23e-4c5a-9383-425f0fb5cf9e",
"name": "支出を Google Sheetsに保存",
"type": "n8n-nodes-base.googleSheets",
"position": [
840,
100
],
"parameters": {
"options": {
"cellFormat": "USER_ENTERED"
},
"operation": "append",
"sheetName": "Expenses",
"documentId": {
"__rl": true,
"mode": "id",
"value": "REPLACE_WITH_YOUR_SPREADSHEET_ID"
}
},
"typeVersion": 4
},
{
"id": "84af3396-544e-41fe-a8ae-5f27f912bf77",
"name": "月次サマリーの計算",
"type": "n8n-nodes-base.function",
"position": [
1140,
100
],
"parameters": {
"functionCode": "// Calculate summary for current expense\nconst currentExpense = $('Validate and Format Expense Data').first().json;\nconst currentDate = new Date(currentExpense.date);\nconst currentMonth = currentDate.getMonth() + 1;\nconst currentYear = currentDate.getFullYear();\n\n// Create response with expense details and summary\nconst summary = {\n expense_added: currentExpense,\n monthly_summary: {\n month: currentMonth,\n year: currentYear,\n category: currentExpense.category,\n amount_added: currentExpense.amount,\n date_updated: new Date().toISOString()\n },\n success: true,\n message: `Expense of $${currentExpense.amount} for ${currentExpense.category} has been recorded successfully.`\n};\n\nreturn { json: summary };"
},
"typeVersion": 1
},
{
"id": "71a8e380-dc27-4cdb-a4e7-388347a38939",
"name": "成功レスポンスの送信",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1440,
100
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "638d6c11-fcdc-4aa7-a785-6a23dad63e06",
"name": "エラーレスポンスの送信",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
540,
260
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "026567d0-aef6-49a8-9100-22cbac0bccae",
"name": "日次サマリースケジュール",
"type": "n8n-nodes-base.cron",
"position": [
240,
400
],
"parameters": {},
"typeVersion": 1
},
{
"id": "483b47d5-4b82-4e5b-9d79-fb1c2337d90a",
"name": "シートから本日の支出を読み取り",
"type": "n8n-nodes-base.googleSheets",
"position": [
540,
400
],
"parameters": {
"options": {},
"sheetName": "Expenses",
"documentId": {
"__rl": true,
"mode": "id",
"value": "REPLACE_WITH_YOUR_SPREADSHEET_ID"
}
},
"typeVersion": 4
},
{
"id": "f166a60d-06f0-4852-88e2-c4a05fbf39c9",
"name": "日次合計の計算",
"type": "n8n-nodes-base.function",
"position": [
840,
400
],
"parameters": {
"functionCode": "// Filter and calculate today's expenses\nconst today = new Date().toISOString().split('T')[0];\nconst allExpenses = $input.all()[0].json || [];\n\n// Filter expenses for today\nconst todayExpenses = allExpenses.filter(expense => {\n return expense.date === today;\n});\n\n// Calculate total and by category\nconst categoryTotals = {};\nlet totalToday = 0;\n\ntodayExpenses.forEach(expense => {\n const amount = parseFloat(expense.amount || 0);\n totalToday += amount;\n \n if (!categoryTotals[expense.category]) {\n categoryTotals[expense.category] = 0;\n }\n categoryTotals[expense.category] += amount;\n});\n\nreturn {\n json: {\n date: today,\n total_expenses: Math.round(totalToday * 100) / 100,\n expense_count: todayExpenses.length,\n category_breakdown: categoryTotals,\n expenses: todayExpenses\n }\n};"
},
"typeVersion": 1
},
{
"id": "b395295d-2f98-41cf-9ea3-37aa8ba09e83",
"name": "メインワークフローの説明",
"type": "n8n-nodes-base.stickyNote",
"position": [
-320,
-100
],
"parameters": {
"color": 4,
"width": 450,
"height": 1180,
"content": "# 💰 Personal Expense Tracker API\n\n## What This Workflow Does\nProvides a complete expense tracking system with webhook API for adding expenses and automatic Google Sheets storage with daily summaries.\n\n## How It Works\n1. **API Endpoint**: Receives expenses via POST webhook\n2. **Data Validation**: Ensures proper format and categories\n3. **Google Sheets Storage**: Automatically saves to spreadsheet\n4. **Daily Reports**: Sends summary at 8 PM daily\n5. **Real-time Responses**: Returns success/error immediately\n\n## API Usage\nSend POST to: `/webhook/add-expense`\n```json\n{\n \"amount\": 25.50,\n \"category\": \"Food\",\n \"description\": \"Lunch at cafe\",\n \"payment_method\": \"Credit Card\"\n}\n```\n\n## Categories\n• Food • Transport • Shopping • Bills\n• Entertainment • Health • Other\n\n## Setup Required\n1. Create Google Sheets with 'Expenses' sheet\n2. Headers: Date | Category | Description | Amount | Payment Method\n3. Replace SPREADSHEET_ID in nodes\n4. Connect Google Sheets OAuth2\n5. Activate workflow\n\n## Perfect For\n✅ Personal finance tracking\n✅ Mobile app integration\n✅ Family expense sharing\n✅ Small business expense logging\n\n**Includes automatic validation, error handling, and daily summaries.**"
},
"typeVersion": 1
},
{
"id": "49605945-3d4d-497c-83f9-2518ebc4e1e9",
"name": "ステップ1 - API 入力",
"type": "n8n-nodes-base.stickyNote",
"position": [
200,
-220
],
"parameters": {
"color": 7,
"width": 300,
"height": 280,
"content": "## Step 1: API Input\n\n**Webhook** receives expense data via POST request\n\n**Endpoint**: `/webhook/add-expense`\n**Method**: POST\n**Format**: JSON\n\n*Perfect for mobile apps, web forms, or direct API calls*"
},
"typeVersion": 1
},
{
"id": "c02af8e8-6b84-4226-81cb-558bda710a91",
"name": "ステップ2 - データ検証",
"type": "n8n-nodes-base.stickyNote",
"position": [
500,
-200
],
"parameters": {
"color": 7,
"width": 300,
"height": 260,
"content": "## Step 2: Data Validation\n\n**Function Node** validates and cleans data:\n• Checks amount > 0\n• Validates categories\n• Sets defaults for missing fields\n• Formats numbers properly\n\n*Ensures data consistency*"
},
"typeVersion": 1
},
{
"id": "0ab3f049-da8f-48f0-9715-3fd5382310b8",
"name": "ステップ3 - Google Sheets ストレージ",
"type": "n8n-nodes-base.stickyNote",
"position": [
800,
-220
],
"parameters": {
"color": 7,
"width": 300,
"height": 280,
"content": "## Step 3: Google Sheets Storage\n\n**Google Sheets Node** appends expense to spreadsheet\n\n**Sheet**: 'Expenses'\n**Columns**: Date | Category | Description | Amount | Payment Method\n\n*Your permanent expense database*"
},
"typeVersion": 1
},
{
"id": "f68eeb78-bf5c-43e6-8ac2-20745b3aa54f",
"name": "ステップ4 - API レスポンス",
"type": "n8n-nodes-base.stickyNote",
"position": [
1140,
-200
],
"parameters": {
"color": 7,
"width": 300,
"height": 260,
"content": "## Step 4: API Response\n\n**Response Nodes** return JSON with:\n✅ Success: Expense details + confirmation\n❌ Error: Validation errors + field requirements\n\n*Immediate feedback for calling applications*"
},
"typeVersion": 1
},
{
"id": "d1a9d5fa-b4d8-492f-b3ed-9d8789194da3",
"name": "日次サマリー自動化",
"type": "n8n-nodes-base.stickyNote",
"position": [
1120,
280
],
"parameters": {
"color": 6,
"width": 500,
"height": 250,
"content": "## 📊 Automated Daily Summary\n\n**Cron Trigger** runs daily at 8:00 PM to:\n• Read all today's expenses from Google Sheets\n• Calculate total spending and category breakdown\n• Generate summary report\n\n**Perfect for**: Evening expense review, budget tracking, spending pattern analysis\n\n*Stay informed about your daily spending habits automatically*"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "aedb5fd0-8999-486c-af50-b440d70e1926",
"connections": {
"0dc9105c-6579-4bde-b831-b993ac6e1a54": {
"main": [
[
{
"node": "17662aeb-97d6-468e-b1d1-2b82a44dfbb9",
"type": "main",
"index": 0
}
]
]
},
"026567d0-aef6-49a8-9100-22cbac0bccae": {
"main": [
[
{
"node": "483b47d5-4b82-4e5b-9d79-fb1c2337d90a",
"type": "main",
"index": 0
}
]
]
},
"84af3396-544e-41fe-a8ae-5f27f912bf77": {
"main": [
[
{
"node": "71a8e380-dc27-4cdb-a4e7-388347a38939",
"type": "main",
"index": 0
}
]
]
},
"0a4044a1-f23e-4c5a-9383-425f0fb5cf9e": {
"main": [
[
{
"node": "84af3396-544e-41fe-a8ae-5f27f912bf77",
"type": "main",
"index": 0
}
]
]
},
"483b47d5-4b82-4e5b-9d79-fb1c2337d90a": {
"main": [
[
{
"node": "f166a60d-06f0-4852-88e2-c4a05fbf39c9",
"type": "main",
"index": 0
}
]
]
},
"17662aeb-97d6-468e-b1d1-2b82a44dfbb9": {
"main": [
[
{
"node": "0a4044a1-f23e-4c5a-9383-425f0fb5cf9e",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - 個人の生産性
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
ドイツのアパート検索ツールと自動申請(ノート付き)
自動ドイツ語アパート検索と申請:Immobilienscout24とGoogleサービスを統合
Set
Cron
Function
+
Set
Cron
Function
22 ノードAbbas Ali
個人の生産性
複数の採用サイトからの求人情報の自動化
5 つの求人プラットフォームと AI リジュームジェネレーターを使った就職・応募の自動化
If
Set
Code
+
If
Set
Code
34 ノードGerald Denor
個人の生産性
テクノロジーレーダー
SQLデータベース、RAG、ルーティングエージェントを使用したAI駆動の技術雷達コンサルタント
If
Code
Cron
+
If
Code
Cron
53 ノードSean Lon
エンジニアリング
高度なSEO、Core Web Vitals、チャットボット自動化実装
GPT-4 コンサルタント、PageSpeed Insights、Slack アラートを使って SEO パフォーマンスを監査しモニタリング
If
Set
Cron
+
If
Set
Cron
22 ノードCandra Reza
市場調査
Instagram インフルエンサーの成果物および契約準拠性の自動化
Claude AI と Slack アラートを使って Instagram インフルエンサー契約の合従性を自動化
If
Set
Code
+
If
Set
Code
26 ノードOneclick AI Squad
ソーシャルメディア
ワークデイログ記録
AI作業時間表ジェネレーター - Gmail、カレンダー、GitHubをGoogleスプレッドシートに統合
If
Set
Code
+
If
Set
Code
31 ノードLuka Zivkovic
個人の生産性