Accounts receivable triage workflow with NetSuite, Gmail, and Salesforce
Build an Accounts Receivable (AR) triage workflow for a finance team. Its job: automatically gather every open invoice, read the related email conversation to figure out what (if anything) needs action, attach who owns the customer, and present it all on a dashboard where the team can comment, set status, escalate, and export. Why: chasing unpaid invoices is manual and scattered — someone has to pull the invoice list, dig through the shared mailbox per invoice, work out whether there's a dispute / promise-to-pay / escalation / credit-note request, figure out who owns the account, and track it in a spreadsheet that goes stale. This workflow does the gathering and reading automatically and gives the team one live source of truth instead. Triggers: A manual "Run full check" / "Refresh" button on the dashboard (an HTTP route) that kicks off the pipeline asynchronously. A daily scheduled run (cron, e.g. early morning) that does a lightweight refresh. Support two modes: a full run that reads all mail and rebuilds the baseline, and a refresh run that only looks at recent mail and keeps prior summaries when nothing new is found. Main steps (high level): Fetch open invoices from the accounting/ERP system — pull unpaid, still-open invoices. Summarize per invoice — for each invoice, search the shared finance inbox for that invoice number, and use an LLM to produce a short summary flagging what needs action (or "nothing needed / dunning on track"). Use bounded concurrency and retries; a single failure shouldn't abort the run. Enrich with account ownership — match each customer to your CRM and attach the relevant owners (account owner, CSM/CSE, etc.) so it's clear who to chase. Dashboard (an HTTP webpage, space-authenticated) showing invoices with aging buckets, search/filter, the email summaries, and the run buttons. Each invoice has a comment thread and a status (e.g. Open / Needs action / Resolved) backed by an append-only audit trail stamped with the authenticated user. Include a shareable per-invoice detail page. Escalate — a button that spins up a chat channel with the selected owners (plus ad-hoc people and the requester) and links back to the invoice, logging the ask in the audit trail. Export on demand — let the user export the current list (client-side CSV, and/or a new timestamped tab in a spreadsheet). Keep the automatic run read-only against source systems; only write externally (spreadsheet, chat channel) when a person clicks. Store invoice results and run status in one persistent volume, and per-invoice comments/status in a separate one so commenting never blocks a run. For each integration, use my tools below or swap in your team's equivalent: pull invoices from NetSuite — or your ERP/accounting system; read mail from Gmail — or your shared inbox provider; summarize with Anthropic Claude — or another LLM; enrich from Salesforce — or your CRM; escalate via Slack — or your team's chat tool; export to Google Sheets — or your spreadsheet tool. Tools used: NetSuite (SuiteQL REST API), Gmail API, Anthropic Claude API, Salesforce API, Slack API, Google Sheets API
What this prompt builds
This workflow automates accounts receivable triage by pulling open invoices from NetSuite, summarizing related Gmail threads with Claude to flag what needs action, enriching each invoice with Salesforce ownership data, and presenting everything on a dashboard where finance teams can comment, set status, escalate via Slack, and export. It runs on demand and daily at 06:00, replacing manual inbox searches and stale spreadsheets with a single live source of truth. Finance teams save time by reading one-line summaries instead of hunting through email threads, while fewer invoices age unnoticed thanks to clear ownership, status tracking, and one-click escalation.
The problem
Finance teams chasing unpaid invoices face a manual, scattered process that quietly lets receivables age. To understand the status of any open invoice, someone must pull the invoice list from NetSuite, search through the shared Gmail inbox for that invoice number, read the thread to determine whether there's a dispute, payment promise, escalation, or credit request, identify who owns the customer relationship in Salesforce, and track everything in a spreadsheet that immediately goes stale. This workflow automates the entire triage process: it fetches open invoices via NetSuite SuiteQL, uses Claude to summarize each related Gmail thread and flag what needs attention, enriches every customer with Salesforce ownership data, and presents a live dashboard where the team can filter by aging buckets, read one-line summaries, leave comments with audit trails, update status, spin up Slack escalation channels with the right owners, and export snapshots to Google Sheets—refreshed automatically every morning and on demand.
Solution and impact
Finance and AR teams save hours previously spent opening and reading individual email threads—the workflow reads every invoice's correspondence in one automated pass and surfaces only what needs action. Fewer invoices quietly age because the dashboard provides a single, current view of collections status with summaries explaining why each invoice needs attention, ownership showing who to chase, and an append-only audit trail capturing what's been done. Account owners, CSMs, and CSEs are pulled in precisely when needed via one-click Slack escalation, eliminating delays from hunting down the right person. The dashboard replaces stale spreadsheets as the live source of truth, with on-demand exports for sharing snapshots rather than maintaining a separate working record.
