name: ar-followup description: Scan overdue invoices, classify by aging bucket, create action cards, and draft dunning emails for the user to review and send
AR Follow-up
When to Use
- User uploads an AR aging CSV
- User asks about overdue invoices or collections
- Proactive AR scan triggered by user (Scan AR button)
Process
- Scan invoices — Call
scan_ar_agingwith the relevantdataSourceId(or omit to scan all) - Classify by bucket — Invoices are automatically bucketed:
- Critical (45+ days overdue): Escalation tone
- Warning (15-44 days): Firm tone
- Info (1-14 days): Friendly tone
- Create actions — Batch-create via
create_ar_actionswith one action per eligible invoice. Include:- Headline: customer name + invoice number + days overdue
- Detail: amount, due date, aging bucket
- Driver: "overdue receivable" + bucket context
- Severity: matches the bucket (critical/warning/info)
- Draft emails — For each newly-created action, call
draft_dunning_emailwith the bucket-appropriate tone - Summarize — Lead with total overdue balance, then top 3 items by amount. Keep under 150 words.
Output Format
- Dollar amounts as
$X.XK - Days overdue as
(N days overdue) - One headline per bucket at most
- Offer to let the user review and send drafts