Automating Patient Appointment Records and Confirmations with n8n, PDF.co, Google Drive & Gmail
Prerequisites
Before you begin, make sure you have:
- A Google Form → To collect patient information (First Name, Last Name, Date of Birth, Gender, Phone, Address, Allergies, Appointment Date, etc.).
- A connected Google Sheet → Linked to the form to store responses (this acts as your workflow trigger).
- A PDF.co account + API key → To generate PDFs from HTML templates. You can get yours here
- Two PDF.co HTML templates → (e.g., Medical Record Form and Appointment Receipt).
- Example: [Link to the Medical Record Form Template]
- Example: [Link to the Appointment Receipt Template]
- A Google Drive account → To store generated PDFs.
- A Google Calendar account → To create events automatically.
- A Gmail account → To send patient confirmation emails.
- An n8n instance (cloud or self-hosted).
Quick Start Options
Option A: Import and Run Immediately
- Import the provided JSON workflow into your n8n instance.
- Connect your credentials for:
- Google Sheets
- PDF.co
- Google Drive
- Google Calendar
- Gmail
- Replace the templateId values with your own from the PDF.co Template Manager.
- Submit a new form response to test.
- Confirm:
- PDFs are created and uploaded to Google Drive.
- Calendar event appears on your Google Calendar.
- Email confirmation is sent to the patient.
Option B: Build It Step-by-Step
Follow the steps below to understand and rebuild the workflow from scratch.
Automation Overview
Here’s what the final workflow does:
- Google Sheets Trigger → Listens for new form submissions.
- Create Medical Record PDF (PDF.co) → Uses HTML template to create patient records.
- Convert to Binary File → Fetches the generated PDF for upload.
- Upload to Google Drive → Stores the record in your desired folder.
- Add Calendar Event → Automatically schedules the patient’s appointment.
- Generate Appointment Receipt (PDF.co) → Creates an appointment confirmation document.
- Convert to Binary File → Prepares the receipt for attachment.
- Send Confirmation Email (Gmail) → Sends the PDF receipt and confirmation details to the patient.
Step 1: Trigger on New Google Form Submission
Node: Google Sheets Trigger
- Event:
Row Added
- Document: Patient’s Form (Responses)
- Sheet: Form Responses 1
Success looks like: Each new form submission (a patient entry) triggers the workflow, capturing their details including name, contact, medical history, and appointment date.
Step 2: Create a Medical Record PDF Using PDF.co
Node: PDF.co API → htmlTemplateToPDF
- Template ID:
15692
(Your PDF.co template ID) - Template Data Mapping:
{
"first_name": "{{ $json['First Name'] }}",
"last_name": "{{ $json['Last Name'] }}",
"date_of_birth": "{{ $json['Date of Birth '] }}",
"gender": "{{ $json['Gender'] }}",
"primary_phone": "{{ $json['Primary Phone Number'] }}",
"home_address": "{{ $json['Home Address'] }}",
"mailing_address": "{{ $json['Mailing Address'] }}",
"current_medications": "{{ $json['Current Medications'] }}",
"allergies": "{{ $json['Allergies'] }}",
"major_medical_history": "{{ $json['Major Medical History'] }}",
"appointment_date": "{{ $json['Appointment date'] }}"
}
- Output File Name:
{{ $json["First Name"] }}_{{ $json["Last Name"] }}_Medical-Record.pdf
Success looks like: A professional, customized PDF medical record is generated and hosted by PDF.co.
Step 3: Convert PDF to Binary File
Node: HTTP Request
- URL:
={{ $json.url }}
Success looks like: The PDF is converted into binary data ready for upload.
Step 4: Upload PDF to Google Drive
Node: Google Drive
- Drive: My Drive
- Folder: OUTPUT1 (or any target folder)
Success looks like: The patient’s medical record PDF is safely uploaded to your Google Drive folder.
Step 5: Create a Google Calendar Appointment
Node: Google Calendar
- Calendar: Your linked Google Calendar
- Start & End:
={{ $('Google Sheets Trigger from Google Form').item.json['Appointment date'] }}
- Description:
"{{ First Name }} {{ Last Name }}'s Doctor's Appointment"
Success looks like: An appointment is automatically added to your Google Calendar based on the patient’s selected date.
Step 6: Generate Appointment Receipt PDF
Node: PDF.co API → htmlTemplateToPDF
- Template ID:
15694
(Your receipt template) - Template Data Mapping:
{
"first_name": "{{ $('Google Sheets Trigger from Google Form').item.json['First Name'] }}",
"last_name": "{{ $('Google Sheets Trigger from Google Form').item.json['Last Name'] }}",
"date_of_birth": "{{ $('Google Sheets Trigger from Google Form').item.json['Date of Birth '] }}",
"primary_phone": "{{ $('Google Sheets Trigger from Google Form').item.json['Primary Phone Number'] }}",
"home_address": "{{ $('Google Sheets Trigger from Google Form').item.json['Home Address'] }}",
"current_medications": "{{ $('Google Sheets Trigger from Google Form').item.json['Current Medications'] }}",
"allergies": "{{ $('Google Sheets Trigger from Google Form').item.json['Allergies'] }}",
"major_medical_history": "{{ $('Google Sheets Trigger from Google Form').item.json['Major Medical History'] }}"
}
- Output File Name:
{{ First Name }}_{{ Last Name }}_Receipt.pdf
Success looks like: A personalized appointment receipt is generated for the patient.
Step 7: Convert Receipt PDF to Binary
Node: HTTP Request
- URL:
={{ $json.url }}
Success looks like: The generated receipt is converted to a binary file ready for email attachment.
Step 8: Send Appointment Confirmation Email
Node: Gmail
- Send To:
={{ $('Google Sheets Trigger from Google Form').item.json['Mailing Address'] }}
- Subject:
Appointment_Confirmation [{{ First Name }} {{ Last Name }}]
- Message: A styled HTML confirmation email (as in your JSON), including appointment date and notes.
- Attachment: The generated binary receipt file.
Success looks like: A beautifully formatted confirmation email is sent to the patient, including their receipt.
Step 9: Final End-to-End Test
- Submit a test entry in the Google Form.
- Wait for the Google Sheets Trigger to run.
- Check:
- Google Drive → PDF record saved.
- Google Calendar → Appointment added.
- Gmail → Email confirmation sent.
Congratulations!
You’ve successfully automated your patient intake, record generation, scheduling, and communication process. Your workflow now:
- Captures patient form responses.
- Generates two polished PDF documents.
- Uploads records to Google Drive.
- Adds the appointment to Google Calendar.
Built something awesome? Share your project with the community — and tag @pdfdotco to showcase your automation!
Related Tutorials



