Automate PDF to HTML Conversion with n8n and Google Drive (Free Workflow)

This n8n workflow automatically converts PDFs to HTML — extracting text, tables, and document structure for web publishing or downstream data processing. Free template included.
googleDriveTrigger
if
httpRequest
+3
Workflow Identifier: 1588
NODES in Use: Google Drive Trigger, If, HTTP Request, Code, Google Drive, Sticky Note
Automate pdf to html with n8n and Google Drive

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

Learn how to Build this Workflow with AI:
Every time a new PDF lands in your Google Drive folder, this workflow
converts it to HTML automatically — no manual steps, no copy-pasting,
no waiting.

It works like this: you (or a team member, or a client) uploads a PDF
to a designated Google Drive folder. The workflow detects it within
seconds, sends the file to the PDF.co conversion API, receives the
HTML output, and uploads the converted file back to Google Drive —
all without you touching anything.

The result is a clean HTML file sitting in your Drive folder, ready
to publish on a website, paste into a CMS, or send to a developer.

This is especially useful for content teams, legal teams, and
publishers who deal with high volumes of PDFs that need to go live
as web content — fast.

The most common business uses:

→ Extract and publish PDF reports as web pages
→ Pull table data from PDFs into structured HTML tables
→ Convert product catalogs, whitepapers, or documentation into web-ready format
→ Batch-process incoming PDFs from clients or partners into HTML automatically

Download the free workflow template below and have it running in under 15 minutes.


What This Workflow Does

This n8n workflow monitors a Google Drive folder and converts every
new PDF file to HTML automatically using the PDF.co API.

Here is the exact sequence of events when a new PDF is uploaded:

1. The Google Drive Trigger node detects the new file within
1 minute of upload (polling interval is configurable).

2. An IF node checks the file’s MIME type to confirm it is a PDF
(application/pdf). Non-PDF files are ignored and the workflow
stops — preventing failed API calls on wrong file types.

3. The HTTP Request node calls the PDF.co API endpoint:
POST https://api.pdf.co/v1/pdf/convert/to/html
It passes the Google Drive file URL and your API key.
PDF.co processes the file and returns a URL pointing to
the converted HTML content.

4. A second HTTP Request node (or Code node) fetches the HTML
content from the returned URL and converts it to binary
data — the format Google Drive needs to save a file.

5. The Google Drive node uploads the binary HTML file to your
specified output folder, naming it after the original PDF
(e.g., report.pdf becomes report.html).

Total time from PDF upload to HTML file appearing in Drive:
15–45 seconds depending on PDF size and API response time.

Here is what happens step by step:

1. A new PDF lands in your watched Google Drive folder
2. The workflow detects it and sends it to the PDF.co conversion API
3. PDF.co extracts all content — including tables, paragraphs, and headings — and returns clean HTML
4. The HTML is packaged into a file and uploaded to a separate Google Drive folder
5. The HTML file is ready to publish, embed, or edit immediately

No copy-pasting from PDFs. No manual reformatting. No lost table data. The extracted content comes out structured and web-ready every time.


Who Should Use This Workflow

Who Should Use This Workflow

Content managers and web editors: You receive PDFs from clients,
partners, or internal teams and need to publish them as web pages.
Manual conversion is slow and inconsistent. This workflow handles
every new PDF the moment it lands in Drive.

Legal and compliance teams: You process contracts, policy documents,
and regulatory filings in PDF format. Converting them to HTML makes
them searchable, linkable, and easier to embed in internal portals.

Publishers and media companies: You receive press releases, reports,
and white papers as PDFs. This workflow converts them to HTML
automatically so your editorial team can paste directly into
WordPress, Webflow, or any CMS without reformatting.

Developers and agencies: You build document management systems
for clients. This workflow drops directly into any pipeline where
PDFs need to become HTML — no custom code required.

If you or your team converts more than 5 PDFs per week manually,
this workflow pays back its setup time in the first day.


Tools and Services Used


Inputs, Processing Steps, and Output

Inputs

  • New PDF files uploaded in a Google Drive folder.

Processing Steps

  1. Trigger node watches Google Drive folder for new files.
  2. If node checks if new file is a PDF.
  3. HTTP Request node sends PDF URL to PDF.co API for HTML conversion.
  4. Code node turns HTML text into a binary file format for Google Drive.
  5. Google Drive node uploads the HTML file to a folder.

Output

  • HTML files saved in Google Drive ready for web use.

Beginner step-by-step: How to Use This Workflow in n8n

Import and Setup

  1. Download the workflow file from this page.
  2. In the n8n editor, select Import from File and upload the downloaded workflow.
  3. Open the imported workflow to view all steps.

Configure Credentials and Settings

  1. Add Google Drive OAuth2 Credentials in n8n if not set.
  2. Insert the PDF.co API Key in the HTTP Request node’s HTTP Header Auth section.
  3. Update folder IDs or URLs in the Google Drive Trigger and upload nodes to match your folders.
  4. Check or edit the Code node script for output filename if needed.

