Skip to content
FlowHubFluxonLab
W
General Automationfree

Convert HTML to PDF and Return via Webhook using CustomJS API

by CustomJSadapted from n8n official workflow galleryUpdated Aug 2026
Share Post Share
WeWebhookRTRespond to WebhookRespond to Webh…HPHTML to PDF12
1/5
STEPS · 2
Starts on an incoming request

! n8n Workflow: HTML to PDF Generator This n8n workflow converts HTML content into a styled PDF and returns it as a response via a webhook. The workflow receives HTML input, processes it using CustomJS's PDF toolkit, and sends back the resulting PDF to the original webhook requester. @custom-js/n8n-nodes-pdf-toolkit Features: Webhook Trigger**: Accepts incoming requests with HTML content. HTML to PDF Conversion**: Uses CustomJS to transform HTML into a PDF. Response**: Sends the generated PDF back to the webhook response. Requirements: Self-hosted** n8n instance A CustomJS API key for HTML to PDF conversion HTML content** to be converted into a PDF Workflow Steps: Webhook Trigger: Accepts incoming HTTP requests with HTML content. This data is passed to the next node for processing. HTML to PDF Conversion: Uses the CustomJS node to convert the incoming HTML into a PDF document. You can customize the HTML content to match the design requirements. Respond to Webhook: Sends the generated PDF as a binary response to the original webhook request. Setup Guide: 1. Configure CustomJS API Sign up at CustomJS. Retrieve your API key from the profile page. Add your API key as n8n credentials.

Tags

n8nreference-only
CategoryGeneral Automation
Triggermanual
Complexitysimple
Nodes3
AddedMar 26, 2025
free

Using the Merge Node - Merge by Key

This is an example of how you can make Merge by Key work. The “Data 1” and “Data 2” nodes simply provide mock data. You can replace them with your own data sources. Then the “Convert Data” nodes are important. They make sure that the different array items are actually different items in n8n. After that, you have then the merge with the merged data.

by mike
free

Write JSON to Disk (Binary)

The “Write Binary File” expects binary data. The JSON data is, however, JSON ;) There should really be a node that allows moving data around between both of them. For now, it can be done with a Function-Node. At least till a proper one is in place. The first node is example data, wich you can customize or replace. The second node named “Make Binary” is the important one with the custom code which makes the data binary and writes it to the correct location.

by mike
free

Webhook returning XML

Receives data from an incoming HTTP Request (set up to use respond to webhook node) Create dummy data Convert JSON to XML which gets returned Respond to Webhook which returns the data and the content type of the data

by Jan Oberhauser