Generate PDFs from n8n
To generate a PDF from n8n, add an HTTP Request node that sends a POST to the Docweave API with your template (or HTML/URL) and data as a JSON body — n8n makes the call, and the response is your rendered PDF. No separate rendering service or headless browser to run yourself.
Wire the HTTP Request node
In your n8n workflow, add an HTTP Request node after whatever step produces the data you want in the PDF (a webhook trigger, a database node, a form submission, etc.), and configure it:
- Method:
POST - URL:
https://docweave.dev/api/v1/pdf - Authentication: under "Header Auth" (or a generic header), add
Authorizationwith valueBearer dw_live_your_key - Body Content Type:
JSON - Body: a
source(template + data, HTML, or a URL) plus anidempotencyKey, using n8n expressions to pull in values from the previous node
Example JSON body
Paste this into the HTTP Request node's JSON body field, then swap the {{ $json.* }} expressions for the fields coming from your workflow's previous node:
{
"source": {
"type": "template",
"template": "<h1>Order {{ order_id }}</h1><p>Customer: {{ customer_name }}</p><p>Total: {{ total }}</p>",
"data": {
"order_id": "{{ $json.order_id }}",
"customer_name": "{{ $json.customer_name }}",
"total": "{{ $json.total }}"
}
},
"options": { "format": "A4" },
"idempotencyKey": "{{ $json.order_id }}"
}What n8n is actually doing
Under the hood, the HTTP Request node makes the same call you'd make with curl — n8n just handles the request/response plumbing and lets you template the body with data from earlier nodes:
curl https://docweave.dev/api/v1/pdf \
-H "Authorization: Bearer dw_live_your_key" \
-H "Content-Type: application/json" \
-H "Accept: application/pdf" \
-d '{
"source": {
"type": "template",
"template": "<h1>Order {{ order_id }}</h1><p>Customer: {{ customer_name }}</p><p>Total: {{ total }}</p>",
"data": { "order_id": "1042", "customer_name": "Acme Inc.", "total": "$412.00" }
},
"idempotencyKey": "1042"
}' \
--output order-1042.pdfWhere to go from here
Rendering is Chromium under the hood, sources can be a template + JSON, raw HTML, or a URL, and billing is per document (not per page), so a longer report costs the same as a one-page receipt. If you'd rather skip HTTP configuration entirely, the open-source @docweave/mcp server exposes the same rendering as a generate_pdf tool — run it with npx @docweave/mcp for MCP-based automation clients, or stick with the HTTP Request node for n8n itself. Other automation tools (like Make or Zapier) can call the same endpoint the same way — check the provider's current docs for the equivalent of an "HTTP" or "webhook" module.
FAQ
How do I generate a PDF from n8n?
Add an HTTP Request node, set the method to POST, the URL to https://docweave.dev/api/v1/pdf, an Authorization header of "Bearer dw_live_your_key", and a JSON body containing a source (your HTML template plus a data object) or a url to render. The node's response body is the generated PDF result.
Which n8n node should I use to call the Docweave API?
The built-in HTTP Request node. Set "Body Content Type" to JSON, add the Authorization header, and reference upstream node data with n8n expressions like {{ $json.order_id }} inside the JSON body so each workflow run renders a different PDF.
Can I turn an existing n8n workflow's data straight into a PDF, without a separate template file?
Yes. Pass source.type "html" with a fully rendered HTML string built from expressions in a previous n8n node (e.g. a Set or Function node), or source.type "template" with placeholders and a data object — both are single-call POSTs from the same HTTP Request node.
How do I stop an n8n retry from generating the same PDF twice?
Include an idempotencyKey in the JSON body, such as the order ID or a workflow execution ID. If n8n retries the HTTP Request node after a timeout or error, a repeat request with the same key returns the original result instead of rendering (and billing) again.
Ready to wire this into your n8n workflow?
Get an API key