Test and Activate

  1. Run the workflow using a test PDF in the watched Google Drive folder.
  2. Verify the HTML file appears in the target folder after completion.
  3. Activate the workflow by toggling the active switch for continuous production use.

Workflow Details: How It Works Inside n8n

The workflow starts from the Google Drive Trigger node.
It looks every minute for new PDF files in a folder.
If found, an If node tests the file’s type to allow only PDFs to proceed.

Next, the HTTP Request node calls PDF.co API.
It sends PDF file link and asks for HTML format in the response.

Then the Code node takes the returned HTML text and converts it into binary data.
It formats the data so Google Drive node can upload it as an HTML file properly.

Finally, the Google Drive node uploads the new HTML file into a specified folder.
This ends the workflow cycle and keeps files organized automatically.


Customization Ideas

  • Change file names dynamically in the Code node for clear naming.
  • Add more nodes to convert PDFs into DOCX, TXT, or other formats using APIs.
  • Arrange HTML files into date-based subfolders in Google Drive for better order.
  • Adjust trigger polling speed or add batch handling to process many PDFs at once.

Common Issues and Fixes

Error: “Invalid OAuth credentials” on Google Drive nodes
Your Google Drive OAuth2 token has expired or been revoked.
Go to n8n Settings → Credentials → find your Google Drive
credential → click Reconnect → re-authorize with Google.
This usually happens after a Google account password change
or if you revoked permissions in your Google account settings.

Error: HTTP 401 Unauthorized from PDF.co API
Your PDF.co API key is missing, wrong, or placed in the
wrong header field. In the HTTP Request node, go to
Authentication → Header Auth → verify the header name
is exactly “x-api-key” (lowercase) and the value is your
full API key with no extra spaces.

Error: HTML file not appearing in Google Drive output folder
Two possible causes:
(1) The Code node is not outputting binary data correctly —
open the Code node, run it manually, and check the output
panel shows a “binary” field with MIME type “text/html”.
(2) The Google Drive upload node has the wrong folder ID —
double-check the folder ID in the node matches your actual
output folder in Drive.

Error: Workflow triggers on non-PDF files
The IF node checks MIME type to filter non-PDFs. If non-PDF
files are getting through, check the IF condition: it should
check $json.mimeType === “application/pdf”. If the MIME type
field name is different in your n8n version, use the
Expression editor to find the correct field name from
the trigger node output.

Error: PDF.co returns an error or empty HTML
Large PDFs (50+ pages) or scanned PDFs (image-only, no text
layer) may fail or return empty HTML. PDF.co’s free tier
also has a file size limit of 10MB. For scanned PDFs,
you need to enable OCR in the API request by adding
“ocr”: true to the request body. For files over 10MB,
upgrade to a PDF.co paid plan.

Error: Workflow stops after IF node with no output
If the uploaded file is not recognized as a PDF (MIME type
mismatch), the IF node routes it to the False branch where
nothing happens — this is correct behavior. Check n8n’s
execution log to see which branch was taken and what MIME
type the file reported.


Pre-Deployment Checklist

  • Verify Google Drive OAuth2 credentials are working and allowed access.
  • Test workflow by uploading a sample PDF in the watched folder.
  • Confirm HTTP Request node returns HTML from PDF.co successfully.
  • Check that the Code node converts HTML text to binary properly.
  • Ensure HTML uploads to right Google Drive folder and filename.
  • Use logs in n8n to catch and fix any errors before going live.

Deployment Guide

Once tests clear, turn on the workflow by flipping the active switch.
Monitor the first runs carefully to see that conversion and uploads work smooth.
Use n8n’s logs to find any issues if the process fails.


Summary of Results

✓ Automatically detects new PDFs in Google Drive within 60 seconds
✓ Converts PDF to clean HTML using PDF.co API — no manual steps
✓ Handles standard PDFs and scanned PDFs (with OCR option)
✓ Saves HTML file back to Google Drive with original filename
✓ Filters non-PDF files automatically — only PDFs are processed
✓ Works for any team size — share the watched folder with anyone
✓ Customizable: change output format, folder structure, file naming
✓ Free to start — PDF.co free tier + Google Drive + n8n self-hosted


Automate pdf to html with n8n and Google Drive

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes. Replace the HTTP Request node URL and authentication with the new API details that convert PDFs to HTML.
Expired or wrongly set Google Drive OAuth2 credentials cause this. Refresh or reauthorize credentials in n8n.
The Code node may not output binary data correctly. Check that binary data has the correct MIME type and is linked to upload node.
Download the workflow. Import it inside n8n using ‘Import from File’. Add needed credentials and update folder IDs. Test with a sample PDF. Then activate the workflow.
Author
Written By
Ankit Sharma

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.