Auto-Process Editor Articles from Google Drive into TXT, HTML, and Compressed PDF Files

6 Minutes Read

This tutorial shows you how to build an automated editorial-processing workflow with Google Drive, n8n, and PDF.co.

When an editor uploads a PDF article to a designated Google Drive folder, the workflow will:

  1. Detect the new PDF.
  2. Create a date value for standardized filenames.
  3. Download the private Google Drive file.
  4. Upload it temporarily to PDF.co.
  5. Convert it into TXT and HTML.
  6. Create a compressed copy of the original PDF.
  7. Download all three outputs.
  8. Save each file in its designated Google Drive folder.

The resulting files will use names such as:

FeaturePlaybook_2026-08-17_Text.txt
FeaturePlaybook_2026-08-17_Web.html
FeaturePlaybook_2026-08-17_Optimized.pdf

Prerequisites

Before beginning, prepare the following:

  • An n8n account or self-hosted n8n instance
  • A PDF.co account and API key
  • A connected Google Drive account
  • One Google Drive folder for incoming PDF articles
  • One destination folder for TXT files
  • One destination folder for HTML files
  • One destination folder for compressed PDFs
  • A sample PDF article for testing

Do not use the folder IDs displayed in another user’s workflow. Select your own Google Drive folders after importing or building the workflow.

Install the PDF.co Node Before Importing

The workflow blueprint uses PDF.co’s n8n node. Install it before importing the JSON file; otherwise, the PDF.co steps may appear as missing or unknown nodes.

In n8n 1.94.0 or later:

  1. Open an existing workflow or create a new one.
  2. Open the node-selection panel.
  3. Search for PDF.co.
  4. Select the PDF.co node.
  5. Choose Install Node.

Alternatively:

  1. Go to Settings → Community Nodes.
  2. Search for: n8n-nodes-pdfco
  3. Install the package.
  4. Reload the n8n editor.

For more information, see the PDF.co n8n installation guide.

Quick Start: Import the Workflow

If you prefer to import the completed workflow, use the blueprint created specifically for this tutorial:

Download the Google Drive-to-TXT, HTML, and compressed-PDF workflow

After importing the blueprint:

  1. Connect your Google Drive account.
  2. Connect your PDF.co account.
  3. Select your source Google Drive folder.
  4. Select the destination folders for the three output formats.
  5. Confirm that every Google Drive upload node uses data as its binary input field.
  6. Test the workflow with a sample PDF.
  7. Activate the workflow after all three output files are created successfully.

Credentials and folder selections are intentionally not included in a public blueprint. You must configure them after importing.

Build the Workflow Manually

The completed workflow follows this structure:

Google Drive Trigger
└── Prepare File Metadata
    └── Download Source PDF
        └── Upload Source PDF to PDF.co
            ├── Convert to Text
            │   └── Download TXT
            │       └── Upload TXT to Google Drive
            ├── Convert to HTML
            │   └── Download HTML
            │       └── Upload HTML to Google Drive
            └── Compress PDF
                └── Download Compressed PDF
                    └── Upload PDF to Google Drive

Step 1: Watch the Source Google Drive Folder

Add a Google Drive Trigger node.

Configure it to monitor the folder where editors will upload their PDF articles.

Use settings equivalent to:

  • Trigger On: Changes involving a specific folder
  • Folder to Watch: Select your source folder
  • Event: File Created
  • Polling Interval: Select the desired interval

If the trigger supports file-type filtering, configure it to process PDF files only.

Otherwise, add an If node after the trigger and continue only when the file’s MIME type equals:

application/pdf

Test the trigger by adding a sample PDF to the source folder.

A successful result should include information such as:

  • File ID
  • File name
  • MIME type
  • Creation time

The file ID will be used to download the source PDF.

Step 2: Prepare the Date for the Output Filenames

Add a Code node after the trigger and name it:

Prepare File Metadata

Paste the following JavaScript:

return items.map(item => {
  const rawDate =
    item.json.createdTime ||
    item.json['Created At'] ||
    new Date().toISOString();

  const cleanDate = String(rawDate).split('T')[0];

  return {
    json: {
      ...item.json,
      cleanDate
    }
  };
});

This code converts a timestamp such as:

2026-08-17T19:32:44.000Z

into:

2026-08-17

The resulting cleanDate value will be used in all three output filenames.

Run the node and confirm that its output contains:

{
  "cleanDate": "2026-08-17"
}

Step 3: Download the Source PDF from Google Drive

Add a standard Google Drive node after Prepare File Metadata.

Configure it as follows:

  • Resource: File
  • Operation: Download
  • File ID:
={{ $('Google Drive Trigger').item.json.id }}

The downloaded PDF should be stored in n8n’s default binary field:

data

This step is important because a normal Google Drive webContentLink may require authentication. PDF.co cannot reliably access a private Google Drive link directly.

Downloading the file inside n8n allows the workflow to upload it securely to PDF.co without making the source folder public.

Step 4: Upload the Source PDF to PDF.co

Add a PDF.co API node and name it:

Upload Source PDF to PDF.co

Choose the action:

Upload File to PDF.co

Configure the node:

  • Authentication: Select API Key or OAuth2, depending on your connection.
  • Upload Method: Standard Upload
  • Binary File: Enabled
  • Input Binary Field: data
  • File Name:
={{ $('Google Drive Trigger').item.json.name }}

Run the node.

A successful result will include a temporary PDF.co URL:

{
  "url": "https://pdf-temp-files.s3.amazonaws.com/..."
}

The three PDF.co processing branches will use this URL as their input.

Step 5: Create the Three Processing Branches

Connect Upload Source PDF to PDF.co directly to three separate PDF.co nodes.

Do not connect the conversion nodes in a line. All three should begin from the same uploaded source PDF.

