{
  "name": "Invoice Chaser — Week 5: Owner Alert at 30 Days (Genesis Web Digital)",
  "nodes": [
    {
      "parameters": {
        "content": "## Invoice Chaser — Week 5 template\n\n**Free template from Genesis Web Digital** · genesisweb.org\n\nWeek 5 teaches it to come and get you. Both reminders have gone out, 30 days have passed, and the invoice is still open — so it pings you instead of quietly giving up.\n\n### Setup (once)\n1. **New Invoice Added** — connect your Google account, pick your invoice spreadsheet + tab. Exact column headers: `Invoice Number`, `Client Name`, `Client Email`, `Amount`, `Due Date`.\n2. **Log the Invoice** — pick a tracking tab (e.g. `Invoice Log`) with those five columns plus `Status`. Every new invoice is logged as `Logged`.\n3. Point **Cancel Reminders · Day 7**, **Cancel Reminders · Day 14**, **Mark Second Notice**, **Mark as Paid** and **Still Unpaid at 30?** at that same tracking tab.\n4. **Send Payment Reminder** + **Send Second Notice** — connect your SMTP / email credential and set the From address on both.\n5. **Payment Received** — copy its Production URL into whatever tells you an invoice is paid: a Stripe webhook (event `invoice.paid`, with your sheet's invoice number in the invoice's `invoice_number` metadata) or an automation that POSTs `{\"invoiceNumber\": \"INV-1043\"}`. Keep the URL private — anyone with it can mark an invoice paid.\n6. **Ping Me** — connect your Slack credential, then pick the channel from the dropdown. No Slack? Swap this node for a copy of **Send Second Notice** addressed to yourself, or a Telegram / Twilio SMS node.\n7. Toggle the workflow **Active**.\n\n### Good to know\n- Invoice numbers must be unique.\n- The day-30 ping reads the row's `Status` at the moment it checks. If a payment lands in the seconds between the day-14 check and `Mark Second Notice`, the row gets written back to `Second Notice` and that invoice can still be pinged.\n- Paid by hand? Change the row's `Status` to `Paid`. Any status other than `Logged` (e.g. `Disputed`) also stops the reminders.\n- Invoices already waiting under an older week's version keep that version's behaviour.\n- An unpaid invoice now holds a **waiting execution for 30 days**. That execution has to survive in your database — on self-hosted, check that your execution-retention settings keep *waiting* executions; on Cloud, check your plan's retention.\n\nEach week of the series adds to the build — follow along on LinkedIn, Instagram, TikTok, or Facebook.",
        "height": 900,
        "width": 440
      },
      "id": "sticky-readme",
      "name": "READ ME — setup in 7 steps",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -260,
        -260
      ]
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "event": "rowAdded",
        "options": {}
      },
      "id": "invoice-trigger",
      "name": "New Invoice Added",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "typeVersion": 1,
      "position": [
        240,
        60
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Invoice Number": "={{ $json['Invoice Number'] }}",
            "Client Name": "={{ $json['Client Name'] }}",
            "Client Email": "={{ $json['Client Email'] }}",
            "Amount": "={{ $json['Amount'] }}",
            "Due Date": "={{ $json['Due Date'] }}",
            "Status": "Logged"
          },
          "matchingColumns": [],
          "schema": []
        },
        "options": {}
      },
      "id": "log-invoice",
      "name": "Log the Invoice",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        460,
        60
      ]
    },
    {
      "parameters": {
        "unit": "days",
        "amount": 7
      },
      "id": "wait-7-days",
      "name": "Wait 7 Days",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        680,
        60
      ],
      "webhookId": "invoice-chaser-week4-wait-7"
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "Invoice Number",
              "lookupValue": "={{ $('New Invoice Added').item.json['Invoice Number'] }}"
            },
            {
              "lookupColumn": "Status",
              "lookupValue": "Logged"
            }
          ]
        },
        "combineFilters": "AND",
        "options": {
          "returnFirstMatch": true
        }
      },
      "id": "check-paid-day-7",
      "name": "Cancel Reminders · Day 7",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        900,
        60
      ]
    },
    {
      "parameters": {
        "fromEmail": "you@yourbusiness.com",
        "toEmail": "={{ $('New Invoice Added').item.json['Client Email'] }}",
        "subject": "=Friendly reminder — invoice {{ $('New Invoice Added').item.json['Invoice Number'] }}",
        "text": "=Hi {{ $('New Invoice Added').item.json['Client Name'] }},\n\nJust a quick, friendly note — invoice {{ $('New Invoice Added').item.json['Invoice Number'] }} for {{ $('New Invoice Added').item.json['Amount'] }} was sent a week ago and is still showing as open on our end.\n\nIf you've already sent payment, thank you — feel free to ignore this. If not, no rush at all; the payment details are on the invoice, and I'm happy to resend it if that's easier.\n\nThanks so much,\n{{ $('New Invoice Added').item.json['Your Name'] || 'Your Name' }}",
        "options": {}
      },
      "id": "send-reminder",
      "name": "Send Payment Reminder",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1120,
        60
      ]
    },
    {
      "parameters": {
        "unit": "days",
        "amount": 7
      },
      "id": "wait-7-more-days",
      "name": "Wait 7 More Days",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1340,
        60
      ],
      "webhookId": "invoice-chaser-week4-wait-14"
    },
    {
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "Invoice Number",
              "lookupValue": "={{ $('New Invoice Added').item.json['Invoice Number'] }}"
            },
            {
              "lookupColumn": "Status",
              "lookupValue": "Logged"
            }
          ]
        },
        "combineFilters": "AND",
        "options": {
          "returnFirstMatch": true
        }
      },
      "id": "check-paid-day-14",
      "name": "Cancel Reminders · Day 14",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1560,
        60
      ]
    },
    {
      "parameters": {
        "fromEmail": "you@yourbusiness.com",
        "toEmail": "={{ $('New Invoice Added').item.json['Client Email'] }}",
        "subject": "=Second notice — invoice {{ $('New Invoice Added').item.json['Invoice Number'] }} is now 14 days past due",
        "text": "=Hi {{ $('New Invoice Added').item.json['Client Name'] }},\n\nFollowing up on invoice {{ $('New Invoice Added').item.json['Invoice Number'] }} for {{ $('New Invoice Added').item.json['Amount'] }}, which was due on {{ $('New Invoice Added').item.json['Due Date'] }}. This is the second reminder — the invoice is now 14 days past due and still showing as unpaid.\n\nPlease arrange payment this week, or reply to this email and let me know when I can expect it. If there's an issue with the invoice, tell me and I'll get it sorted right away.\n\nThanks,\n{{ $('New Invoice Added').item.json['Your Name'] || 'Your Name' }}",
        "options": {}
      },
      "id": "send-second-notice",
      "name": "Send Second Notice",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1780,
        60
      ]
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Invoice Number": "={{ $('New Invoice Added').item.json['Invoice Number'] }}",
            "Status": "Second Notice"
          },
          "matchingColumns": [
            "Invoice Number"
          ],
          "schema": []
        },
        "options": {}
      },
      "id": "mark-second-notice",
      "name": "Mark Second Notice",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        2000,
        60
      ]
    },
    {
      "id": "wait-to-day-30",
      "name": "Wait to Day 30",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        2220,
        60
      ],
      "webhookId": "invoice-chaser-week5-wait-30",
      "parameters": {
        "unit": "days",
        "amount": 16
      }
    },
    {
      "id": "still-unpaid-at-30",
      "name": "Still Unpaid at 30?",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        2440,
        60
      ],
      "parameters": {
        "operation": "read",
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "Invoice Number",
              "lookupValue": "={{ $json['Invoice Number'] }}"
            },
            {
              "lookupColumn": "Status",
              "lookupValue": "Second Notice"
            }
          ]
        },
        "combineFilters": "AND",
        "options": {
          "returnFirstMatch": true
        }
      }
    },
    {
      "id": "ping-me",
      "name": "Ping Me",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        2660,
        60
      ],
      "parameters": {
        "resource": "message",
        "operation": "post",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "text": "=:rotating_light: *Still unpaid at 30 days* — invoice {{ $json['Invoice Number'] }} for {{ $json['Client Name'] }}.\nAmount: {{ $json['Amount'] }} · was due {{ $json['Due Date'] }}.\nBoth reminders have gone out and it is still open. This one needs you.",
        "otherOptions": {}
      }
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "5d0f7a2c-4b1e-4c39-9a6e-2f8d1c7b3e41",
        "options": {}
      },
      "id": "payment-received",
      "name": "Payment Received",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        680,
        620
      ],
      "webhookId": "5d0f7a2c-4b1e-4c39-9a6e-2f8d1c7b3e41"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "has-invoice-number",
              "leftValue": "={{ String($json.body?.invoiceNumber ?? $json.body?.invoice_number ?? $json.body?.['Invoice Number'] ?? $json.body?.data?.object?.metadata?.invoice_number ?? $json.body?.data?.object?.number ?? '').trim() }}",
              "rightValue": "",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "has-invoice-number",
      "name": "Has an Invoice Number?",
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.3,
      "position": [
        900,
        620
      ]
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Invoice Number": "={{ String($json.body?.invoiceNumber ?? $json.body?.invoice_number ?? $json.body?.['Invoice Number'] ?? $json.body?.data?.object?.metadata?.invoice_number ?? $json.body?.data?.object?.number ?? '').trim() }}",
            "Status": "Paid"
          },
          "matchingColumns": [
            "Invoice Number"
          ],
          "schema": []
        },
        "options": {}
      },
      "id": "mark-as-paid",
      "name": "Mark as Paid",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1120,
        620
      ]
    },
    {
      "parameters": {
        "content": "**Why the log comes first**\n\nThe log row is written the moment the invoice lands — not 7 days later. If anything downstream ever fails, your tracking sheet still has the record. From Week 4 on, it's also the row both reminders check before they send.",
        "height": 190,
        "width": 280
      },
      "id": "sticky-log",
      "name": "Why the log comes first",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        400,
        240
      ]
    },
    {
      "parameters": {
        "content": "**Two touches, then it stops nagging you**\n\nDay 7 = polite nudge. Day 14 = firmer second notice, same invoice. The sheet flips to `Second Notice` so a glance at the tab shows exactly where every invoice stands.\n\nAs of Week 4, both reminders re-read the row first — a `Paid` invoice gets nothing.",
        "height": 250,
        "width": 320
      },
      "id": "sticky-escalate",
      "name": "The day-14 escalation",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1300,
        240
      ]
    },
    {
      "parameters": {
        "content": "**The payment listener**\n\n**Payment Received** catches a paid event and **Mark as Paid** flips that row's `Status` to `Paid`.\n\nNothing has to hunt down the waiting run. Right before each email, **Cancel Reminders** re-reads the row — if it isn't `Logged` any more, that run stops there. That's why editing the cell by hand works too.\n\nWeek 6 makes the whole thing bulletproof.",
        "height": 300,
        "width": 400
      },
      "id": "sticky-listener",
      "name": "The payment listener",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1300,
        560
      ]
    },
    {
      "id": "sticky-alert",
      "name": "The 30-day owner alert",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        2220,
        300
      ],
      "parameters": {
        "height": 460,
        "width": 460,
        "content": "**Week 5 — it comes and gets you**\n\nDay 14 leaves the row on `Second Notice`. **Wait to Day 30** holds the run 16 more days (7 + 7 + 16 = 30 — the name is the day, not the value; don't change it to 30), then **Still Unpaid at 30?** re-reads the row.\n\nStill `Second Notice` → you get pinged. Paid in the meantime → the listener already wrote `Paid`, the read returns nothing, and the run stops. Same trick as the two Cancel Reminders nodes.\n\n**Ping Me** is a Slack message — pick your channel after you connect the credential. No Slack? Swap it for a copy of **Send Second Notice** addressed to yourself, or a Telegram / Twilio SMS node. One node either way.\n\nThree things it does *not* cover, all on purpose:\n- A payment that lands in the seconds between the day-14 check and **Mark Second Notice** gets written back to `Second Notice`, so that invoice can still get a day-30 ping. Rare, and the fix is a Paid column nothing else writes.\n- If the day-14 email itself failed, the row never reached `Second Notice`, so no alert fires. That is what Week 6 fixes.\n- **Payment Received** has no auth, so a forged call can mark an invoice paid and silence this alert. Also Week 6."
      }
    }
  ],
  "connections": {
    "New Invoice Added": {
      "main": [
        [
          {
            "node": "Log the Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log the Invoice": {
      "main": [
        [
          {
            "node": "Wait 7 Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 7 Days": {
      "main": [
        [
          {
            "node": "Cancel Reminders · Day 7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cancel Reminders · Day 7": {
      "main": [
        [
          {
            "node": "Send Payment Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Payment Reminder": {
      "main": [
        [
          {
            "node": "Wait 7 More Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 7 More Days": {
      "main": [
        [
          {
            "node": "Cancel Reminders · Day 14",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cancel Reminders · Day 14": {
      "main": [
        [
          {
            "node": "Send Second Notice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Second Notice": {
      "main": [
        [
          {
            "node": "Mark Second Notice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Payment Received": {
      "main": [
        [
          {
            "node": "Has an Invoice Number?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has an Invoice Number?": {
      "main": [
        [
          {
            "node": "Mark as Paid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark Second Notice": {
      "main": [
        [
          {
            "node": "Wait to Day 30",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait to Day 30": {
      "main": [
        [
          {
            "node": "Still Unpaid at 30?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Still Unpaid at 30?": {
      "main": [
        [
          {
            "node": "Ping Me",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}