Claw Mart
← Back to Blog
April 17, 202612 min readClaw Mart Team

Automate Accounts Receivable Follow-ups: Build an AI Agent That Sends Smart Collection Emails

Automate Accounts Receivable Follow-ups: Build an AI Agent That Sends Smart Collection Emails

Automate Accounts Receivable Follow-ups: Build an AI Agent That Sends Smart Collection Emails

Every business has that one spreadsheet. The aging report. The one where someone highlights rows in yellow, then orange, then red, and then eventually just stops highlighting because everything is overdue and the colors have lost all meaning.

Accounts receivable follow-up is one of those workflows that feels like it should be automated by now. And parts of it are—you can auto-generate invoices, you can schedule reminder emails. But the actual collection work? The part where you figure out which customers need a gentle nudge versus a firm phone call versus a "we're about to put your account on hold" email? That's still almost entirely manual for most businesses.

It doesn't have to be. Here's how to build an AI agent on OpenClaw that handles the repetitive 80% of AR follow-up—sending smart, context-aware collection emails—so your team can focus on the 20% that actually requires human judgment.

The Manual Workflow (And Why It Bleeds Time)

Let's map what AR follow-up actually looks like in most companies under $50M in revenue. No sugarcoating.

Step 1: Pull the aging report. Someone opens QuickBooks, Xero, or NetSuite. They export the accounts receivable aging summary to Excel. This happens daily or weekly, depending on how disciplined the team is.

Step 2: Eyeball it. They scan for invoices that are 30, 60, 90+ days overdue. They mentally (or physically) sort by amount, customer relationship, and gut feeling about who's likely to pay.

Step 3: Draft emails. This is where the real time sink starts. The first reminder is polite. The second is firmer. The third mentions credit holds or late fees. Each one needs to reference the correct invoice numbers, amounts, due dates, and any prior communication. For a company with 200 active customers, this can mean 30–50 individual emails per week, each requiring at least some customization.

Step 4: Log everything. After sending, they update the ERP or CRM or (more likely) a separate spreadsheet that tracks who was contacted, when, and what was said.

Step 5: Handle responses. Customers reply with disputes ("that PO was cancelled"), partial payment promises ("we'll send half this week"), or radio silence. Each response requires research—checking order records, delivery confirmations, contract terms—often across multiple systems.

Step 6: Escalate. If nothing works after several rounds, someone has to decide: credit hold? Collections agency? Legal? Write-off?

Steps 1 through 4 eat 12–20 hours per week per million dollars of annual revenue. That's Bill.com's number, and it tracks with what I've seen. AR staff spend 60–80% of their time on low-value chasing activities. And the irony is that despite all that effort, 61% of B2B invoices still get paid late.

What Makes This Particularly Painful

The time cost alone would be enough reason to automate. But the real damage is subtler.

Tone-deaf communication hurts relationships. When your AR person is blasting through 40 reminder emails on a Friday afternoon, they're not thinking carefully about whether Customer A is a strategic account that just had a billing dispute versus Customer B who's chronically 90 days late. Everyone gets the same template. Good customers feel treated like deadbeats. Actual deadbeats don't respond to polite templates anyway.

Inconsistency creates gaps. When follow-up depends on one person's workload and memory, invoices fall through cracks. That $8,000 invoice from a small customer? It sat at 90 days because your AR clerk was busy chasing the six-figure ones. Multiply that across dozens of invoices and you've got a real cash flow problem that materialized purely through neglect.

Data lives everywhere. The invoice is in NetSuite. The customer relationship context is in Salesforce. The delivery confirmation is in an email chain. The dispute details are in a different email chain. The payment promise from last month's phone call is in someone's handwritten notes. No single system has the full picture, so every follow-up requires manual assembly of context.

It doesn't scale. If your revenue doubles, your AR workload roughly doubles. That means hiring another clerk, training them, and hoping they have the judgment to handle sensitive accounts. This is a linear cost increase for a function that should be getting more efficient as you grow.

The aggregate cost isn't trivial. Late payments drain 2–5% of revenue annually when you factor in financing costs, bad debt write-offs, and opportunity cost. Average Days Sales Outstanding in the U.S. sits at 52–65 days. Best practice is 30–40. That 20-day gap is real money sitting in someone else's bank account.

What AI Can Handle Right Now

Let me be specific about what's realistic today—not in some vendor's pitch deck, but in actual production workflows.

