Automate Your Invoice Follow-Ups With AI: Step-by-Step

Introduction

Chasing unpaid invoices is one of the most time-consuming — and awkward — parts of running a small business. This tutorial walks you through setting up an automated system that monitors your Xero invoices, detects when a payment is overdue, and sends a personalized follow-up email written by AI. Once it’s running, you won’t need to think about it again.

What you’ll end up with: An automated workflow that checks for overdue invoices in Xero and sends your client a professional, friendly follow-up email — written fresh by AI each time, so it never sounds like a form letter.

Time to complete: About 45–60 minutes, spread across three tools. No coding required.


What You’ll Need

Before you start, make sure you have the following in place:

  • A Xero account with at least one active invoice (free trial works fine for testing)
  • A Zapier account — the free plan works to start, but the two-step automation here requires Zapier’s Starter plan (~$20/month). Alternatively, you can use Make (formerly Integromat) on their free tier
  • An OpenAI account with API access — you’ll need a paid account (usage is billed per message; expect less than $1/month for a small business)
  • A Gmail or Outlook account connected to Zapier for sending emails
  • About 10 minutes of uninterrupted focus for each phase below

Step-by-Step Setup

Phase 1: Connect Xero to Zapier (10 minutes)

  1. Log in to Zapier and click the orange + Create button in the top left, then select Zaps.

  2. In the trigger search box, type Xero and select it. Under Trigger Event, choose Invoice Updated.

  3. Click Sign in to Xero and follow the prompts to authorize Zapier. Select your Xero organization when asked.

  4. Click Test trigger. Zapier will pull in a recent invoice from your account — you should see fields like Contact Name, Invoice Number, Amount Due, and Due Date appear. If nothing shows, log into Xero and make sure at least one invoice exists.

  5. Click Continue to move to the filter step.

Phase 2: Add a Filter So It Only Fires on Overdue Invoices (5 minutes)

  1. Click the + button below your trigger and search for Filter (it’s a built-in Zapier tool, not a separate app).

  2. Set the filter logic as follows:

    • Field: Status(Text) Exactly matchesOVERDUE
    • Click + AND to add a second condition
    • Field: Amount Due(Number) Greater than0
  3. Click Continue. Zapier will check your test invoice against these conditions. If it passes, you’ll see “Your Zap would have continued.” If not, that’s fine — the logic is still correct; the test invoice just isn’t overdue.

Phase 3: Generate the Follow-Up Email With OpenAI (15 minutes)

  1. Click + and search for OpenAI. Select it, then choose the action Send Prompt (you may see this labeled as ChatGPT in some plan tiers — either works).

  2. Click Sign in to OpenAI. You’ll be asked for your API Key. To get this: open a new tab, go to platform.openai.com, click your profile in the top right → API keysCreate new secret key. Copy the key and paste it into Zapier.

  3. In the Model field, select gpt-4o (or gpt-4o-mini if you want lower cost — both work well here).

  4. In the Prompt field, paste the following — then use Zapier’s blue + insert button to swap in the dynamic values from your Xero data where indicated:

    Write a short, friendly payment reminder email to [Contact Name] about invoice [Invoice Number] for [Amount Due] that was due on [Due Date]. The tone should be professional but warm — not threatening. Keep it under 120 words. Include a closing line asking them to reach out if they have any questions.
    

    Replace each [bracket] by clicking the blue + and selecting the matching Xero field.

  5. Leave Max Tokens at 300. Click Test action — within a few seconds you should see a complete email draft appear in the results panel. Read it over. If it sounds off, adjust the wording of your prompt and test again.

Phase 4: Send the Email (10 minutes)

  1. Click + and search for Gmail (or Outlook — steps are nearly identical). Choose the action Send Email.

  2. Connect your email account if you haven’t already.

  3. Fill in the fields:

    • To: Insert the Email field from Xero (click the blue + to find it — it may be nested under Contact)
    • Subject: Type: Quick note about Invoice then insert the Invoice Number field
    • Body: Insert the Response field from your OpenAI step — this is the AI-written email text
    • From Name: Type your business name
  4. Click Test action. Check your sent mail folder — you should see the email with the AI-generated body.

  5. Click Publish Zap. Toggle it to On.


Testing It Works

  1. In Xero, open an existing invoice and manually change its status to Overdue (or create a dummy invoice with a past due date).

  2. Back in Zapier, open your Zap and click Run Zap to trigger it manually without waiting for the scheduled poll.

  3. Check the target email inbox within 2 minutes. You should receive a personalized follow-up email. Verify that the client name, invoice number, and amount are all correctly populated.

  4. Once confirmed, change your test invoice back to its original status in Xero.


Troubleshooting

“My Zap triggers but no email is sent”

This usually means the filter in Phase 2 is blocking the action. Open your Zap’s Task History (left sidebar in Zapier), find the recent run, and look for a step marked Filtered. Check that your Xero invoice status is exactly OVERDUE — it’s case-sensitive.

“OpenAI returns an error: insufficient quota”

Your OpenAI account needs a payment method added and a small credit balance. Log in to platform.openai.com, go to Settings → Billing, and add a card. A $5 credit will last months for this use case.

“The email goes to the wrong person (or no one)”

Xero stores contact emails in a nested field that Zapier sometimes labels as Email Address (Contact). In your Gmail step, click the To field, remove whatever’s there, click the blue +, and scroll through the Xero fields until you find one that contains an @ symbol in the sample data.


Next Steps

Once the basic flow is running reliably for a week, add a delay step between the filter and the OpenAI step. In Zapier, click +, search for Delay, and choose Delay For. Set it to 3 days. This prevents a follow-up from firing the moment an invoice ticks over to overdue — giving clients a small grace window before hearing from you. It takes two minutes to add and makes the whole system feel more human.