Chase overdue LeadConnector invoices every weekday morning

By General Input

Every weekday at 9am, send escalating payment reminders to every customer with an overdue invoice, log each one, and brief your finance channel.

Integrations

  • LeadConnector
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Finance
  • Operations

Every weekday at 9am, chase my overdue LeadConnector invoices on a fixed, predictable schedule. Build this as a code workflow on a cron trigger running Monday through Friday at 9am in my timezone. Every step is deterministic: a filtered read, rule based bucketing, templated message text, an append, and a formatted summary. There is no drafting or prioritisation judgement anywhere in this, so keep it node based rather than agentic.

Start by pulling the invoices. Use LeadConnector List Invoices for my sub-account, filtered to unpaid statuses and to invoices whose due date is in the past. LeadConnector invoice endpoints require altId set to my location id and altType set to "location", so pass both on every invoice call. Page through the full result set rather than stopping at the first page, since a busy sub-account can have more overdue invoices than fit in one response. For each invoice keep the invoice id, invoice number, contact id, contact name, amount due, currency, due date, and status.

Then apply two guards before anything gets sent. First, skip any invoice whose status is paid, void, or cancelled. Immediately before sending a reminder, re-read that single invoice with LeadConnector Get Invoice and confirm it is still unpaid, so an invoice paid between the list call and the send does not get chased. Second, enforce at most one reminder per invoice per day: read today's rows from the collections log sheet with Google Sheets Get Values, and skip any invoice whose invoice number already appears with today's date. This rule matters because the cron runs daily and would otherwise re-notify the same overdue invoice indefinitely.

Bucket the surviving invoices by how many whole days past the due date they are. The 3 day bucket covers invoices at least 3 days overdue but fewer than 7. The 7 day bucket covers at least 7 but fewer than 14. The 14 plus bucket covers 14 days or more. Anything fewer than 3 days overdue is left alone entirely. Expose the three thresholds as workflow inputs so they can be retuned without editing logic.

Send one templated reminder per invoice with LeadConnector Send Message to the invoice's contact. Use a fixed template per bucket with progressively firmer wording: the 3 day message is a light friendly nudge that assumes it was simply missed, the 7 day message is a direct request for payment with a clear ask, and the 14 plus message is firm and states that the account is significantly past due and asks them to pay or come back with a date. Every message, regardless of bucket, must include the invoice number, the amount outstanding with its currency, and the original due date. Make the reminder channel a workflow input that switches between SMS and Email, since LeadConnector Send Message supports both, and default it to SMS.

After each successful send, append one row to my collections log with Google Sheets Append Values, capturing the run date, the contact name, the invoice number, the amount, and the bucket. Append immediately after each send rather than batching at the end, so that a mid-run failure cannot cause a reminder to be sent without being logged, which would break the one per day rule on the next run. Take the spreadsheet id and the tab name as workflow inputs.

Finish with a single summary posted to my finance channel using Slack Send a Message. It should show one line per bucket with the number of invoices chased and the total dollar value outstanding in that bucket, plus an overall total across all three. Post the summary even when nothing was sent, saying so plainly, so a silent morning reads as a healthy receivables book rather than a broken workflow. Take the Slack channel as a workflow input.

If a contact has no reachable phone number or email for the chosen channel, or a send fails, skip that invoice, leave it unlogged so it is retried tomorrow, and note the count of skipped invoices at the end of the Slack summary.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats