Templates / Validate EN 16931 e-invoices from Gmail and create draft bills in Xero

Validate EN 16931 e-invoices from Gmail and create draft bills in Xero

Ready for 3.0

by Melbin Francis ✓ · 0 views · created 2026-10-01 · Invoice Processing, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This workflow has 46 nodes and runs on Gmail events. Along the way it connects Gmail and Xero. It also calls api.xero.com over HTTP.

How it runs

Trigger: On Gmail events.

  1. E-Invoice Policy (Edit Fields (Set)): sets 8 fields: bookkeeper_email, xero_organisation, xero_account_code…
  2. Mark The Email As Read (Gmail): mark as read (message)
  3. Read The E-Invoice (Code): runs custom JavaScript code
  4. Label The Invoice (Edit Fields (Set)): sets 7 fields: label, checked_on, outcome…
  5. What Was Attached? (Switch): routes items into 3 branches
  6. Plain PDFs Still Accepted? (If): checks a condition and branches into true / false
  7. Reason: File Could Not Be Read (Edit Fields (Set)): sets 1 field: problems
  8. Add Up The Invoice (Edit Fields (Set)): sets 5 fields: tolerance_used, sum_lines, expected_net…
  9. Reason: Plain PDF, Still Accepted (Edit Fields (Set)): sets 1 field: reason
  10. Reason: Plain PDF, Too Late (Edit Fields (Set)): sets 1 field: problems

…plus 35 more steps. See the full node list below.

Services it uses

GmailXero

HTTP calls to: api.xero.com

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Invoice Email Arrives).
Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (11)

From the author

Quick overview German businesses must accept e-invoices (XRechnung or ZUGFeRD), but Xero cannot read them. This reads them straight from your Gmail, checks they are correct, and turns the good ones into Xero draft bills for you to approve. How it works 1. It…

Excerpt from Melbin Francis's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.