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
- Trigger node watches Google Drive folder for new files.
- If node checks if new file is a PDF.
- HTTP Request node sends PDF URL to PDF.co API for HTML conversion.
- Code node turns HTML text into a binary file format for Google Drive.
- 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
- Download the workflow file from this page.
- In the n8n editor, select Import from File and upload the downloaded workflow.
- Open the imported workflow to view all steps.
Configure Credentials and Settings
- Add Google Drive OAuth2 Credentials in n8n if not set.
- Insert the PDF.co API Key in the HTTP Request node’s HTTP Header Auth section.
- Update folder IDs or URLs in the Google Drive Trigger and upload nodes to match your folders.
- Check or edit the Code node script for output filename if needed.
Test and Activate
- Run the workflow using a test PDF in the watched Google Drive folder.
- Verify the HTML file appears in the target folder after completion.
- 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.
