Building a PDF feature?
Save this to your Work Desktop.

Back to Resources
n8nAutomationNo-CodeTutorial

How to Automate Invoice Generation in n8n (No-Code)

Automating the Boring Stuff

You have sales data in Airtable or Google Sheets. You need to send a PDF invoice to the client. You could do it manually. Or you could build an n8n workflow that runs while you sleep. But remember: Your automation needs a good looking output. Grab one of our professional invoice templates before you start.

The Workflow Setup

  1. Trigger: New Record in Airtable (Status = "Ready to Bill").
  2. Action: HTTP Request to pdfmyhtml API.
  3. Action: Email with Attachment (Gmail/Outlook).

Download this n8n Workflow (.json)

The New Way: Hosted Templates with Handlebars / Jinja2

In the past, you had to use complex Javascript nodes to build your HTML string. With pdfmyhtml's hosted templates, you save your invoice layout in our dashboard once and just pass the JSON data on every call.

Step 1 — create the template in your dashboard at /dashboard/templates/new:

<!-- Saved as 'invoice-v1' in your dashboard --> <h1>Invoice #{{ invoice_number }}</h1> <p>Amount: {{ total }}</p>

Step 2 — call the render endpoint from n8n's HTTP Request node:

POST https://api.pdfmyhtml.com/v1/templates/{{ template_id }}/render
Header: X-API-Key: YOUR_KEY
Body (JSON):
{
  "data": {
    "invoice_number": "{{ $json.InvoiceNumber }}",
    "total": "{{ $json.Total }}"
  },
  "wait": true
}

The response includes a download_url. Pipe that into n8n's "Read Binary File" or another HTTP node to download and attach the PDF.

This keeps your n8n workflow clean — no code nodes, no f-string assembly.

Why pdfmyhtml for n8n?

Most PDF tools for n8n are either:

  1. Expensive ($30/mo+).
  2. Complex (require running your own docker container).

pdfmyhtml offers a generous free tier that lets you test your workflows without pulling out a credit card.

Get your API Key and start automating today.

Ready to build?

Stop fighting with PDFs. Start shipping.