Daily AI dunning emails for Tabs overdue invoices

By General Input

Every morning, turn your overdue Tabs invoices into personalized Gmail recovery emails with tone matched to how late they are, and brief your finance team in Slack.

Integrations

  • Tabs
  • Gmail
  • Slack Bot

Type

Agentic Task

Categories

  • Finance
  • Operations

Build an agent workflow that runs an AI dunning sequence on Tabs overdue invoices every weekday at 8am local time. Trigger: cron.

Each run, the agent should:

1. Call Tabs List Invoices to get every invoice with overdue status. Tabs uses a filter query parameter with the syntax filter=fieldName||rule||value (supported rules include eq, neq, gt, gte, lt, lte, like, in, isnull, isnotnull). Filter on the invoice status field for the overdue value, and combine with a dueDate filter if needed by repeating the filter= parameter. Paginate through all pages (page-based, default limit 50; response envelope is payload.data with totalItems and currentPage).

2. For each overdue invoice, compute days past due from the due date and assign an aging bucket: 1 to 14 days = friendly nudge, 15 to 45 days = firmer reminder, 46+ days = escalation tone.

3. Call Tabs Get Customer for the invoice's customer to pull account details and the billing contact, and Tabs List Customer Contacts to confirm the billing contact email. Then call Tabs List Payments for that customer (filter by customer id) to read their payment history, so the email can reference whether they typically pay on time or have a pattern of late payments.

4. Before drafting, check whether this invoice has already been emailed in the last 5 days. The agent should look at its own send history (e.g. by searching the connected Gmail account's Sent mail for the invoice number in the past 5 days, or by tracking which invoices it has emailed in a small state store). If a match is found, skip the invoice.

5. Draft a tone-matched email per invoice. Always include the invoice number, the amount due, the original due date, and a clear next-step payment instruction. Match the tone to the aging bucket: friendly and conversational under 14 days, firmer and more direct between 15 and 45 days, escalation language with a clear consequence past 45 days. Reference the customer's payment pattern from Tabs Payments where relevant (e.g. acknowledge a usually-on-time payer, or note a repeated pattern of late payments).

6. Send each draft via Gmail Send a Message, to the billing contact email pulled from Tabs. Use a clear subject line that includes the invoice number so customer replies thread naturally in their inbox.

7. After all emails are sent, post a one-line summary to Slack in #finance-collections via Slack Bot Send a Message. The summary should list: total number of emails sent, breakdown by aging bucket, and the specific accounts that hit the 46+ day escalation tier so the finance team can follow up directly.

Important notes for the workflow author:

- Use the Tabs integration (apiKey credential) for all Tabs calls. Tabs auth header is Authorization: <apiKey> with no Bearer prefix.

- Use the Gmail integration (OAuth) to send the emails so they come from the user's own Gmail and replies land in their normal thread.

- Use the Slack Bot integration (not user OAuth) for the #finance-collections summary, since this is automated workspace output, not a person-authored message.

- Be defensive: if a customer has no billing contact email in Tabs, skip the invoice and include it in the Slack summary as needing a contact on file. If Tabs returns zero overdue invoices, still post a one-line Slack message saying everyone is current.

Related prompts

Explore more prompts
Win back LiveChat visitors whose chats went unansweredA brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seats