Verify Japanese invoice registration numbers from Gmail using Gemini, NTA API, Sheets and Slack
Ready for 3.0What 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.
- Extract Invoice PDF Text (Extract from File): extracts data from a file (pdf)
- 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
- Normalize Registration Number (Code): runs custom JavaScript code
- Check Number Format (If): checks a condition and branches into true / false
- Verify with NTA Invoice API (HTTP Request): calls web-api.invoice-kohyo.nta.go.jp
- Report Missing Number (Slack): uses Slack
- Parse NTA Response (Code): runs custom JavaScript code
- Report NTA API Failure (Slack): uses Slack
- Log Verification Result (Google Sheets): append
- Route by Verification Result (Switch): routes items into 3 branches
…plus 4 more steps. See the full node list below.
Services it uses
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)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Extract from File
n8n-nodes-base.extractFromFile - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest - Google Sheets
n8n-nodes-base.googleSheets - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail - Slack
n8n-nodes-base.slack
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…