{ "meta": { "instanceId": "workflow-0b910aee", "versionId": "1.0.0", "createdAt": "2025-09-29T07:08:00.795853", "updatedAt": "2025-09-29T07:08:00.795863", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production" }, "nodes": [ { "id": "de602925-4d9d-4045-9d9d-ed37dfb65490", "name": "HTML to PDF", "type": "n8n-nodes-base.noOp", "position": [ 460, -20 ], "parameters": { "htmlInput": "=\n\n\n \n \n Invoice\n \n\n\n\n
\n
\n

Invoice

\n

Invoice #{{ $('Set data').item.json['Invoice No'] }}

\n
\n\n
\n
\n

Billed To:

\n {{ $json.bill_to }}\n
\n
\n

From:

\n {{ $json.from }}\n

Email: {{ $('Set data').item.json.Email }}

\n
\n
\n\n \n \n \n \n \n \n \n \n \n \n {{ $json.details }}\n \n \n \n \n \n
DescriptionUnit PriceQuantityTotal
Total Amount${{ $json.total }}
\n\n
\n

Thank you for doing business with us!

\n

If you have any questions regarding this invoice, please contact us at {{ $('Set data').item.json.Email }}.

\n Contact Us\n
\n
\n\n\n" }, "credentials": { "customJsApi": { "id": "SZkqeEHVYyWhaGem", "name": "CustomJS account" } }, "typeVersion": 1, "notes": "This html2Pdf node performs automated tasks as part of the workflow." }, { "id": "5a8efc8a-c60b-4616-a17a-6275cc326978", "name": "Preprocess", "type": "n8n-nodes-base.code", "position": [ 240, -20 ], "parameters": { "mode": "runOnceForEachItem", "jsCode": "const input = $input.item.json\nconst bill_to = input['Bill To'].split('\\n').map(item => '

' + item + '

')\nconst from = input['From'].split('\\n').map(item => '

' + item + '

')\nconst details = input['Details'].map(item => {\n const price = item.price*item.qty\n return `\n \n ${item.description}\n $${item.price}\n ${item.qty}\n $${price}\n \n `\n})\nconst total = input['Details'].reduce((val, next) => {\n\treturn val+next.price*next.qty\n}, 0)\nreturn {\n bill_to: bill_to.join('\\n'),\n from: from.join('\\n'),\n details: details.join('\\n'),\n total\n}" }, "typeVersion": 2, "notes": "This code node performs automated tasks as part of the workflow." }, { "id": "7da4fb46-1f74-44d8-8392-16fc90f23928", "name": "Set data", "type": "n8n-nodes-base.set", "position": [ 20, -20 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "5342001f-a513-46c3-b31f-4590e8514411", "name": "Invoice No", "type": "string", "value": "1" }, { "id": "ec357d39-c697-4bb8-8d9d-1bc303352dd0", "name": "Bill To", "type": "string", "value": "John Doe\n1234 Elm St, Apt 567\nCity, Country, 12345" }, { "id": "88d6b470-4075-43ec-a684-a4adfd889278", "name": "From", "type": "string", "value": "ABC Corporation\n789 Business Ave\nCity, Country, 67890" }, { "id": "061a8020-644a-4cec-bade-3bcd7e15adee", "name": "Details", "type": "array", "value": "[ { \"description\": \"Web Hosting\", \"price\": 150, \"qty\": 2 }, { \"description\": \"Domain\", \"price\": 15, \"qty\": 5 } ]" }, { "id": "1c2c6c4b-6aa5-4656-8cae-43ffac71d478", "name": "Email", "type": "string", "value": "support@mycompany.com" } ] } }, "typeVersion": 3.4, "notes": "This set node performs automated tasks as part of the workflow." }, { "id": "a6d39cc4-b9c2-4eed-b4a6-46d622a87c14", "name": "Webhook", "type": "n8n-nodes-base.webhook", "position": [ -200, -20 ], "webhookId": "526fd864-6f85-4cde-97aa-39b61a3e5b83", "parameters": { "path": "526fd864-6f85-4cde-97aa-39b61a3e5b83", "options": {}, "responseMode": "responseNode" }, "typeVersion": 2, "notes": "This webhook node performs automated tasks as part of the workflow." }, { "id": "c7d1cc1d-88e3-463a-886f-182a2ba72b11", "name": "Respond to Webhook", "type": "n8n-nodes-base.respondToWebhook", "position": [ 660, -20 ], "parameters": { "options": {}, "respondWith": "binary" }, "typeVersion": 1.1, "notes": "This respondToWebhook node performs automated tasks as part of the workflow." } ], "pinData": {}, "connections": { "a6d39cc4-b9c2-4eed-b4a6-46d622a87c14": { "main": [ [ { "node": "error-handler-a6d39cc4-b9c2-4eed-b4a6-46d622a87c14", "type": "main", "index": 0 } ], [ { "node": "error-handler-a6d39cc4-b9c2-4eed-b4a6-46d622a87c14-bd8f25b7", "type": "main", "index": 0 } ], [ { "node": "error-handler-a6d39cc4-b9c2-4eed-b4a6-46d622a87c14-f1c5e983", "type": "main", "index": 0 } ], [ { "node": "error-handler-a6d39cc4-b9c2-4eed-b4a6-46d622a87c14-5ff82a03", "type": "main", "index": 0 } ], [ { "node": "error-handler-a6d39cc4-b9c2-4eed-b4a6-46d622a87c14-782eed9c", "type": "main", "index": 0 } ], [ { "node": "error-handler-a6d39cc4-b9c2-4eed-b4a6-46d622a87c14-830f6e8f", "type": "main", "index": 0 } ], [ { "node": "error-handler-a6d39cc4-b9c2-4eed-b4a6-46d622a87c14-31ea696f", "type": "main", "index": 0 } ], [ { "node": "error-handler-a6d39cc4-b9c2-4eed-b4a6-46d622a87c14-ca2cb17c", "type": "main", "index": 0 } ], [ { "node": "error-handler-a6d39cc4-b9c2-4eed-b4a6-46d622a87c14-809bb379", "type": "main", "index": 0 } ] ] }, "c7d1cc1d-88e3-463a-886f-182a2ba72b11": { "main": [ [ { "node": "error-handler-c7d1cc1d-88e3-463a-886f-182a2ba72b11", "type": "main", "index": 0 } ], [ { "node": "error-handler-c7d1cc1d-88e3-463a-886f-182a2ba72b11-65446af7", "type": "main", "index": 0 } ], [ { "node": "error-handler-c7d1cc1d-88e3-463a-886f-182a2ba72b11-037db83b", "type": "main", "index": 0 } ], [ { "node": "error-handler-c7d1cc1d-88e3-463a-886f-182a2ba72b11-4f01b25a", "type": "main", "index": 0 } ], [ { "node": "error-handler-c7d1cc1d-88e3-463a-886f-182a2ba72b11-634a79d1", "type": "main", "index": 0 } ], [ { "node": "error-handler-c7d1cc1d-88e3-463a-886f-182a2ba72b11-a44698ea", "type": "main", "index": 0 } ], [ { "node": "error-handler-c7d1cc1d-88e3-463a-886f-182a2ba72b11-9ae4f4be", "type": "main", "index": 0 } ], [ { "node": "error-handler-c7d1cc1d-88e3-463a-886f-182a2ba72b11-4e230e28", "type": "main", "index": 0 } ], [ { "node": "error-handler-c7d1cc1d-88e3-463a-886f-182a2ba72b11-034e3f89", "type": "main", "index": 0 } ] ] } }, "name": "Html2Pdf Workflow", "description": "Automated workflow: Html2Pdf Workflow. This workflow processes data and performs automated tasks.", "settings": { "executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000 }, "tags": [ "automation", "n8n", "production-ready", "excellent", "optimized" ], "notes": "Excellent quality workflow: Html2Pdf Workflow. This workflow has been optimized for production use with comprehensive error handling, security, and documentation." }