Templates / Verify Japanese invoice registration numbers from Gmail using Gemini, NTA API, Sheets and Slack

Verify Japanese invoice registration numbers from Gmail using Gemini, NTA API, Sheets and Slack

Ready for 3.0

by Oka Hironobu ✓ · 6 views · created 2026-07-19 · 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-10-19.

What this workflow does

This AI workflow has 17 nodes and runs on Gmail events. Along the way it connects Gmail, Google Gemini Chat Model, Google Sheets and Slack. It also calls web-api.invoice-kohyo.nta.go.jp over HTTP.

How it runs

Trigger: On Gmail events.

  1. Extract Invoice PDF Text (Extract from File): extracts data from a file (pdf)
  2. Extract Invoice Fields with Gemini (Basic LLM Chain): sends a prompt to an LLM, with model: Google Gemini Chat Model; output parser: Invoice Fields Parser
  3. Normalize Registration Number (Code): runs custom JavaScript code
  4. Check Number Format (If): checks a condition and branches into true / false
  5. Verify with NTA Invoice API (HTTP Request): calls web-api.invoice-kohyo.nta.go.jp
  6. Report Missing Number (Slack): uses Slack
  7. Parse NTA Response (Code): runs custom JavaScript code
  8. Report NTA API Failure (Slack): uses Slack
  9. Log Verification Result (Google Sheets): append
  10. Route by Verification Result (Switch): routes items into 3 branches

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

Services it uses

GmailGoogle Gemini Chat ModelGoogle SheetsSlack

HTTP calls to: web-api.invoice-kohyo.nta.go.jp

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.

Nodes used (12)

From the author

Quick Overview This workflow monitors Gmail for unread invoice emails with PDF attachments, extracts invoice details with Google Gemini, verifies Japanese qualified invoice registration numbers against the National Tax Agency (NTA) Invoice Web-API, logs…

Excerpt from Oka Hironobu'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.