Step 6: Convert the PDF to Text

Add a PDF.co node and name it:

Convert to Text

Configure it as follows:

  • Action: Convert From PDF
  • PDF URL:
={{ $json.url }}
  • Convert Type: PDF to Text
  • Inline: Disabled
  • File Name:
=FeaturePlaybook_{{ $('Prepare File Metadata').item.json.cleanDate }}_Text.txt

Disabling inline output ensures that the workflow uses PDF.co’s output URL rather than returning the entire text inside the n8n item.

Run the node and confirm that the result contains a URL for the TXT file.

Step 7: Convert the PDF to HTML

Add another PDF.co node directly after Upload Source PDF to PDF.co and name it:

Convert to HTML

Configure it as follows:

  • Action: Convert From PDF
  • PDF URL:
={{ $json.url }}
  • Convert Type: PDF to HTML
  • Inline: Disabled
  • File Name:
=FeaturePlaybook_{{ $('Prepare File Metadata').item.json.cleanDate }}_Web.html

Run the node and confirm that the result contains a URL for the generated HTML file.

Step 8: Compress the PDF

Add a third PDF.co node directly after Upload Source PDF to PDF.co and name it:

Compress PDF

Configure it as follows:

  • Action: Compress PDF
  • PDF URL:
={{ $json.url }}
  • File Name:
=FeaturePlaybook_{{ $('Prepare File Metadata').item.json.cleanDate }}_Optimized.pdf

Run the node and confirm that it returns a URL for the compressed PDF.

Step 9: Download the Three PDF.co Outputs

PDF.co returns temporary URLs for the generated files. Google Drive’s upload operation requires binary file data, so add an HTTP Request node after each PDF.co processing node.

You will need three HTTP Request nodes:

  • Download TXT
  • Download HTML
  • Download Compressed PDF

Configure each node as follows:

  • Method: GET
  • URL:
={{ $json.url }}
  • Response Format: File
  • Binary Property: data

Run each node and inspect its execution results.

A successful download will show a Binary section containing a data entry.

If the output appears as a large text string in the JSON section, the response format has not been set to File.

Step 10: Upload the TXT File to Google Drive

Add a Google Drive node after Download TXT.

Configure it as follows:

  • Resource: File
  • Operation: Upload
  • Input Data Field Name: data
  • Parent Drive: Select the appropriate Drive.
  • Parent Folder: Select your TXT destination folder.

The file should retain the name assigned by the PDF.co conversion node:

FeaturePlaybook_YYYY-MM-DD_Text.txt

Step 11: Upload the HTML File to Google Drive

Add another Google Drive node after Download HTML.

Configure it as follows:

  • Resource: File
  • Operation: Upload
  • Input Data Field Name: data
  • Parent Drive: Select the appropriate Drive.
  • Parent Folder: Select your HTML destination folder.

The resulting file should be named:

FeaturePlaybook_YYYY-MM-DD_Web.html

Step 12: Upload the Compressed PDF to Google Drive

Add another Google Drive node after Download Compressed PDF.

Configure it as follows:

  • Resource: File
  • Operation: Upload
  • Input Data Field Name: data
  • Parent Drive: Select the appropriate Drive.
  • Parent Folder: Select your compressed-PDF archive folder.

The resulting file should be named:

FeaturePlaybook_YYYY-MM-DD_Optimized.pdf

Step 13: Test the Complete Workflow

Run the complete workflow with a sample PDF.

Confirm that:

  1. The Google Drive trigger detects the new file.
  2. cleanDate contains a valid YYYY-MM-DD date.
  3. The source PDF is downloaded as binary data.
  4. PDF.co returns a temporary URL for the uploaded source PDF.
  5. All three PDF.co branches run independently.
  6. Each HTTP Request node produces binary.data.
  7. Each output is uploaded to the correct Google Drive folder.
  8. Every filename contains the date and correct file extension.

When the test succeeds, activate the workflow.

Step 14: Troubleshooting

PDF.co Nodes Are Missing After Import

Install the PDF.co node and reload n8n:

n8n-nodes-pdfco

If the imported workflow was created with an older PDF.co node version, reopen or recreate the PDF.co nodes using these current actions:

  • Convert From PDF
  • Compress PDF
  • Upload File to PDF.co

PDF.co Cannot Access the Source PDF

Do not pass a private Google Drive webContentLink directly to PDF.co.

Make sure the workflow contains:

Google Drive: Download
PDF.co: Upload File to PDF.co

Then use the URL returned by the PDF.co upload node in all three processing branches.

Google Drive Says It Expected a Binary File

Confirm that the HTTP Request node uses:

  • Response Format: File
  • Binary Property: data

Also confirm that the Google Drive upload node uses:

data

as its Input Data Field Name.

Only One Output Is Created

The three PDF.co processing nodes must run in parallel.

Connect all three directly to Upload Source PDF to PDF.co. Do not connect Text → HTML → Compress in a sequence.

An Output Has the Wrong Extension

Include the correct extension in each PDF.co filename:

.txt
.html
.pdf

Non-PDF Files Start the Workflow

Configure PDF filtering in the Google Drive Trigger or add an If node that accepts only:

application/pdf

Files Are Uploaded to the Wrong Folder

Open each Google Drive upload node and select the correct destination folder. Do not reuse the example folder IDs from another account.

You have created an automated editorial-processing pipeline with Google Drive, n8n, and PDF.co.

When an editor adds a PDF article to the source folder, the workflow downloads the private file, uploads it to PDF.co, converts it to searchable text and web-ready HTML, creates a compressed archive copy, and saves each result in its designated Google Drive folder.

The workflow’s standardized, date-based filenames make the generated files easier to organize, search, publish, and audit.

Related Tutorials

See Related Tutorials