HTML to PDF Conversion API Endpoint - n8n Workflow

Automate serverless PDF generation quickly. This n8n workflow instantly converts HTML content received via a webhook into a binary PDF file and returns it to the caller.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers needing a rapid, serverless HTML to PDF microservice.
Users looking for advanced n8n templates for custom document generation.
Businesses requiring reliable, automated PDF creation from structured data inputs.
Teams implementing document generation components within a larger application using n8n.

Overview

This highly efficient n8n workflow provides a robust API endpoint for on-demand HTML to PDF conversion. This architecture eliminates the need for managing complex server-side rendering environments or relying solely on third-party SaaS providers. By leveraging a specialized PDF processing n8n node (like the CustomJS PDF Toolkit), this n8n template ensures fast and reliable conversions.

When integrated into your system, this n8n workflow creates a simple contract: send the HTML data via HTTP, and the workflow responds instantly with the binary PDF file. This capability makes this n8n solution ideal for dynamic reporting, invoice generation, or certificate creation where immediate output is required.

How it Works

This n8n workflow operates as a streamlined request-response system, leveraging the flexibility of the n8n trigger mechanism:


  1. Webhook Activation (n8n trigger): The process starts when an external system sends an HTTP request (GET, POST, etc.) to the generated unique URL provided by the Webhook n8n node. This serves as the initial n8n trigger.

  2. HTML Conversion: The data received by the n8n trigger is passed to the HTML to PDF n8n node. This node utilizes credentials (CustomJS API in this example) to execute the conversion logic, transforming the input HTML content (which, in a live setup, would be dynamically extracted from the webhook body) into a binary PDF file.

  3. Binary Response: The resulting PDF binary file is then routed to the Respond to Webhook n8n node. This final n8n node is critically configured to return the data as a binary file, immediately sending the generated PDF back to the original client that invoked the n8n workflow, concluding the transaction.

Installation Guide

To deploy this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance via the 'New' menu > 'Import from JSON'.

  2. Credentials Setup: Locate the HTML to PDF n8n node. You will need to set up the corresponding external service credentials (e.g., CustomJS API) required by this specific third-party n8n node to ensure it can execute the PDF conversion engine.

  3. Webhook Configuration: The Webhook n8n trigger is automatically generated upon import. Click the node, save the n8n workflow, and copy the unique Test or Production URL. This is the endpoint your external application will call.

  4. Activate: Ensure the n8n workflow is activated (set to 'Active' status) to begin processing incoming API requests.

Node Details

Webhook (n8n trigger): Serves as the primary n8n trigger for the automation. It listens for incoming API calls. Key Configuration: Response Mode is set to Response Node, delegating the output format to the final node.
HTML to PDF (n8n node): The core action node. It takes HTML input (currently static placeholder HTML in this n8n template) and outputs the corresponding PDF file as binary data. This requires external API credentials.


  • Respond to Webhook (n8n node): A specialized n8n node used specifically for flow control in response workflows. Key Configuration: Respond With is set to binary, which ensures the generated PDF file is correctly sent back as the HTTP response body.

Related n8n Workflows

Free

Nodes: 3 Nodes
Updated: December 26 2025
View all
Created by

Featured*