The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "InvoiceFlow \u2013 Webhook Consumer",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "invoiceflow-webhook",
"responseMode": "onReceived",
"options": {}
},
"id": "webhook-trigger",
"name": "Webhook Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict"
},
"conditions": [
{
"id": "condition-status",
"leftValue": "={{ $json.body.status }}",
"rightValue": "SUCCESS",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
}
},
"id": "check-status",
"name": "Check Status",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
500,
300
]
},
{
"parameters": {
"jsCode": "const body = $input.first().json.body || $input.first().json;\nconst result = {\n event: 'invoice_issued',\n saleId: body.saleId,\n protocol: body.protocol || '',\n status: body.status,\n message: `NFS-e emitida com sucesso. Protocolo: ${body.protocol}`,\n processedAt: new Date().toISOString()\n};\nconsole.log('[SUCESSO]', JSON.stringify(result));\nreturn [{ json: result }];"
},
"id": "log-success",
"name": "Log Sucesso",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
750,
200
]
},
{
"parameters": {
"jsCode": "const body = $input.first().json.body || $input.first().json;\nconst result = {\n event: 'invoice_failed',\n saleId: body.saleId,\n status: body.status,\n error: body.errorMsg || 'Sem detalhes',\n message: `Erro na emissao da NFS-e para venda ${body.saleId}`,\n processedAt: new Date().toISOString()\n};\nconsole.log('[ERRO]', JSON.stringify(result));\nreturn [{ json: result }];"
},
"id": "log-error",
"name": "Log Erro",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
750,
400
]
}
],
"connections": {
"Webhook Trigger": {
"main": [
[
{
"node": "Check Status",
"type": "main",
"index": 0
}
]
]
},
"Check Status": {
"main": [
[
{
"node": "Log Sucesso",
"type": "main",
"index": 0
}
],
[
{
"node": "Log Erro",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"tags": [
{
"name": "invoiceflow"
},
{
"name": "webhook"
}
]
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
InvoiceFlow – Webhook Consumer. Webhook trigger; 4 nodes.
Source: https://github.com/MatheusAndrell/InvoiceFlow/blob/9fa54d97161ca0a91cb3b23435db4934892506b5/n8n/workflow-webhook.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
AP Invoice — 01 Orchestrator. Uses postgres, httpRequest, quickbooks, slack. Webhook trigger; 42 nodes.
This workflow automates the entire process of receiving a product/service order, checking or creating a customer in QuickBooks Online (QBO), generating an invoice, and emailing it — all triggered by a
Tired of the standard, boring invoices from QuickBooks Online? This workflow completely automates the process of creating beautiful, custom-branded PDF invoices and emailing them directly to your clie
Automated QuickBooks Invoice to Custom PDF & Email
This workflow automates the full invoicing and payment process using n8n and Xero. It allows businesses to generate invoices, track payments, send WhatsApp notifications, and keep records synced autom