What This Workflow Does
This workflow changes HTML code into a PDF file automatically, fixing the problem of slow manual work and errors.
It takes HTML text, sends it to a service that turns it into PDF, and saves the PDF file to your computer.
This avoids copying and pasting HTML by hand and reduces mistakes in the PDF files.
Who Should Use This Workflow
Anyone who needs to turn HTML designs or reports into PDF files regularly and fast.
This helps content managers, report builders, or teams who want the same PDF layout every time without spending hours.
Tools and Services Used
- n8n automation platform: Runs the workflow steps to convert and save files.
- ConvertAPI service: Converts the HTML files to PDF files remotely.
- HTTP Query Auth credentials in n8n: Keeps API access secure.
- File system access: Lets the PDF file be saved on your computer.
Inputs, Processing Steps, and Output Explained
Inputs
The starting input is an HTML code in simple text format inside the workflow.
Processing Steps
- Prepare the HTML content in a specific field within the workflow.
- Change the HTML text into a file format that can be sent in an upload.
- Use an HTTP call to send the HTML file to ConvertAPI which changes it to PDF.
- Receive the PDF file back as a response from the service.
- Save the returned PDF file into a chosen folder on the computer.
Output
A PDF file called document.pdf saved locally with correct formatting from HTML.
Beginner Step-by-Step: How to Use This Workflow In Production Inside n8n
Step 1: Import the Workflow
- Download the workflow file using the Download button on this page.
- Open the n8n editor where you want to run the automation.
- Click on menu, choose “Import from File”, and select the downloaded workflow.
Step 2: Configure Credentials and Settings
- Add your ConvertAPI API Key into the HTTP Query Auth credentials in n8n settings.
- Update any file paths or names in the Save File node if different storage location or name is needed.
Step 3: Test the Workflow
- Click the manual trigger node called Manual Trigger to start a test run.
- Check if the PDF file named document.pdf appears where configured.
- Open the PDF file to see if it matches the original HTML layout.
Step 4: Activate for Production
- Once tested, activate the workflow by switching it from draft to active mode.
- Optionally, replace the Manual Trigger with a Cron node for scheduled runs.
For users hosting the workflow themselves, consider self-host n8n for reliable automation.
Customization Ideas
- Change the HTML code inside the create HTML node to generate different PDF content.
- Modify the saved PDF filename in the write file node to fit naming needs.
- Add date or time in the filename using expressions like
document_{{$now.toISOString().slice(0,10)}}.pdffor version tracking. - Switch ConvertAPI with another HTML to PDF API by changing HTTP Request node’s URL and credentials.
- Change triggers to run workflow automatically using scheduling.
Common Problems and Fixes
- Authentication errors: These happen if API Key is wrong or missing in HTTP Query Auth setup. Fix by confirming keys are correct and active.
- Empty or broken PDF files: Caused by wrong data field naming or missing binary content in code node or write file node. Fix by ensuring binary field is called exactly “data” and referenced properly.
Summary of What You Get
✓ A workflow that turns HTML to PDF without manual copy-paste.
✓ Saves hours of repetitive work each week.
✓ Produces consistent PDF files with correct formatting.
→ PDF files saved automatically to your chosen folder.
→ Easy to customize content and filename.
