{
  "name": "Invoice management system with Gmail reminders, Google Sheets, and Slack escalations",
  "nodes": [
    {
      "id": "sticky-overview",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        80
      ],
      "parameters": {
        "width": 400,
        "height": 560,
        "content": "## Generate invoices and send payment reminders with escalation\n\n### Who is this for?\nFreelancers, small businesses, and finance teams who need automated invoice management with intelligent payment fo"
      }
    },
    {
      "id": "sticky-step1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        180
      ],
      "parameters": {
        "width": 280,
        "height": 80,
        "content": "**Step 1: Invoice Creation**\nReceive order data, generate invoice ID, and initialize invoice fields."
      }
    },
    {
      "id": "sticky-step2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        180
      ],
      "parameters": {
        "width": 300,
        "height": 80,
        "content": "**Step 2: Line Item Processing**\nSplit Out each line item, calculate totals, and Aggregate results."
      }
    },
    {
      "id": "sticky-step3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1320,
        420
      ],
      "parameters": {
        "width": 320,
        "height": 80,
        "content": "**Step 3: Daily Overdue Check**\nSchedule Trigger runs daily. Loop Over batches each invoice for processing."
      }
    },
    {
      "id": "sticky-step4",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1980,
        180
      ],
      "parameters": {
        "width": 320,
        "height": 80,
        "content": "**Step 4: Reminder Escalation**\nSwitch routes to 5 reminder levels based on days overdue. Collections at 60+ days."
      }
    },
    {
      "id": "webhook-invoice",
      "name": "New Invoice Request",
      "type": "n8n-nodes-base.webhook",
      "position": [
        180,
        300
      ]
    },
    {
      "id": "init-invoice",
      "name": "Initialize Invoice",
      "type": "n8n-nodes-base.set",
      "position": [
        400,
        300
      ]
    },
    {
      "id": "split-line-items",
      "name": "Split Line Items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        620,
        300
      ]
    },
    {
      "id": "calc-line-total",
      "name": "Calculate Line Total",
      "type": "n8n-nodes-base.code",
      "position": [
        840,
        300
      ]
    },
    {
      "id": "aggregate-lines",
      "name": "Aggregate Line Items",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1060,
        300
      ]
    },
    {
      "id": "build-invoice",
      "name": "Build Invoice Object",
      "type": "n8n-nodes-base.code",
      "position": [
        1280,
        300
      ]
    },
    {
      "id": "save-invoice",
      "name": "Save Invoice to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1500,
        300
      ]
    },
    {
      "id": "send-invoice-email",
      "name": "Send Invoice Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1720,
        300
      ]
    },
    {
      "id": "invoice-response",
      "name": "Invoice Created Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1940,
        300
      ]
    },
    {
      "id": "daily-check",
      "name": "Daily Overdue Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1320,
        540
      ]
    },
    {
      "id": "get-unpaid",
      "name": "Get Unpaid Invoices",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1540,
        540
      ]
    },
    {
      "id": "calc-overdue",
      "name": "Calculate Overdue Days",
      "type": "n8n-nodes-base.code",
      "position": [
        1760,
        540
      ]
    },
    {
      "id": "loop-invoices",
      "name": "Loop Over Invoices",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1980,
        540
      ]
    },
    {
      "id": "route-reminder",
      "name": "Route by Reminder Level",
      "type": "n8n-nodes-base.switch",
      "position": [
        2200,
        540
      ]
    },
    {
      "id": "first-reminder",
      "name": "First Reminder Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2440,
        320
      ]
    },
    {
      "id": "second-reminder",
      "name": "Second Reminder Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2440,
        460
      ]
    },
    {
      "id": "urgent-reminder",
      "name": "Urgent Reminder Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2440,
        600
      ]
    },
    {
      "id": "final-reminder",
      "name": "Final Notice Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2440,
        740
      ]
    },
    {
      "id": "collections-slack",
      "name": "Escalate to Collections",
      "type": "n8n-nodes-base.slack",
      "position": [
        2440,
        880
      ]
    },
    {
      "id": "merge-reminders",
      "name": "Merge Reminder Paths",
      "type": "n8n-nodes-base.merge",
      "position": [
        2680,
        540
      ]
    },
    {
      "id": "update-reminder-date",
      "name": "Update Reminder Date",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2900,
        540
      ]
    },
    {
      "id": "continue-loop",
      "name": "Continue Loop",
      "type": "n8n-nodes-base.code",
      "position": [
        3120,
        540
      ]
    }
  ],
  "connections": {
    "Continue Loop": {
      "main": [
        [
          {
            "node": "Loop Over Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Line Items": {
      "main": [
        [
          {
            "node": "Calculate Line Total",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Final Notice Email": {
      "main": [
        [
          {
            "node": "Merge Reminder Paths",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialize Invoice": {
      "main": [
        [
          {
            "node": "Split Line Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Invoices": {
      "main": [
        [
          {
            "node": "Route by Reminder Level",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Send Invoice Email": {
      "main": [
        [
          {
            "node": "Invoice Created Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Overdue Check": {
      "main": [
        [
          {
            "node": "Get Unpaid Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Unpaid Invoices": {
      "main": [
        [
          {
            "node": "Calculate Overdue Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Invoice Request": {
      "main": [
        [
          {
            "node": "Initialize Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Line Items": {
      "main": [
        [
          {
            "node": "Build Invoice Object",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Invoice Object": {
      "main": [
        [
          {
            "node": "Save Invoice to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Line Total": {
      "main": [
        [
          {
            "node": "Aggregate Line Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "First Reminder Email": {
      "main": [
        [
          {
            "node": "Merge Reminder Paths",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Reminder Paths": {
      "main": [
        [
          {
            "node": "Update Reminder Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Reminder Date": {
      "main": [
        [
          {
            "node": "Continue Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Invoice to Sheet": {
      "main": [
        [
          {
            "node": "Send Invoice Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Second Reminder Email": {
      "main": [
        [
          {
            "node": "Merge Reminder Paths",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Urgent Reminder Email": {
      "main": [
        [
          {
            "node": "Merge Reminder Paths",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Overdue Days": {
      "main": [
        [
          {
            "node": "Loop Over Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Escalate to Collections": {
      "main": [
        [
          {
            "node": "Merge Reminder Paths",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Reminder Level": {
      "main": [
        [
          {
            "node": "First Reminder Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Second Reminder Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Urgent Reminder Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Final Notice Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Escalate to Collections",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}