PDF Generator
The PDF Generator renders a PDF from an HTML template plus data and returns a link to the finished file. Use it to produce invoices, receipts, reports, or confirmations that your flow can then send — for example, attach it to a WhatsApp or email message.
Use it inside an Agent node (the agent generates a PDF when it makes sense) or as a standalone Tool node for a fixed, deterministic document.
Adding it to a flow
In the Tool node's tool picker, choose PDF Generator, pick a source (a registered template or your own HTML), and provide the data to fill it.
Setup / credentials
The PDF Generator works without a credential in most cases. Optionally, you can bind a Chatflow API credential to secure the render call — when one is bound, the PDF service requires it. Add it via Connect Credential if your setup needs it.
Inputs
| Parameter | Description | Required |
|---|---|---|
| Source | Render a registered Template ID or your own HTML. | Yes |
| Template | The registered server template to render (when Source is Template ID). | When using a template |
| HTML | Handlebars HTML/CSS you author, using {{variables}} filled from Data (when Source is HTML). | When using HTML |
| Data | How you supply the values merged into the template: Form (key → value rows) or JSON. | Yes |
| Fields | The key → value rows that build the data object (Form mode). | When Data is Form |
| JSON | A JSON object of the data (JSON mode) — best for nested or complex data. | When Data is JSON |
Form mode is a simple key → value grid — great for a handful of fields, and each value can pull in a variable. JSON mode is a plain JSON object — use it when your template needs nested or list data.
Outputs
The tool returns a signed URL to the rendered PDF (or a render id if the job is queued). It's a single-output tool. Save the URL in flow state so a later node can send or link to the document.
Example
Send an order receipt as a PDF
- Add a Tool node with PDF Generator.
- Set Source to HTML and author a small receipt template using
{{customerName}},{{orderNumber}}, and{{total}}. - In Data (Form mode), map those keys to the collected order values.
- Feed the returned URL into a WhatsApp document message to deliver the receipt.
Some registered templates are server-side: they hold their own data and lay the document out
themselves, so your flow sends a short description instead of the full body. The inspection
template works this way — see Inspection Reports.
Tips
- Author with Handlebars. Your HTML uses
{{placeholders}}that are filled from the Data you provide. - Use JSON mode for lists. If the template loops over items (like invoice line items), supply the data as JSON.
- Keep the returned URL. Store it in flow state so the send step (email/WhatsApp) can reference it.
- Bind the Chatflow API credential only if your PDF service requires the request to be authenticated.
Related
- Inspection Reports — the
inspectiontemplate's own contract - WhatsApp tool — deliver the PDF as a document message
- Variables — fill template data from flow values
- Tool node · Flow state