Actions2
Template to PDF
AI-generatedSummary
Renders a saved Peedief template into a PDF by sending a JSON context to the Peedief API, and optionally downloads the resulting PDF as binary data.
Inputs
- templateName (required) — Name of the saved Peedief template. It is URL-encoded and used in POST {baseUrl}/templates/by-name/{name}/pdf.
- contextJson (required) — JSON object passed to the template renderer as
contextJson. It must be valid JSON and an object (not an array or scalar), otherwise the node throws an error. - fileName — Optional output file name, such as invoice.pdf. It is trimmed and sent only if non-empty. Peedief generates a name otherwise.
- downloadPdf — When true, fetches the PDF from the
downloadUrlin the API response and attaches it as binary data. Default is false. - binaryPropertyName (required) — Shown only when Download PDF is on. It is the binary property that receives the PDF. Default is
data.
Output shape
One output item per input item. json holds the Peedief API response as-is. When Download PDF is on, the item also has the PDF (application/pdf) under the chosen binary property.
The
downloadUrlfield is required for download. If it is missing, the node errors. The binary file name is the response'sfileName, or<binaryPropertyName>.pdfas a fallback. With Continue On Fail, failed items returnjson.errorwith the message. The node uses the Peedief API credential (API key sent as an x-api-key header, plus a base URL). PDF Options (format, margins and so on) apply only to HTML to PDF, not to this operation.
Examples
Example 1: Generate an invoice PDF from a saved template and attach it to an email.
Template Name: invoice; Context JSON: {{ JSON.stringify($json) }}; File Name: invoice-123.pdf; Download PDF: true; Binary Property: data
Example 2: Create a PDF and pass only its link to a later step.
Template Name: report; Context JSON with report data; Download PDF: false; read downloadUrl from the output JSON