Finance & Accounting

How to automate accounts receivable collections

The short answer

To automate accounts receivable collections, sync open invoices from QuickBooks Online, Xero or Stripe each morning, send reminders on a cadence set by customer segment and days past due, use AI to draft messages that reference the customer's actual invoices and history, and classify every reply as paid, promise to pay, dispute or wrong contact. Each send re-checks the balance first, and strategic accounts escalate to a person instead of getting another email.

What this automation does

Collections becomes a daily routine that runs itself, and your people only handle the conversations that need a human.

  1. Sync open AR. Every morning, the workflow pulls open invoices, balances, due dates and customer contacts from QuickBooks Online, Xero or Stripe.
  2. Decide who gets what. A cadence table maps customer segment and days past due to an action, such as a friendly reminder, a firmer follow-up with a statement, a task for the account owner, or a hold flag for operations.
  3. Draft the message. For email steps, an LLM drafts a short message that lists the customer’s open invoices, amounts and due dates, includes a payment link, and adjusts tone for the stage and any recent reply.
  4. Check, then send. Right before sending, the workflow re-reads each invoice balance and skips anything paid, credited or under dispute. It sends from a real AR mailbox, not a no-reply address.
  5. Read the replies. Incoming replies are classified as paid with remittance, promise to pay with a date, dispute with a reason, request for a copy or W-9, wrong contact, or out-of-office. Each category triggers its own next step.
  6. Log everything. Each touch, reply and promise is logged against the customer, and summaries appear in HubSpot or your CRM so sales sees what finance sees.

When it is worth building

It pays off when your AR is large enough that following up consistently is a job nobody has time for. Common symptoms are invoices that pass 60 days before anyone notices, a founder chasing payments personally, and customers who reply with questions that sit unanswered for a week.

If you have fewer than 30 open invoices and mostly prompt payers, turn on the reminders in your accounting system and stop there. If most revenue comes from cards on file through Stripe, its own failed-payment retries and emails handle much of the problem. Build the custom workflow when you have a mix of customer types that need different treatment, replies that need routing, or a sales team that needs to know before finance escalates a key account.

Architecture

LayerWhat we useWhy
AR sourceQuickBooks Online or Xero through n8n’s built-in nodes, or Stripe invoices through its API using n8n’s HTTP Request nodeBalances must come from the system that records payments
Cadence rulesA table of segment, days past due, channel and actionFinance controls the playbook without editing the workflow
DraftingClaude Sonnet 5.5 or OpenAI’s GPT models with a fixed style guideMessages that reference real invoices read as personal, not robotic
SendingGmail or Outlook from a shared AR mailboxReplies land where AR can see them, and deliverability follows your domain setup
Reply handlingAn LLM classifier with a fixed set of labels and extracted fields such as promise dateTurns free-text replies into actions and data
CRM syncHubSpot or Salesforce notes and tasksAccount owners see collection status before their next call

How to build it

  1. Segment customers. Start with three groups, such as key accounts, standard and small balance. Key accounts get owner tasks instead of automated escalation.
  2. Write the cadence. For each segment, define the action at a handful of points relative to due date. Keep the first message friendly and include the invoice PDF and a payment link.
  3. Write the style guide. A half page on tone, sign-off, what the message may and may not say, and banned content such as fee threats you do not actually enforce.
  4. Build the daily run. Pull open AR, apply the cadence, create drafts, run the pre-send balance check, and send. Log every action with the invoice IDs it covered.
  5. Build the reply classifier. Watch the AR mailbox. For each reply, extract the label and any dates, amounts or invoice numbers. Promises set a follow-up for the day after the promised date. Disputes pause the sequence and create a task.
  6. Add approval for key accounts. For the first month, drafts for key accounts go to a person in Slack or email for one-click send or edit.
  7. Report weekly. A short summary of collected amounts, broken promises, open disputes and the oldest balances goes to the owner or controller.

The downloadable starter template below includes the daily AR pull, the cadence lookup, the pre-send balance check and the reply classifier to adapt to your own playbook.

What breaks in production

  • Unapplied payments. The customer paid yesterday, but the payment is not applied yet, and they get a reminder anyway. The reply pause and a check against recent bank deposits reduce this, but fast payment application in the ledger is the real fix.
  • Wrong contact. Invoices go to the buyer while the customer’s AP department pays. Capture the AP contact from “wrong person” replies and update the customer record.
  • Partial payments. The customer short-pays to dispute one line. Treat a balance that drops but does not clear as a signal to ask, not as a reason to escalate.
  • Auto-replies. Out-of-office and ticketing system replies get classified as real responses. Detect them by headers and phrasing and ignore them.
  • Batched invoices. A customer with twenty open invoices gets twenty emails. Group by customer and send one message per run with a statement attached.
  • Deliverability. A sudden jump in outbound email from a new mailbox lands in spam. Warm the mailbox, set up SPF, DKIM and DMARC, and keep daily volume steady.

Timeline and cost

One AR source with email collections typically takes two to three weeks. Lumeor builds it for $4,000 to $10,000, depending on the number of segments, whether reply handling covers disputes with routing to operations, and whether you want CRM sync. Model usage is small, roughly one draft per customer per step plus one call per reply. For a sense of ongoing model and hosting spend, see what it costs to run an AI agent each month. If your AR mailbox also receives vendor mail, support questions and spam, the shared inbox triage guide covers the broader classifier. Promise-to-pay data feeds directly into an AI-assisted cash flow forecast.

How to measure success

  • Days sales outstanding (DSO), measured monthly
  • Share of AR more than 60 and 90 days past due
  • Promise-to-pay kept rate, by segment
  • Replies handled without a person touching them
  • Median days to resolve a dispute once flagged
  • Hours per week spent on collections by finance staff

Free starter template

Import a working n8n workflow that implements the core of this guide, then adapt it to your systems.

Frequently asked questions

How is this different from the reminders built into QuickBooks or Xero?

The built-in reminders send the same message on a fixed schedule to everyone. That is fine for small balances. This workflow varies the cadence and tone by customer, reads and acts on replies, pauses for disputes, logs promises to pay, and hands key accounts to their owner instead of emailing them automatically.

Will AI-written reminders annoy our customers?

Less than generic ones, if the guardrails are right. The model drafts from a short approved style guide, references the exact invoices and amounts pulled from your system, and never invents late fees or threats. Early in the rollout, a person approves every draft for your top accounts.

What stops a reminder from going to a customer who already paid?

The workflow re-checks the invoice balance right before every send, not just when the sequence starts. It also pauses for a short window after any reply that mentions payment or remittance, because payments often arrive in the bank a day or two before anyone applies them in the ledger.

Can it text customers too?

It can, through Twilio, but treat SMS carefully. Texting usually needs documented consent, and consumer debt collection is subject to federal and state rules that do not apply in the same way to B2B invoices. Most B2B teams stick to email plus a phone task for the account owner. Ask counsel before adding SMS for consumer balances.

How does it affect our cash flow forecast?

Promises to pay are captured as structured data with a date and amount, and those dates are more accurate than due dates for forecasting. Feeding them into a cash forecast is one of the most useful side effects of the workflow.

Next steps