{
  "name": "Invoice Follow-up Chaser (ClarioAI)",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "daysInterval": 1
            }
          ]
        }
      },
      "name": "Daily",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {},
      "name": "Fetch Unpaid Invoices",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// 3-touch cadence based on days_overdue\nreturn $input.all().map(i => { const d = i.json.days_overdue; let touch = null; if (d === 3) touch = 'gentle'; if (d === 10) touch = 'firm'; if (d === 21) touch = 'final'; return { json: { ...i.json, touch } }; }).filter(x => x.json.touch);"
      },
      "name": "Pick Touch",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {},
      "name": "Send Email (Resend)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        900,
        300
      ]
    }
  ],
  "connections": {
    "Daily": {
      "main": [
        [
          {
            "node": "Fetch Unpaid Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Unpaid Invoices": {
      "main": [
        [
          {
            "node": "Pick Touch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pick Touch": {
      "main": [
        [
          {
            "node": "Send Email (Resend)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "source": "ClarioAI \u2014 clarioai.ca"
  }
}