Log Brazilian NF-e invoice XMLs from Gmail into Google Sheets
Ready for 3.0What this workflow does
This workflow has 44 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Gmail and Google Sheets.
How it runs
Trigger: On Gmail events (plus 1 other trigger).
- One item per attachment (Split Out): splits a list into separate items
- Read Review tab (Google Sheets): uses Google Sheets
- Keep XML files (Filter): keeps only the items that match a condition
- Added in the last 24 hours (Filter): keeps only the items that match a condition
- Describe failure (Edit Fields (Set)): sets 4 fields: stage, failure, sourceFile…
- Read XML file (Extract from File): extracts data from a file (text)
- Format alert line (Edit Fields (Set)): sets 1 field: alertLine
- Send failure alert (Gmail): uses Gmail
- Complete NF-e or event XML (Filter): keeps only the items that match a condition
- Collect alert lines (Aggregate): combines items into one
…plus 32 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102)
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.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (17)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Split Out
n8n-nodes-base.splitOut - Filter
n8n-nodes-base.filter - Extract from File
n8n-nodes-base.extractFromFile - XML
n8n-nodes-base.xml - Edit Fields (Set)
n8n-nodes-base.set - Merge
n8n-nodes-base.merge - Switch
n8n-nodes-base.switch - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - Sort
n8n-nodes-base.sort - Remove Duplicates
n8n-nodes-base.removeDuplicates - Summarize
n8n-nodes-base.summarize - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Aggregate
n8n-nodes-base.aggregate - Gmail
n8n-nodes-base.gmail
From the author
Quick overview This workflow polls Gmail for emails with XML attachments, extracts Brazilian NF-e invoice data, validates the 44-digit access key against the XML content, and upserts one row per invoice into Google Sheets while sending invalid or conflicting…