Free n8n template · Finance & Admin

Automate Supplier Invoice Data Entry into Xero with n8n and AI

This n8n workflow watches a Gmail label for supplier invoices, reads the text of each PDF, and uses an AI model to pull out the supplier, ABN, invoice number, dates, GST and line items. It checks the ABN and the totals, then creates a draft bill in Xero. Anything that fails a check, or comes from a supplier not yet in Xero, goes to a review tab and a Slack message instead. Nothing is approved or paid automatically.

Difficulty
Intermediate
Setup time
About 60 minutes
Nodes
14
Checked against
n8n 2.41
  • Gmail
  • Xero
  • OpenAI or Anthropic
  • Google Sheets
  • Slack

Last reviewed October 2026

Get the free workflow

Enter your email to copy the n8n workflow and paste it straight onto your canvas.

Free. No credentials included. Works with n8n Cloud and self-hosted n8n.

What this workflow does

Keying supplier invoices into Xero is slow, repetitive work. Someone opens each email, downloads the PDF, finds the supplier in Xero, types the invoice number, dates, amounts and GST, and hopes nothing was mistyped. In a busy month that is hours of data entry, and a single transposed digit in a total or a missed GST amount can throw out the BAS.

This template suits small businesses, bookkeepers and practices that receive most bills as PDF attachments. It does the reading and typing, then stops at a draft so the person who approves bills still sees every one in Xero. It is a starting point you can adapt, not a replacement for your approval process or for a review of the GST coding.

Who it's for

  • →Small business owners who enter their own supplier bills into Xero
  • →Bookkeepers managing accounts payable for several clients
  • →Finance or admin staff who receive invoices at a shared accounts inbox
  • →Practices that want a first draft in Xero but keep a person approving every bill

How it works, step by step

  1. 1

    Watch the invoices label in Gmail

    The Gmail trigger polls for new emails with a PDF attachment under a label such as supplier-invoices, and downloads the attachments so the workflow can read them.

  2. 2

    Split out each PDF attachment

    A Code node creates one item per PDF and keeps the sender, subject, received date and file name alongside it, so emails with several invoices are handled one invoice at a time.

  3. 3

    Read the PDF text

    The Extract from File node pulls the text layer out of each PDF. Most invoices generated by accounting software have one. Scanned images with no text are caught later by the confidence check.

  4. 4

    Extract the invoice fields with AI

    The Information Extractor node sends the text to your chat model with a fixed schema: supplier name, ABN, invoice number, invoice and due dates, currency, amount excluding GST, GST, total, line items and a confidence rating.

  5. 5

    Check the extraction

    A Code node validates the ABN with the official checksum, confirms the subtotal plus GST equals the total, flags GST that looks too high, foreign currency, credit notes, missing fields and anything the model was not confident about.

  6. 6

    Route clean invoices to Xero, others to review

    An If node sends invoices that passed every check to Xero. Everything else goes straight to the review queue with the list of reasons attached.

  7. 7

    Find the supplier contact in Xero

    The Xero node searches your contacts by name. If no match is found, the invoice is flagged as a new supplier and sent to review rather than creating a contact automatically.

  8. 8

    Create a draft bill in Xero

    For a known supplier, the Xero node creates a bill with status Draft, the supplier invoice number, dates, the amount excluding GST and the GST amount on your default expense account. It stays in Draft until someone approves it.

  9. 9

    Log to the invoice register

    Each draft bill is appended to a Google Sheet with the supplier, ABN, amounts, file name and Xero bill ID, giving you a simple register to reconcile against Xero.

  10. 10

    Ask a person to review exceptions

    Invoices that failed a check or have a new supplier are written to a Needs review tab, and a Slack message tells the bookkeeper what came in and why it needs a human look.

What you need

Xero organisation with bill access

A Xero user who can create bills, connected through n8n's Xero OAuth2 credential.

Gmail account

The inbox that receives supplier invoices, with a label and filter for them. Outlook works with a trigger swap.

OpenAI or Anthropic API key

Any current chat model that supports structured output. Smaller, cheaper models handle invoices well.

Google Sheets

One spreadsheet with an Invoice register tab and a Needs review tab.

Slack workspace

A channel where review requests should appear. You can swap this for an email node.

n8n instance

n8n Cloud or self-hosted. Self-hosting lets you choose an Australian region for the server.

Set it up in n8n

  1. 1

    Import the workflow JSON into n8n and open the Setup Notes sticky note.

  2. 2

    In Gmail, create a label such as supplier-invoices and a filter that applies it to invoice emails. Match the label in the trigger's search query and set a polling interval.

  3. 3

    Create a Xero OAuth2 credential in n8n, then select your organisation in the Find Supplier in Xero and Create Draft Bill in Xero nodes.

  4. 4

    Replace YOUR_EXPENSE_ACCOUNT_CODE with the account code bills should default to, such as your general expenses account. The bookkeeper can recode lines in Xero before approving.

  5. 5

    Create the Google Sheet with Invoice register and Needs review tabs, add the column headers used in the two Sheets nodes, and paste the sheet ID.

  6. 6

    Add your OpenAI credential to the Chat Model node, or replace it with an Anthropic Chat Model connected to Extract Invoice Fields.

  7. 7

    Choose the Slack channel in Ask Bookkeeper to Review.

  8. 8

    Send yourself a few real supplier invoices, run the workflow manually and compare every draft bill against the PDF before activating it.

