How to Automate Invoicing in Xero with n8n (2026 Guide)
Manual invoicing is one of the most expensive and easily automated processes in a professional services business. If your team is still manually creating invoices, entering line items and chasing payments by hand, this guide will show you exactly how to replace that with a system that runs itself.
We will walk through building a complete automated invoicing workflow using n8n and Xero's API: from trigger to invoice creation to payment chasing to Xero reconciliation.
What You Will Build
By the end of this guide, you will have a working n8n workflow that:
- Triggers automatically when a project is marked complete (or a contract is signed, or a date is reached)
- Creates an invoice in Xero with the correct client details, line items and payment terms
- Emails the invoice to the client from your Xero account
- Sends follow-up reminders at 7, 14 and 30 days if unpaid
- Stops chasing automatically when Xero registers a payment
Prerequisites
Before you start, you will need:
- An active Xero account with at least one contact and one invoice template
- An n8n instance (cloud or self-hosted — self-hosted recommended for data privacy)
- A Xero API app created in the Xero Developer Portal
- The trigger system you want to use (ClickUp, HubSpot, a Google Sheet, or a scheduled date)
Step 1: Connect n8n to Xero
Create Your Xero API App
- Log into the Xero Developer Portal
- Navigate to My Apps → New App
- Choose Web App as the app type
- Set the redirect URI to your n8n instance URL followed by
/rest/oauth2-credential/callback - Note your Client ID and Client Secret
Add Xero Credentials in n8n
- In n8n, go to Credentials → New Credential
- Select Xero OAuth2 API
- Enter your Client ID and Client Secret
- Click Connect and complete the OAuth authorisation flow
- Select the Xero organisation you want to connect
Step 2: Set Up Your Trigger
The trigger is what starts the invoicing workflow. The most common triggers are:
Option A: Project Completion in ClickUp
Use n8n's ClickUp trigger node. Configure it to fire when a task in your "Completed Projects" list changes status to "Done". The task name and custom fields will carry the client name and project details into your workflow.
Option B: Deal Close in HubSpot
Use n8n's HubSpot trigger. Configure it to fire on deal stage change to "Closed Won". Map the deal properties (company name, deal value, contact email) to variables for use in the invoice.
Option C: Schedule-Based (for recurring invoices)
Use n8n's Schedule trigger. Set it to run monthly on a specific date. Use a Xero node or a Google Sheet as a lookup to get the list of clients to invoice that cycle.
Option D: Manual Webhook
Create a webhook trigger in n8n and call it from any system using a simple HTTP request. The most flexible option if your trigger system has API access.
Step 3: Create the Invoice in Xero
Add a Xero node to your workflow and configure it with these settings:
- Resource: Invoices
- Operation: Create
- Type: ACCREC (accounts receivable — standard client invoice)
- Contact: Map from your trigger data (use the Xero node's lookup to find the contact by name or email)
- Line Items: Configure at least one line item with description, quantity and unit price
- Due Date: Set relative to invoice date (e.g.,
{{$today.plus(30, 'days')}}for 30-day terms) - Status: AUTHORISED (sends immediately) or DRAFT (for review before sending)
Pro tip: Use n8n's expression editor to populate line items dynamically from your trigger data. If your project tool stores the project deliverables and agreed price, you can pass these directly into the Xero line items.
Step 4: Send the Invoice to the Client
Xero can send invoices directly from your Xero account email, which keeps the client-facing communication consistent with your branding.
Add another Xero node:
- Resource: Invoices
- Operation: Email
- Invoice ID: Map from the previous create step
- To: Client email address from your trigger
- Subject: Customise using your brand (e.g., "Invoice from [Your Firm Name]")
- Message: Write a professional message body referencing the invoice number
Alternatively, if you want more control over the email design, use n8n's Email (SMTP) or SendGrid node to send the invoice PDF as an attachment.
Step 5: Build the Payment Chasing Sequence
This is where most implementations stop short — but the payment chase is often where the biggest time saving happens.
Create a Wait Node
After the invoice send step, add a Wait node configured to pause the workflow for 7 days.
Check Payment Status
After the wait, add a Xero node with:
- Resource: Invoices
- Operation: Get
- Invoice ID: From your earlier create step
This retrieves the current invoice status.
Add an IF Node
Add an IF node that checks: is invoice.status equal to PAID?
- True (Paid): End the workflow. No further action needed.
- False (Unpaid): Proceed to send the first reminder.
Send the First Reminder
Add an email node with a politely worded 7-day overdue reminder. Include the invoice number, amount and a direct payment link.
Repeat for 14 and 30 Days
After the first reminder, add another Wait node (7 more days), another status check, another IF node and another email. Then repeat for 30 days with an appropriately firmer tone.
At 30 days unpaid, you can also trigger a notification to a team member in Slack or Teams to take manual action.
Step 6: Test Your Workflow
Before going live, test thoroughly:
- Use a test contact in Xero (a fake client record) to avoid sending test invoices to real clients
- Use n8n's manual execution feature to trigger the workflow with test data
- Verify the invoice appears correctly formatted in Xero
- Check that the email arrives correctly with the right details
- Simulate a payment in Xero and verify the chase sequence stops
Common Issues and How to Fix Them
Invoice contact not found: Your trigger data must include either the Xero contact ID or a name/email that matches exactly. Add a lookup step before the create step to find the contact by email and extract their Xero contact ID.
Duplicate invoices on re-runs: Add a check at the start of your workflow that looks up whether an invoice already exists for this trigger event. Use Xero's reference field to store a unique identifier from your trigger system.
OAuth token expiry: n8n handles Xero OAuth refresh automatically, but if your n8n instance is offline for extended periods the token may expire. Set up monitoring on your n8n instance to catch workflow failures.
What This Workflow Saves
For a professional services firm raising 20 invoices per month, with manual invoicing taking approximately 15 minutes per invoice and payment chasing taking 30 minutes per overdue account (average 30% overdue):
- Invoice creation time saved: 5 hours/month
- Payment chasing time saved: 3 hours/month
- Total: 8 hours/month = 96 hours/year
At a $150/hour cost, that is $14,400 per year recovered from a single workflow.
Need This Built For You?
If you would rather have this implemented correctly the first time — tested, monitored, documented and connected to your specific tools — we can have it live within two weeks.
Book a Free Automation Roadmap Call →
Or view our Xero Automation Services →