PDF Physician Query Form Generator with Automated Storage: Complete Form-to-Drive Workflow

Sep 22, 2025·5 Minutes Read

What You'll Have When Done

A fully automated system that monitors your Google Sheets for new physician queries, auto-fills professional PDF forms with patient/physician data, flattens the form fields for security, and automatically saves the completed forms to Google Drive — all within minutes.

Prerequisites

Before you begin, make sure you have:

  • A PDF.co API Key (Get yours here: https://app.pdf.co/)
  • Google Drive OAuth2 credentials configured in n8n
  • A Google Drive folder for saving completed packages
  • An n8n instance (cloud or self-hosted)
  • A Google Sheet with columns for physician query information
  • A PDF form template uploaded to PDF.co with fillable fields for physician data

Quick Start Options

Option A: I Want It Working Now

  1. Import this workflow template → Download JSON File
  2. Connect your Google Sheets account in n8n
  3. Add your PDF.co API key and upload your PDF form template
  4. Connect your Google Drive account
  5. Set up your Google Sheet with the required columns
  6. Test with a sample physician query
  7. Activate and let it run

Option B: I Want to Build It Step-by-Step Follow the 4-step guide below to create the automation from scratch.

What This Automation Does (Overview)

  • Monitors your Google Sheet for new physician queries
  • Auto-fills PDF forms with patient and physician details using PDF.co
  • Flattens form fields for tamper-proof PDF outputs
  • Downloads the PDF from PDF.co and stores it in Google Drive

Real Example: Physician query entered in Google Sheets → PDF form auto-generated → Fields flattened → PDF securely stored in Google Drive.

Step-by-Step Build Guide

Step 1: Monitor for New Physician Queries

Node: Google Sheets Trigger

Settings:

  • Document From List: Select your physician query spreadsheet
  • Sheet: Choose the sheet containing queries (Sheet1)
  • Trigger On: Row Added
  • Polling Interval: 1 minute

What This Does: Automatically detects when a new physician query is added to your spreadsheet and starts the PDF generation process.

Success Looks Like: The trigger activates within one minute when a new row is added, capturing all physician and patient information for processing.

Step 2: Generate and Flatten PDF Form

Node: PDF.co API → Fill a PDF Form

Settings:

  • URL: Upload your PDF form template to PDF.co Files, then copy the filetoken:// link
  • Form Fields Mapping (use the PDF Inspector Tool to easily identify field names and pages):
    • First Name → {{ $json['First name'] }}
    • Last Name → {{ $json['Last name'] }}
    • Gender → {{ $json['Gender'] }}
    • Designation → {{ $json['Designation'] }}
    • Physician ID → {{ $json['Physician_ID'] }}
    • Email → {{ $json['Email'] }}
    • Address → {{ $json['Address'] }}
  • Profiles (Advanced Options):

{ "FlattenDocument()": [] }

What This Does: Takes your PDF form template, fills in the form fields with data from Google Sheets, and flattens the fields to prevent further editing.

Success Looks Like: PDF.co returns a secure URL to the completed and flattened PDF form.

Step 3: Download PDF

Node: HTTP Request

Settings:

  • Method: GET
  • URL: Use the output file URL from Step 2
  • Authentication: None

What This Does: Fetches the binary data of the generated and flattened PDF.

Success Looks Like: PDF binary data appears in the output.

Step 4: Upload to Google Drive

Node: Google Drive → Upload File

Settings:

  • Input Data Field Name: data
  • File Name (Optional): PhysicianQuery-{{ $json.Physician_ID }}
  • Parent Drive: My Drive
  • Parent Folder: Select your desired Google Drive folder

What This Does: Takes the flattened PDF from PDF.co and saves it automatically to your Google Drive with a unique filename.

Success Looks Like: The completed PDF form appears in your designated Google Drive folder within seconds of submission.

Congrats!

You've created a reliable Physician Query PDF automation that takes new rows from Google Sheets, fills and flattens professional PDF forms, and saves them automatically to Google Drive.

Built something cool with this workflow? Share it with us @pdfdotco

Related Tutorials

See Related Tutorials