Get the workflow

Ways to customise it

  • +Attach the original PDF to the draft bill using an HTTP Request node and Xero's Attachments endpoint, so approvers see the source document in Xero.
  • +Write one bill line per extracted line item instead of a single summary line, mapping each to an account code from a supplier lookup sheet.
  • +Match suppliers by ABN as well as name by storing the ABN in each Xero contact's tax number field.
  • +Check for duplicates by searching Xero for an existing bill with the same supplier and invoice number before creating a new one.
  • +Add a Gmail node at the end that labels processed emails, so the inbox shows what has already been handled.
  • +Swap the Gmail trigger for a Microsoft Outlook Trigger or a Google Drive folder trigger if invoices arrive another way.

For Australian businesses

Australian tax invoices must show the supplier's ABN, and you generally need a valid tax invoice to claim a GST credit, which is why the workflow checks the ABN checksum and sends missing ones to a person. Draft bills use Xero's Australian tax codes: INPUT (GST on Expenses) when GST is charged and EXEMPTEXPENSES (GST Free Expenses) when it is not. The ATO expects you to keep records, including invoices, for five years, so keep the original PDFs in email or Drive rather than relying on the extracted text. Invoices can contain personal information, such as sole traders' names and addresses. Sending them to an overseas AI API is a cross-border disclosure under APP 8 of the Privacy Act 1988, so check the provider's data terms, and consider self-hosting n8n in an Australian region.

Tools in this workflow

  • n8n

    Free plan + paid

    Automation

    A workflow automation platform that combines a visual node editor with code when you need it. It connects hundreds of apps and APIs and includes AI agent nodes that can call language models, tools and memory. Teams can self-host the free Community Edition on their own servers or use n8n's hosted cloud.

    Best for: Australian organisations that need automation data to stay onshore

    n8n review →
  • Finance

    Xero's AI assistant, named JAX for Just Ask Xero, built into the Xero accounting platform. Owners, bookkeepers and accountants ask plain-language questions about their business finances and get answers from live ledger data. JAX also helps create invoices and quotes, match bank transactions, capture documents and chase overdue payments.

    Best for: Australian small business owners already using Xero

    JAX review →
  • Vic.ai

    Enterprise

    Finance

    An accounts payable automation platform that uses AI to read invoices, code them to the right accounts, match them to purchase orders, route approvals and pay suppliers. It includes an AP inbox agent, payments and analytics, and connects to mid-market and enterprise ERPs.

    Best for: Mid-sized finance teams processing high invoice volumes

    Vic.ai review →
  • ChatGPT (OpenAI)

    Free plan + paid

    General Assistant

    OpenAI's general-purpose AI assistant. It handles writing, coding, file and image analysis, data analysis and web research through a chat interface, with an API for building it into your own systems.

    Best for: Small and mid-sized teams wanting one general assistant for everyday writing and analysis

    ChatGPT review →
  • Claude (Anthropic)

    Free plan + paid

    General Assistant

    Anthropic's AI assistant, known for careful reasoning, long-document analysis, writing and coding. It can work through large documents and codebases in a single conversation, paid plans include the Claude Code agentic coding tool, and it is available through an API and major cloud platforms.

    Best for: Legal, policy and consulting teams reviewing long documents

    Claude review →

Frequently asked questions

Will this workflow approve or pay bills in Xero?

No. The Xero node creates bills with the status Draft only. A person still has to open each bill in Xero, check the coding and GST, and approve it before it appears in payment runs. Nothing in the workflow touches payments or bank feeds.

Does it work with scanned or photographed invoices?

Only partly. The Extract from File node reads the text layer in a PDF. Scans and photos often have no text layer, so the model returns little and the confidence check sends them to review. To handle scans, add an OCR step such as a vision-capable model or an OCR API before extraction.

How does it handle GST on mixed supplies?

The draft bill uses a single line with the total GST amount the model read from the invoice. Invoices with a mix of taxable and GST-free items should be split into separate lines in Xero before approval. The customise ideas explain how to write one line per item.

What happens with a supplier that is not in Xero yet?

The workflow does not create contacts on its own. It sends the invoice to the Needs review tab with a note saying the supplier was not found. Once the contact exists in Xero, with the ABN in the tax number field, later invoices go through automatically.

Why use this instead of Xero's own bill capture?

Xero offers its own bill capture through Hubdoc and an email address for bills, and that may be all you need. This template is for teams that want their own validation rules, a register in Google Sheets, Slack alerts, or to plug in other steps such as purchase order matching.

Want this running in your business?

AI Lab Australia sets up n8n workflows end to end: hosting in Australia, connecting your systems, testing with real data and handing over documentation.