Onboard Brazilian suppliers by CNPJ with Google Forms, BrasilAPI and Gmail
Ready for 3.0What this workflow does
This workflow has 45 nodes and runs on Google Sheets events (row added) (plus 2 other triggers). Along the way it connects Google Sheets and Gmail.
How it runs
Trigger: On Google Sheets events (row added) (plus 2 other triggers).
- Config (Edit Fields (Set)): sets 6 fields: acceptedCnaePrefixes, buyerEmail, minCompanyAgeMonths…
- Alert: workflow failed (Gmail): uses Gmail
- Read suppliers for recheck (Google Sheets): uses Google Sheets
- Map form answers (Edit Fields (Set)): sets 6 fields: cnpjInput, formCompanyName, formUf…
- Active suppliers (Filter): keeps only the items that match a condition
- Validate CNPJ check digits (Code): runs custom JavaScript code
- Recheck CNPJ at BrasilAPI (HTTP Request): calls an HTTP API
- Valid CNPJ? (If): checks a condition and branches into true / false
- Compare status (Edit Fields (Set)): sets 4 fields: cnpj, legalName, previous…
- Wait for supplier list (Merge): merges the data from its input branches
…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 (14)
- Google Sheets Trigger
n8n-nodes-base.googleSheetsTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - Merge
n8n-nodes-base.merge - HTTP Request
n8n-nodes-base.httpRequest - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail - Filter
n8n-nodes-base.filter - Error Trigger
n8n-nodes-base.errorTrigger - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Aggregate
n8n-nodes-base.aggregate - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches
From the author
Quick overview This workflow monitors a Google Forms response sheet to validate and look up Brazilian supplier CNPJs via BrasilAPI, assigns a risk score, and then approves, rejects, or requests buyer approval by Gmail while maintaining approved and rejected…