Create draft Moloni invoice-receipts with Portuguese NIF validation
Ready for 3.0What this workflow does
This workflow has 17 nodes and runs manually, when you click “Execute workflow”. It uses only n8n's built-in nodes.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Sample payment data (Edit Fields (Set)): sets 9 fields: nome, email, nif…
- Configuration (Edit Fields (Set)): sets 14 fields: moloni_base_url, moloni_company_id, moloni_document_set_id…
- Prepare payment (Code): runs custom JavaScript code
- Validate payment and NIF (Code): runs custom JavaScript code
- Moloni: get access token (HTTP Request): calls an HTTP API
- Moloni: list VAT rates (HTTP Request): calls an HTTP API (POST)
- Check configured VAT rates (Code): runs custom JavaScript code
- Moloni: find customer by NIF (HTTP Request): calls an HTTP API (POST)
- Read customer search result (Code): runs custom JavaScript code
- Customer exists? (If): checks a condition and branches into true / false
…plus 6 more steps. See the full node list below.
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 (5)
- Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if
From the author
Quick overview This workflow runs manually with sample payment data, validates a Portuguese NIF and VAT configuration, then uses the Moloni API to find or create the customer and generate a draft invoice-receipt (fatura-recibo) with the payment lines and tax…