Back to Blog
n8nXerointegrationautomationaccounting

n8n + Xero Integration: Automate Invoices, Reconciliation & Payroll

n8nautomation TeamApril 11, 2026
TL;DR: n8n connects directly to Xero's API, letting you automate invoice creation, bank reconciliation, expense tracking, and payroll notifications without writing code. This guide walks through five practical workflows with real node configurations you can build today.

The n8n Xero integration turns your accounting platform into an automated engine that creates invoices, chases payments, processes receipts, and keeps your team informed — all without manual data entry. If your finance team spends hours copying data between Xero and other tools, these workflows will give that time back.

Xero's API is well-documented and n8n supports it through both the dedicated Xero node and the HTTP Request node for endpoints the native node doesn't cover. Combined with n8n's 400+ other integrations, you can connect Xero to your CRM, project management tools, Slack, email, and AI services in a single workflow.

Why Automate Xero with n8n

Xero handles accounting well, but it doesn't talk to your other tools without help. Most teams end up with someone manually creating invoices from CRM deal closures, downloading bank statements to check for mismatches, or copying expense data from receipts into Xero line by line.

n8n sits between Xero and everything else. It watches for triggers — a deal closing in HubSpot, a new receipt uploaded to Google Drive, an overdue invoice hitting 30 days — and executes the right action in Xero automatically. Unlike Zapier or Make, n8n gives you unlimited executions with no per-task pricing, which matters when you're processing hundreds of transactions monthly.

With a managed instance on n8nautomation.cloud, you skip the server setup entirely and get a dedicated n8n environment running in minutes, starting at $15/month.

Connecting Xero to n8n

Before building workflows, you need to connect n8n to your Xero account using OAuth2. Here's the setup:

  1. Go to developer.xero.com and create a new app. Set the app type to Web app.
  2. Copy your Client ID and Client Secret from the Xero app dashboard.
  3. In n8n, go to Credentials > New Credential > Xero OAuth2 API.
  4. Paste the Client ID and Client Secret. n8n will generate a Redirect URI — copy this back into your Xero app's redirect URI field.
  5. Click Connect my account and authorize n8n in the Xero consent screen. Select the organization you want to connect.

Tip: Xero OAuth2 tokens expire after 30 minutes, but n8n handles token refresh automatically. If you see authentication errors after a long idle period, re-authorize the credential once and n8n will keep it fresh going forward.

Once connected, the Xero node gives you access to contacts, invoices, payments, bank transactions, credit notes, and more. For endpoints not covered by the native node — like reports or payroll — use the HTTP Request node with your Xero OAuth2 credential.

Workflow 1: Auto-Create Xero Invoices from CRM Deals

This is the highest-impact Xero automation for most teams. When a deal closes in your CRM, n8n automatically creates a draft invoice in Xero with the correct contact, line items, and due date.

Nodes used:

  • HubSpot Trigger (or Pipedrive/Salesforce Trigger) — fires when a deal stage changes to "Closed Won"
  • Xero node > Contact > Get — looks up the contact in Xero by company name or email
  • IF node — checks whether the contact exists
  • Xero node > Contact > Create — creates the contact if they're new
  • Xero node > Invoice > Create — creates the invoice with line items mapped from the deal

In the Invoice Create node, set the Type to ACCREC (accounts receivable), map the Contact ID from the previous lookup, and set line items using an expression that pulls the deal amount:

Line Items:
  Description: {{ $json.dealName }} - {{ $json.description }}
  Quantity: 1
  Unit Amount: {{ $json.amount }}
  Account Code: 200
  Tax Type: OUTPUT2

Set the Due Date using a Date & Time node to add your payment terms (e.g., 14 or 30 days from today). The invoice is created as Draft by default, so your finance team can review before sending — or set the status to AUTHORISED to send it automatically.

Workflow 2: Bank Reconciliation Alerts

Unreconciled transactions pile up fast. This workflow checks Xero daily for unreconciled bank transactions and sends a summary to Slack or email so your bookkeeper stays on top of them.

Nodes used:

  • Schedule Trigger — runs daily at 9 AM
  • HTTP Request node — calls the Xero BankTransactions endpoint with a Where filter: IsReconciled==false
  • Function node — aggregates the results: total count, total amount, oldest unreconciled date
  • IF node — only proceeds if unreconciled count is above your threshold (e.g., > 5)
  • Slack node — posts a formatted summary to your finance channel

The HTTP Request node calls https://api.xero.com/api.xro/2.0/BankTransactions with the header Xero-Tenant-Id set to your organization ID. Use the Xero OAuth2 credential for authentication. The Where parameter filters for unreconciled items, and you can add order=Date to sort by oldest first.

