New sheet row to invoice PDF (n8n)
An n8n workflow that turns each new Google Sheets row into an invoice PDF with WeasyPrint and emails it. Swap the trigger for Airtable or monday.com.
Last updated
| Operations | weasyprint_render (POST /v1/weasyprint/render) |
|---|---|
| Platforms | n8n |
| Nodes | Google Sheets Trigger, Code, HTTP Request, Gmail |
When a new row lands in a sheet, this workflow turns it into a
ready-to-send PDF: an invoice, a quote or a work order. The example reads a
Google Sheet with the headers Invoice, Client, Email, Description,
Quantity, Unit price and Due date. It emails each invoice to the
address in its row.
Airtable and monday.com work the same way: only the trigger changes. For Airtable, use an Airtable Trigger. For monday.com, use a Webhook node that a monday.com webhook integration calls, then the monday.com node's Board Item > Get.
The steps
- New row in sheet (Google Sheets Trigger, Row Added). Checks the sheet every minute.
- Build HTML (Code). Maps the columns into an A4 invoice and escapes every value.
- Render PDF (HTTP Request). POSTs
{"html": ..., "filename": ...}tohttps://api.pagespool.com/v1/weasyprint/renderand puts the PDF in the binary fielddata. - Email the PDF (Gmail). Attaches
dataand sends it to the row'sEmail.
The invoice guide covers page breaks and repeated table headers for longer documents.
Set up the HTTP Request node
- Method POST, URL
https://api.pagespool.com/v1/weasyprint/render. - Authentication: Generic Credential Type, Header Auth, with the name
X-API-Keyand your key as the value. - Send Body: JSON, with
htmlset to the Code node's output andfilenameset to the invoice number plus.pdf. - Options > Response > Response Format: File, Put Output in Field
data.
Get your API key. Each render costs 1 credit, whatever its page count, and a failed render costs nothing.
FAQ
- Can I use Airtable or monday.com instead of Google Sheets?
- Yes. For Airtable, replace the trigger with an Airtable Trigger. n8n has no monday.com trigger node. For monday.com, point a monday.com webhook integration at a Webhook node. Then read the item's columns with the monday.com node (Board Item, Get). The rest of the workflow stays the same.
- Can I save the PDF instead of emailing it?
- Yes. The PDF is in the binary field data after the HTTP Request node, so a Google Drive upload step, or any other node that takes a file, can replace the Gmail node.