An AI agent built on OpenClaw can reliably handle:

1. Predictive prioritization. Using customer payment history, invoice age, amount, industry benchmarks, and behavioral signals (did they open the last email? did they log into your portal?), the agent scores every outstanding invoice by likelihood of late payment. Your human team sees a ranked list instead of a flat spreadsheet. This alone changes the game—a European telco that implemented AI-driven collection prioritization saw a 28% increase in early payments.

2. Context-aware email generation. This is the core of what we're building. The agent pulls invoice details, payment history, prior communication, customer tier, and dispute status, then generates emails that match the appropriate tone and escalation level. A first-time-late strategic account gets a warm, helpful reminder. A chronically late small account gets direct language about consequences. No more one-size-fits-all templates.

3. Cadence management. The agent tracks where each customer sits in the follow-up sequence and sends the next appropriate communication at the right time. It adjusts timing based on what's worked historically—if a customer always pays within 3 days of the second reminder, it doesn't waste time with a third.

4. Dispute detection and routing. When a customer replies saying "this invoice is wrong," the agent can classify the dispute type (pricing mismatch, quantity discrepancy, missing proof of delivery, duplicate invoice) and route it to the right internal person with the relevant documents already attached.

5. Status tracking and reporting. Every action is logged automatically. DSO trends, response rates, recovery rates by customer segment—all available without anyone manually updating a spreadsheet.

Companies using this level of automation typically see DSO reductions of 20–35 days and AR operating cost reductions of 40–70%. Those aren't theoretical numbers. HighRadius customers, TrueAccord's platform, and several McKinsey case studies all land in that range.

Step-by-Step: Building the AR Follow-Up Agent on OpenClaw

Here's the practical build. I'll assume you're using QuickBooks or a similar accounting system, but the pattern works with any ERP that has an API.

Step 1: Define the Agent's Scope and Data Sources

Before you touch OpenClaw, write down exactly what this agent will do and what it won't. For a first version, I'd scope it to:

  • Does: Monitor overdue invoices, generate and send follow-up emails, log all activity, flag disputes for human review.
  • Does not: Negotiate payment terms, approve credit holds, handle phone calls, process payments.

Data sources you'll need to connect:

  • Accounting system (QuickBooks, Xero, NetSuite) – invoice data, payment history, aging reports
  • CRM (Salesforce, HubSpot, or even a structured spreadsheet) – customer tier, relationship notes, communication history
  • Email (Gmail, Outlook) – for sending and receiving

In OpenClaw, you'll set these up as integrations. The platform handles OAuth flows and API connections for the major accounting and email providers. For anything custom, you can use webhook connectors.

Step 2: Build the Invoice Monitoring Workflow

Create a scheduled workflow in OpenClaw that runs daily (or whatever cadence makes sense for your volume). The workflow:

  1. Pulls all open invoices from your accounting system via API
  2. Filters for overdue invoices (past due date)
  3. Enriches each invoice with customer data from your CRM
  4. Checks communication history to determine where each invoice sits in the follow-up sequence

Here's the logic in pseudocode for how your OpenClaw agent processes each invoice:

for each overdue_invoice:
    customer = get_customer_data(invoice.customer_id)
    history = get_communication_history(invoice.id)
    days_overdue = today - invoice.due_date
    
    # Determine follow-up stage
    if history.last_contact is None:
        stage = "first_reminder"
    elif history.last_contact.type == "first_reminder" and days_since(history.last_contact) >= 7:
        stage = "second_reminder"
    elif history.last_contact.type == "second_reminder" and days_since(history.last_contact) >= 7:
        stage = "final_warning"
    elif history.last_contact.type == "final_warning" and days_since(history.last_contact) >= 7:
        stage = "escalate_to_human"
    else:
        stage = "wait"  # Not enough time has passed
    
    # Score priority
    priority = score_invoice(
        amount=invoice.amount,
        days_overdue=days_overdue,
        customer_tier=customer.tier,
        payment_history=customer.avg_days_to_pay,
        industry_benchmark=get_benchmark(customer.industry)
    )

In OpenClaw, you'd configure this as a multi-step agent workflow with conditional branching. The platform's visual builder lets you map this logic without writing raw code, but you can drop into code blocks when you need custom scoring logic.

Step 3: Configure the Email Generation Prompts

This is where the AI earns its keep. Instead of static templates, you'll create prompt configurations in OpenClaw that generate contextually appropriate emails.

