Automated PDF Invoice Generation with n8n – Free Workflow Example

Disclosure: I’m involved in developing UsePDFMaker, the PDF service used in this example.

Hi everyone!

I wanted to share an n8n workflow example for generating PDF invoices from structured data.

The idea is straightforward: instead of manually preparing invoice documents, the workflow takes invoice information, builds an HTML template, and converts it into a PDF.

How the workflow works

  1. Manual Trigger – Starts the workflow.

  2. Sample Invoice Data – Creates example invoice data, including line items and totals.

  3. HTML Template – Uses an n8n Code node to generate an HTML invoice.

  4. PDF Generation – Uses the UsePDFMaker community node to convert the HTML into a PDF.

GitHub Repository

The workflow JSON and setup instructions are available here:

The example is open-source under the MIT License.

Testing Status

The workflow has passed local structural checks, but it has not yet been imported and tested end-to-end in n8n.

Feedback Welcome

I’m sharing this as a starting point for anyone building invoice or document-generation automations.

I’d love to hear your thoughts:

  • How are you currently generating PDF invoices in n8n?

  • Would you change anything in this workflow?

  • Are there other PDF automation scenarios you’d find useful?

Thanks for taking a look!

Thanks for sharing the example. For anyone adapting it to real invoices, a few points are worth adding. Calculate the totals in the Code node with rounding applied in one consistent place, either per line item or once on the total, so the PDF always matches the accounting system.

Generate the invoice number from a stored counter rather than a timestamp, so retrying a run does not create gaps or duplicates. It also helps to add an error workflow, so a failed PDF conversion sends an alert instead of silently skipping an invoice.

Thanks for the thoughtful feedback!

You’ve raised some important points, especially around consistent rounding, reliable invoice numbering, and error handling.

The current workflow is intended as a simple, open-source starting point for PDF invoice automation rather than a production-ready accounting solution.

I agree that these improvements would make it much more useful for real-world scenarios.

I’ll take these suggestions into consideration for a future iteration of the example.

Really appreciate you taking the time to review it!