{
  "name": "Invoice Chaser (by PikPik)",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [{ "field": "days", "daysInterval": 1, "triggerAtHour": 9 }]
        }
      },
      "id": "inv-chase-0001-node-schedule",
      "name": "Every Morning",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [0, 300]
    },
    {
      "parameters": {
        "resource": "sheet",
        "operation": "read",
        "documentId": { "__rl": true, "value": "YOUR_GOOGLE_SHEET_ID", "mode": "id" },
        "sheetName": { "__rl": true, "value": "Invoices", "mode": "name" },
        "options": {}
      },
      "id": "inv-chase-0002-node-sheets",
      "name": "Get Invoices",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [220, 300]
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose" },
          "conditions": [
            {
              "id": "cond-unpaid",
              "leftValue": "={{ $json.status }}",
              "rightValue": "Paid",
              "operator": { "type": "string", "operation": "notEquals" }
            },
            {
              "id": "cond-overdue",
              "leftValue": "={{ $json.due_date }}",
              "rightValue": "={{ $now }}",
              "operator": { "type": "dateTime", "operation": "before" }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "inv-chase-0003-node-filter",
      "name": "Overdue and Unpaid",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2,
      "position": [440, 300]
    },
    {
      "parameters": {
        "fromEmail": "you@youragency.com",
        "toEmail": "={{ $json.client_email }}",
        "subject": "Friendly reminder: invoice {{ $json.invoice_number }} is due",
        "emailFormat": "text",
        "text": "Hi {{ $json.client_name }},\n\nJust a quick reminder that invoice {{ $json.invoice_number }} for {{ $json.amount }} was due on {{ $json.due_date }}. If it is already on the way, thank you and please ignore this note. If not, you can settle it here: {{ $json.payment_link }}.\n\nThanks so much, and let me know if anything looks off.",
        "options": {}
      },
      "id": "inv-chase-0004-node-email",
      "name": "Send Reminder",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [660, 300]
    }
  ],
  "connections": {
    "Every Morning": { "main": [[{ "node": "Get Invoices", "type": "main", "index": 0 }]] },
    "Get Invoices": { "main": [[{ "node": "Overdue and Unpaid", "type": "main", "index": 0 }]] },
    "Overdue and Unpaid": { "main": [[{ "node": "Send Reminder", "type": "main", "index": 0 }]] }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "pinData": {},
  "meta": { "templateCredsSetupCompleted": false }
}
