{
  "name": "Manage personal expenses with webhooks and Google Sheets automated tracker",
  "nodes": [
    {
      "id": "0dc9105c-6579-4bde-b831-b993ac6e1a54",
      "name": "Expense Input Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        240,
        100
      ]
    },
    {
      "id": "17662aeb-97d6-468e-b1d1-2b82a44dfbb9",
      "name": "Validate and Format Expense Data",
      "type": "n8n-nodes-base.function",
      "position": [
        540,
        100
      ]
    },
    {
      "id": "0a4044a1-f23e-4c5a-9383-425f0fb5cf9e",
      "name": "Save Expense to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        840,
        100
      ]
    },
    {
      "id": "84af3396-544e-41fe-a8ae-5f27f912bf77",
      "name": "Calculate Monthly Summary",
      "type": "n8n-nodes-base.function",
      "position": [
        1140,
        100
      ]
    },
    {
      "id": "71a8e380-dc27-4cdb-a4e7-388347a38939",
      "name": "Send Success Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1440,
        100
      ]
    },
    {
      "id": "638d6c11-fcdc-4aa7-a785-6a23dad63e06",
      "name": "Send Error Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        540,
        260
      ]
    },
    {
      "id": "026567d0-aef6-49a8-9100-22cbac0bccae",
      "name": "Daily Summary Schedule",
      "type": "n8n-nodes-base.cron",
      "position": [
        240,
        400
      ]
    },
    {
      "id": "483b47d5-4b82-4e5b-9d79-fb1c2337d90a",
      "name": "Read Today's Expenses from Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        540,
        400
      ]
    },
    {
      "id": "f166a60d-06f0-4852-88e2-c4a05fbf39c9",
      "name": "Calculate Daily Total",
      "type": "n8n-nodes-base.function",
      "position": [
        840,
        400
      ]
    },
    {
      "id": "b395295d-2f98-41cf-9ea3-37aa8ba09e83",
      "name": "Main Workflow Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -100
      ],
      "parameters": {
        "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"
      }
    },
    {
      "id": "49605945-3d4d-497c-83f9-2518ebc4e1e9",
      "name": "Step 1 - API Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        -220
      ],
      "parameters": {
        "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 cal"
      }
    },
    {
      "id": "c02af8e8-6b84-4226-81cb-558bda710a91",
      "name": "Step 2 - Data Validation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        -200
      ],
      "parameters": {
        "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 consist"
      }
    },
    {
      "id": "0ab3f049-da8f-48f0-9715-3fd5382310b8",
      "name": "Step 3 - Google Sheets Storage",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -220
      ],
      "parameters": {
        "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 exp"
      }
    },
    {
      "id": "f68eeb78-bf5c-43e6-8ac2-20745b3aa54f",
      "name": "Step 4 - API Response",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1140,
        -200
      ],
      "parameters": {
        "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*"
      }
    },
    {
      "id": "d1a9d5fa-b4d8-492f-b3ed-9d8789194da3",
      "name": "Daily Summary Automation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        280
      ],
      "parameters": {
        "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**P"
      }
    }
  ],
  "connections": {
    "Expense Input Webhook": {
      "main": [
        [
          {
            "node": "Validate and Format Expense Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Summary Schedule": {
      "main": [
        [
          {
            "node": "Read Today's Expenses from Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Monthly Summary": {
      "main": [
        [
          {
            "node": "Send Success Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Expense to Google Sheets": {
      "main": [
        [
          {
            "node": "Calculate Monthly Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Today's Expenses from Sheet": {
      "main": [
        [
          {
            "node": "Calculate Daily Total",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate and Format Expense Data": {
      "main": [
        [
          {
            "node": "Save Expense to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}