{
  "name": "Invoice Follow-Up (7-Day Reminder)",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Schedule \u2014 Daily Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "resource": "invoice",
        "operation": "getAll",
        "returnAll": true,
        "filters": {
          "status": "unpaid"
        }
      },
      "id": "quickbooks-invoices",
      "name": "QuickBooks \u2014 Get Unpaid Invoices",
      "type": "n8n-nodes-base.quickbooks",
      "typeVersion": 1,
      "position": [
        460,
        300
      ],
      "credentials": {
        "quickBooksOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "notes": "Swap for FreshBooks, Xero, Wave, or any accounting tool with an API"
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{ Math.floor((Date.now() - new Date($json.DueDate).getTime()) / 86400000) }}",
              "operation": "equal",
              "value2": 7
            }
          ]
        }
      },
      "id": "filter-7-days",
      "name": "Filter \u2014 Exactly 7 Days Overdue",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 1,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "billing@yourdomain.com",
        "toEmail": "={{ $json.BillEmail.Address }}",
        "subject": "=Friendly reminder: Invoice #{{ $json.DocNumber }} is due",
        "emailType": "text",
        "message": "=Hi {{ $json.CustomerRef.name }},\n\nJust a quick reminder that invoice #{{ $json.DocNumber }} for ${{ $json.TotalAmt }} was due on {{ $json.DueDate }}.\n\nIf you've already sent payment, please disregard this message. Otherwise, you can pay here: [payment link]\n\nThanks,\nThe Team"
      },
      "id": "send-reminder",
      "name": "Email \u2014 Send Reminder",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "position": [
        900,
        300
      ],
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "value": "YOUR_SHEET_ID"
        },
        "sheetName": "Invoice Log",
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Invoice #": "={{ $json.DocNumber }}",
            "Customer": "={{ $json.CustomerRef.name }}",
            "Amount": "={{ $json.TotalAmt }}",
            "Due Date": "={{ $json.DueDate }}",
            "Reminder Sent": "={{ $now.toISO() }}"
          }
        }
      },
      "id": "log-to-sheets",
      "name": "Google Sheets \u2014 Log Reminder",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [
        1120,
        300
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Schedule \u2014 Daily Check": {
      "main": [
        [
          {
            "node": "QuickBooks \u2014 Get Unpaid Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "QuickBooks \u2014 Get Unpaid Invoices": {
      "main": [
        [
          {
            "node": "Filter \u2014 Exactly 7 Days Overdue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter \u2014 Exactly 7 Days Overdue": {
      "main": [
        [
          {
            "node": "Email \u2014 Send Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email \u2014 Send Reminder": {
      "main": [
        [
          {
            "node": "Google Sheets \u2014 Log Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": false,
    "description": "Runs daily, finds invoices exactly 7 days overdue, sends a reminder email, and logs it to Google Sheets. Built by Aplos AI (aplosai.com)."
  }
}