Automate PDF to HTML Conversion with n8n and Google Drive

Save hours by automatically converting newly uploaded PDFs in Google Drive to HTML files using n8n automation. This workflow streamlines document handling without manual effort.
googleDriveTrigger
if
httpRequest
+3
Workflow Identifier: 1588
NODES in Use: Google Drive Trigger, If, HTTP Request, Code, Google Drive, Sticky Note

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Workflow Does

This workflow watches a folder in Google Drive for new PDF files.
When a new PDF is added, it sends the file link to a PDF-to-HTML conversion API.
Then it turns the HTML result into a file format that Google Drive can save.
Finally, it uploads the HTML file back to a Google Drive folder.
This stops manual work and helps users get HTML versions right away.


Who Should Use This Workflow

This is for users who get many PDFs to convert to HTML fast.
It helps content managers and website editors save time and avoid mistakes.
People who want to automate file conversion linked to Google Drive benefit a lot.


Tools and Services Used

  • Google Drive: Stores and watches the PDF and HTML files.
  • n8n Automation Platform: Runs the workflow. For users hosting themselves, self-host n8n is an option.
  • PDF.co API: Converts PDF files to HTML via HTTP requests.

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.
Fix: Refresh Google Drive OAuth2 credentials in n8n settings.

Error: HTTP 401 Unauthorized from PDF.co API.
Fix: Confirm PDF.co API Key is correct and set under HTTP Header Auth.

Error: HTML file not showing up in Google Drive.
Fix: Make sure the Code node outputs proper binary with right MIME type, then link to upload node.


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

✓ Saves time by removing manual PDF to HTML conversion steps.

✓ Cuts errors from human handling of files.

✓ Keeps HTML files organized in Google Drive automatically.

→ Allows quick web content creation from PDFs without extra work.


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.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free