Convert HTML to PDF Automatically with n8n and ConvertAPI

Save time converting HTML documents to PDFs with n8n automation using ConvertAPI. This workflow turns HTML content into a polished PDF file quickly, eliminating manual steps and ensuring consistent output.
manualTrigger
httpRequest
code
+3
Workflow Identifier: 2473
NODES in Use: Manual Trigger, Set, Code, HTTP Request, Read Write File, Sticky Note
Automate HTML to PDF with n8n and ConvertAPI

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

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

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor where you want to run the automation.
  3. Click on menu, choose “Import from File”, and select the downloaded workflow.

Step 2: Configure Credentials and Settings

  1. Add your ConvertAPI API Key into the HTTP Query Auth credentials in n8n settings.
  2. Update any file paths or names in the Save File node if different storage location or name is needed.

Step 3: Test the Workflow

  1. Click the manual trigger node called Manual Trigger to start a test run.
  2. Check if the PDF file named document.pdf appears where configured.
  3. Open the PDF file to see if it matches the original HTML layout.

Step 4: Activate for Production

  1. Once tested, activate the workflow by switching it from draft to active mode.
  2. 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)}}.pdf for 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.

Automate HTML to PDF with n8n and ConvertAPI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

It automatically changes HTML code into a PDF file and saves the PDF on your computer, removing the need for manual copying or software.
The workflow uses ConvertAPI, a remote service that accepts HTML uploads and returns PDF files.
Authentication errors happen when the ConvertAPI API Key is incorrect or not set up properly in the HTTP Query Auth credentials.
Change the filename parameter in the write file node to the desired name or use expressions to add timestamps.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.