Your Slack message might look like: "You have 12 unreconciled transactions totaling $4,320.50. Oldest: March 28. Time to reconcile!"

Workflow 3: Expense Receipt Processing with AI

This workflow uses AI to extract data from receipt photos and create expense claims in Xero automatically. Team members upload receipts to a shared Google Drive folder (or email them to a dedicated address), and n8n handles the rest.

Nodes used:

  • Google Drive Trigger — watches a "Receipts" folder for new files
  • Google Drive node > Download — downloads the receipt image
  • OpenAI node (GPT-4 Vision) — extracts vendor name, date, total amount, tax amount, and category from the receipt image
  • Xero node > Contact > Get or Create — finds or creates the vendor contact
  • HTTP Request node — creates a bill (ACCPAY invoice) in Xero with the extracted data

The OpenAI node prompt should be specific: "Extract the following from this receipt image and return as JSON: vendor_name, date (YYYY-MM-DD), subtotal, tax_amount, total, currency, category (one of: Travel, Meals, Office Supplies, Software, Other)." GPT-4 Vision handles most printed receipts reliably, though handwritten ones can be hit-or-miss.

Note: Always validate AI-extracted amounts before posting to Xero. Add an IF node to flag receipts where the extracted total doesn't match subtotal + tax, and route those to a manual review queue instead.

Workflow 4: Overdue Invoice Chaser

Late payments hurt cash flow. This n8n workflow with Xero checks for overdue invoices and automatically sends reminder emails at intervals you define — 7 days overdue, 14 days, and 30 days, each with a progressively firmer tone.

Nodes used:

  • Schedule Trigger — runs daily
  • Xero node > Invoice > Get All — fetches invoices with status AUTHORISED and DueDate before today
  • Function node — calculates days overdue and assigns a reminder tier (gentle, firm, final)
  • Switch node — routes to different email templates based on the tier
  • Send Email node (or Gmail node) — sends the appropriate reminder with invoice details and a Xero payment link

To avoid spamming clients with daily reminders, use n8n's built-in static data to track which invoices you've already emailed and when. Store the invoice ID and last reminder date, then skip any invoice that received a reminder within the last 7 days.

Include the Xero online payment link in your email. If you've enabled Xero's online payment feature, the OnlineInvoiceUrl field on the invoice object gives you a direct link where clients can pay immediately.

Workflow 5: Payroll Run Notifications

If you use Xero Payroll (available in AU, NZ, and UK), you can automate notifications around pay runs. This workflow alerts managers when a pay run is posted and sends employees a Slack DM with their pay summary.

Nodes used:

  • Schedule Trigger — runs on your payroll processing day
  • HTTP Request node — calls the Xero Payroll API (https://api.xero.com/payroll.xro/2.0/PayRuns) to get the latest pay run
  • IF node — checks if the pay run status is POSTED
  • HTTP Request node — fetches pay slips for the pay run
  • Split In Batches node — processes each employee's pay slip
  • Slack node — sends a DM to each employee with their gross pay, deductions, and net pay

The Payroll API uses a different base URL from the standard Xero API, but the same OAuth2 credential works — just make sure you requested the payroll.employees and payroll.payruns scopes when setting up your Xero app.

Tips for Reliable Xero Workflows

After building your workflows, keep these practical considerations in mind:

  • Rate limits: Xero allows 60 API calls per minute per tenant. If you're processing bulk transactions, add a Wait node (1-2 seconds) between batched API calls to stay under the limit. The Split In Batches node with a batch size of 10 works well.
  • Multi-currency: If you work with multiple currencies, always set the CurrencyCode field explicitly on invoices and bills. Xero defaults to your base currency, which can cause reconciliation headaches.
  • Idempotency: Use Xero's InvoiceNumber field as a deduplication key. Set it to something deterministic like DEAL-{{ $json.dealId }} so re-running a workflow doesn't create duplicate invoices.
  • Error handling: Add an Error Trigger workflow that catches Xero API errors (especially 400 and 429 responses) and routes them to a Slack channel or email. Xero's error messages are descriptive — they'll tell you exactly which field validation failed.
  • Sandbox testing: Xero offers a free Demo Company for testing. Connect n8n to the demo org first, run your workflows against test data, and switch to your live org only when everything works.

Tip: Running these workflows on a managed n8n instance at n8nautomation.cloud means your Xero automations run 24/7 with automatic backups — no risk of a missed invoice because your server went down overnight.

These five workflows cover the most common Xero automation needs, but they're just starting points. You can extend them — add approval steps before invoices are authorized, sync Xero contacts with your CRM bidirectionally, or generate monthly P&L reports and email them to stakeholders. With n8n's visual builder and Xero's comprehensive API, the only limit is what your accounting process requires.

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.