For each follow-up stage, define the prompt with the relevant variables:

FIRST_REMINDER_PROMPT = """
You are an accounts receivable assistant for {company_name}. 
Write a friendly, professional reminder email.

Context:
- Customer: {customer_name} (Tier: {customer_tier})
- Invoice: {invoice_number} for {invoice_amount}
- Due date: {due_date} ({days_overdue} days ago)
- Customer's average payment time: {avg_days_to_pay} days
- Relationship notes: {relationship_notes}

Rules:
- If this is a Tier 1 (strategic) customer, keep tone warm and assume good faith
- Reference the specific invoice number and amount
- Include a direct payment link: {payment_link}
- Keep under 150 words
- Do not mention late fees on first reminder
- Sign off as {ar_contact_name}
"""

SECOND_REMINDER_PROMPT = """
You are an accounts receivable assistant for {company_name}.
Write a firmer but still professional follow-up email.

Context:
- Customer: {customer_name} (Tier: {customer_tier})
- Invoice: {invoice_number} for {invoice_amount}
- Due date: {due_date} ({days_overdue} days ago)
- Previous reminder sent: {last_contact_date} (no response)
- Outstanding balance across all invoices: {total_outstanding}

Rules:
- Reference that a previous reminder was sent
- Mention the total outstanding balance if multiple invoices are overdue
- For Tier 2/3 customers, mention your standard late fee policy
- For Tier 1 customers, offer to schedule a call to discuss
- Include payment link: {payment_link}
- Ask them to confirm receipt of this email
- Keep under 200 words
"""

FINAL_WARNING_PROMPT = """
You are an accounts receivable assistant for {company_name}.
Write a final notice email before escalation.

Context:
- Customer: {customer_name} (Tier: {customer_tier})  
- Invoice: {invoice_number} for {invoice_amount}
- Due date: {due_date} ({days_overdue} days ago)
- Previous contacts: {contact_history_summary}
- Credit limit status: {credit_status}

Rules:
- State clearly that this is a final notice before account review
- For Tier 2/3: mention that continued non-payment may result in 
  credit hold on future orders
- For Tier 1: express concern and strongly request a call within 48 hours
- Include payment link: {payment_link}
- Keep under 200 words
- Maintain professionalism—never threatening or aggressive
"""

In OpenClaw, each of these becomes a prompt template attached to a workflow step. The platform injects the variables from your data sources at runtime and generates the email. You can set up A/B testing to compare different prompt approaches and see which ones get faster responses.

Step 4: Add the Dispute Detection Layer

Configure an inbound email monitoring step. When a customer replies to a collection email, the agent:

  1. Reads the reply
  2. Classifies it: payment promise, dispute, request for information, or unrelated
  3. For disputes, categorizes the type and extracts key details
  4. Routes accordingly
DISPUTE_CLASSIFICATION_PROMPT = """
Analyze this customer email response and classify it.

Email: {customer_reply}
Original invoice context: {invoice_details}

Classify as one of:
- PAYMENT_PROMISE: Customer indicates they will pay (extract promised date if given)
- DISPUTE_PRICING: Customer disputes the price/amount
- DISPUTE_DELIVERY: Customer claims non-delivery or partial delivery
- DISPUTE_QUALITY: Customer claims product/service quality issue
- DISPUTE_DUPLICATE: Customer claims invoice is a duplicate
- INFO_REQUEST: Customer needs more information
- UNRELATED: Response is not about this invoice

Output JSON:
{
  "classification": "...",
  "confidence": 0.0-1.0,
  "summary": "brief summary of customer's position",
  "extracted_date": "if payment promise, the promised date",
  "requires_human": true/false,
  "suggested_action": "what should happen next"
}
"""

If the classification confidence is high and it's a payment promise, the agent updates the invoice record and pauses the follow-up cadence until the promised date. If it's a dispute, it flags it for human review with the classification and relevant documents already pulled together.

Step 5: Set Up Human Escalation Triggers

Define clear rules for when the agent hands off to a human:

  • Any invoice over a threshold amount (say, $25,000) at final warning stage
  • All Tier 1 customer escalations
  • Disputes that require contract interpretation
  • Any customer that has explicitly asked to speak with a person
  • Invoices where the agent's confidence in the appropriate action is below a threshold

