{
  "name": "Automated finance tracker with Gmail, Google Sheets & GPT-4o monthly reports",
  "nodes": [
    {
      "id": "sticky-description",
      "name": "📋 Template Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        50,
        50
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "cron-trigger-node",
      "name": "Monthly Report Trigger",
      "type": "n8n-nodes-base.cron",
      "position": [
        250,
        100
      ]
    },
    {
      "id": "user-config",
      "name": "User Config",
      "type": "n8n-nodes-base.set",
      "position": [
        50,
        200
      ]
    },
    {
      "id": "gmail-fetch-node",
      "name": "Fetch Receipt Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        250,
        300
      ]
    },
    {
      "id": "gmail-get-attachments",
      "name": "Get Email with Attachments",
      "type": "n8n-nodes-base.gmail",
      "position": [
        450,
        300
      ]
    },
    {
      "id": "parse-email-body",
      "name": "Parse Email Body & Check Attachments",
      "type": "n8n-nodes-base.function",
      "position": [
        650,
        300
      ]
    },
    {
      "id": "ai-extract-receipt",
      "name": "AI: Extract Receipt Data (GPT-4o)",
      "type": "n8n-nodes-base.openAi",
      "position": [
        850,
        300
      ]
    },
    {
      "id": "clean-ai-output",
      "name": "Clean & Parse AI Output",
      "type": "n8n-nodes-base.function",
      "position": [
        1050,
        300
      ]
    },
    {
      "id": "check-duplicates",
      "name": "Check for Duplicates",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1250,
        300
      ]
    },
    {
      "id": "filter-missing-vendor",
      "name": "Filter: Skip if Missing Vendor",
      "type": "n8n-nodes-base.if",
      "position": [
        1450,
        300
      ]
    },
    {
      "id": "append-to-sheet",
      "name": "Append to Finance Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1650,
        300
      ]
    },
    {
      "id": "generate-date-range",
      "name": "Generate Month Range",
      "type": "n8n-nodes-base.function",
      "position": [
        450,
        100
      ]
    },
    {
      "id": "read-finance-data",
      "name": "Read All Finance Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        650,
        100
      ]
    },
    {
      "id": "aggregate-monthly",
      "name": "Aggregate Monthly Data",
      "type": "n8n-nodes-base.function",
      "position": [
        850,
        100
      ]
    },
    {
      "id": "ai-generate-insights",
      "name": "AI: Generate Insights",
      "type": "n8n-nodes-base.openAi",
      "position": [
        1050,
        100
      ]
    },
    {
      "id": "generate-chart",
      "name": "Generate Chart & Final Data",
      "type": "n8n-nodes-base.function",
      "position": [
        1250,
        100
      ]
    },
    {
      "id": "email-report",
      "name": "Send Monthly Report",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1450,
        100
      ]
    }
  ],
  "connections": {
    "Check for Duplicates": {
      "main": [
        [
          {
            "node": "Filter: Skip if Missing Vendor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Receipt Emails": {
      "main": [
        [
          {
            "node": "Get Email with Attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Month Range": {
      "main": [
        [
          {
            "node": "Read All Finance Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI: Generate Insights": {
      "main": [
        [
          {
            "node": "Generate Chart & Final Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read All Finance Data": {
      "main": [
        [
          {
            "node": "Aggregate Monthly Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Monthly Data": {
      "main": [
        [
          {
            "node": "AI: Generate Insights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monthly Report Trigger": {
      "main": [
        [
          {
            "node": "Generate Month Range",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Receipt Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean & Parse AI Output": {
      "main": [
        [
          {
            "node": "Check for Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Email with Attachments": {
      "main": [
        [
          {
            "node": "Parse Email Body & Check Attachments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Chart & Final Data": {
      "main": [
        [
          {
            "node": "Send Monthly Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter: Skip if Missing Vendor": {
      "main": [
        [
          {
            "node": "Append to Finance Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI: Extract Receipt Data (GPT-4o)": {
      "main": [
        [
          {
            "node": "Clean & Parse AI Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Email Body & Check Attachments": {
      "main": [
        [
          {
            "node": "AI: Extract Receipt Data (GPT-4o)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}