Save Every Outlook Email as PDF in Google Drive using PDF.co and n8n

Jun 10, 2025·3 Minutes Read

What You'll Have When Done: Every Microsoft Outlook email automatically saved as a PDF into a specific Google Drive folder.

Prerequisites

Make sure you have these set up:

  • Microsoft Outlook account
  • PDF.co API Key
  • n8n instance (self-hosted or n8n.cloud)
  • Microsoft Graph OAuth2 credentials added in n8n
  • Google Drive OAuth2 credentials added in n8n

Quick Start Options

Option A: I Want It Working Now

  • Import this workflow template → Download JSON File
  • Connect your Microsoft, Google, and PDF.co accounts
  • Test with a sample email
  • Customize later if needed

Option B: I Want to Build It

Follow the 6-step guide below to create the automation from scratch.

What This Automation Does (Overview)

  1. Trigger when a new Outlook email arrives
  2. Download the email as .eml using Microsoft Graph
  3. Upload the .eml to PDF.co
  4. Convert it into a PDF
  5. Download the PDF
  6. Upload it to a Google Drive folder

Step 1: Trigger on New Outlook Email

  • Node: Microsoft Outlook → Message Received
  • Settings: Use defaults
  • Test: Click Fetch Test Event

Success Looks Like:

{
  "id": "AAMkAGE...",
  "subject": "Test Email",
  "from": {...}
}

Step 2: Download the Email as .eml

  • Node: HTTP Request
  • Settings:
    • Method: GET
    • URL: https://graph.microsoft.com/v1.0/me/messages/{{ $json.id }}/$value
    • Authentication: Generic Credential Type
    • Generic Auth Type: OAuth2 API
    • OAuth2 API: Microsoft Graph OAuth2
    • Response Format: File
    • Put Output in Field: data

Success Looks Like: A file is returned (MIME type may say text/plain, which is okay).

Step 3: Upload .eml to PDF.co

  • Node: PDF.co - Upload File
  • Settings:
    • Enable Binary Data: true
    • Input Binary Field: data
    • File Name: email.eml

Success Looks Like:

{

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

}

Step 4: Download PDF

  • Node: HTTP Request
  • Settings:
    • Method: GET
    • URL: Use output file URL from Step 4
    • Authentication: None

Success Looks Like: PDF binary data appears in output.

Step 5: Upload to Google Drive

  • Node: Google Drive → Upload File
  • Settings:
    • Input Data Field Name: data
    • File Name: (optional: use {{ $json.subject }}.pdf or a timestamp)
    • Parent Drive: My Drive
    • Parent Folder: Select your desired Google Drive folder

Success Looks Like: PDF appears in your Drive!

Final Test: End-to-End

  1. Send yourself an email
  2. Execute the full workflow
  3. Open Google Drive – your email should be there as a PDF!

Congrats! You've automated email archiving securely and paperlessly.

Built something cool? Share it with us @pdfdotco

Related Tutorials

See Related Tutorials