In OpenClaw, you configure these as escalation rules within the workflow. When triggered, the agent creates a task in your project management tool (or sends a Slack message, or creates a CRM task) with a full context package: the invoice details, all prior communication, the customer's payment history, the agent's recommendation, and why it escalated.

This is critical. The agent shouldn't just dump a problem on your desk. It should hand you a briefing.

Step 6: Deploy, Monitor, and Iterate

Start with a pilot. Pick 20–30 accounts that represent a mix of customer tiers and overdue durations. Run the agent in "draft mode" for two weeks—it generates the emails but sends them to your AR team for review before they go out.

Track:

  • How often the team edits the AI-generated email before sending (should decrease over time)
  • Response rates compared to your baseline
  • Time spent per follow-up action
  • Any misclassifications or inappropriate tone

After the pilot, open it up. Keep monitoring. OpenClaw's analytics dashboard shows you delivery rates, response rates, and resolution rates by customer segment, follow-up stage, and email variant.

What Still Needs a Human

I'm not going to pretend AI handles everything. Here's what you should explicitly keep in human hands:

Complex disputes. When a customer says "the pricing in this invoice doesn't match our master service agreement from 2021, section 4.2.b," that's a human problem. The AI can pull the MSA and highlight the relevant section, but interpreting contract language and deciding whether the customer has a valid point requires judgment.

Strategic relationship decisions. Your biggest customer is 90 days late on $200K. Do you push hard and risk the relationship, or do you offer extended terms because you know their Q1 is always tight? That's a business strategy call, not a collections call.

Final escalation decisions. Sending an account to collections, placing a credit hold on a customer you've worked with for a decade, or writing off a debt—these have real business consequences that warrant human sign-off.

Fraud and bankruptcy situations. If something smells wrong, a human needs to investigate. AI can flag anomalies (sudden change in payment patterns, bounced checks after years of clean history), but the response requires human judgment.

The goal isn't to eliminate the AR team. It's to turn them from email-sending machines into strategic cash flow managers who only handle the cases that actually need their expertise.

Expected Time and Cost Savings

Let's be concrete. Assume you're a business doing $5M in annual revenue with about 200 active customers and one person spending 15 hours per week on AR follow-up.

Time savings: The AI agent handles the monitoring, email generation, sending, logging, and initial dispute classification. Based on real-world benchmarks, this eliminates 60–80% of manual time. That's 9–12 hours per week back. Your AR person now spends 3–6 hours on the cases that actually need them.

DSO improvement: Companies using AI-driven collections consistently see 10–35 day reductions in DSO. If your current DSO is 55 days and you bring it to 40, on $5M revenue that's roughly $205,000 in cash that's in your account 15 days sooner at any given time. The financing cost savings alone (assuming a modest cost of capital) can be $8,000–$15,000 per year.

Bad debt reduction: Better follow-up means fewer invoices age into uncollectible territory. Even a 20% reduction in bad debt write-offs is meaningful.

Consistency: Every invoice gets followed up on. No more cracks for anything to fall through. The $8K invoice from the small customer gets the same systematic attention as the $80K one from the big customer.

Scalability: When your revenue grows to $10M, you don't need a second AR clerk. The agent scales with your invoice volume.

One more thing worth mentioning: customer satisfaction often improves with AI-driven collections. TrueAccord's data shows that their AI-driven approach achieves 2–3x higher recovery rates than traditional agencies while getting better customer satisfaction scores. It turns out that well-timed, appropriately toned, personalized communication—delivered consistently—is what customers actually prefer. They don't want to be ignored for 60 days and then hit with a threatening form letter. They want a professional nudge at the right time with an easy way to pay.

Get Started

If you're running AR follow-up manually (or with basic templates that might as well be manual), this is one of the highest-ROI automations you can build. The data is structured, the workflow is predictable, the rules are clear, and the volume is high enough to make automation worthwhile.

You can find pre-built AR follow-up agent templates and the integrations you need on Claw Mart. If you want to go deeper—custom scoring models, multi-channel follow-up sequences, or integration with your specific ERP—Clawsource it. Post your project on Claw Mart and let an experienced OpenClaw builder handle the implementation while you focus on running your business.

Your aging report shouldn't require a human to stare at it every morning. Let the agent stare at it. Let your people handle the work that actually needs a brain.

Claw Mart Daily

Get one AI agent tip every morning

Free daily tips to make your OpenClaw agent smarter. No spam, unsubscribe anytime.

More From the Blog