Skip to main content

Translate lab report PDFs for patients with Google Drive, OpenAI and Gmail

Workflow preview

Workflow preview
100%
Translate lab report PDFs for patients with Google Drive, OpenAI and Gmail preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow watches a Google Drive folder for new lab report PDFs, extracts their text, uses OpenAI (gpt 4o mini) to structure and simplify results, translates the summary into the...

Best for

  • Automation automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.googledrivetrigger, n8n-nodes-base.googledrive, n8n-nodes-base.extractfromfile, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.code, n8n-nodes-base.gmail, n8n-nodes-base.slack

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Rahul Joshi.

Original n8n.io source

1.1 Workflow description

Title
Translate lab report PDFs for patients with Google Drive, OpenAI and Gmail
Workflow name
Translate lab report PDFs for patients with Google Drive, OpenAI and Gmail

Quick Overview

This workflow watches a Google Drive folder for new lab-report PDFs, extracts their text, uses OpenAI (gpt-4o-mini) to structure and simplify results, translates the summary into the patient’s preferred language, and emails a Markdown report via Gmail, with error notifications sent to Slack.

How it works

  1. Triggers every minute when a new PDF is created in a specific Google Drive folder.
  2. Downloads the PDF from Google Drive and extracts the raw text content.
  3. Sends the extracted text to OpenAI (gpt-4o-mini) to extract structured patient/report fields, detect the report language, and capture raw findings.
  4. Cleans and parses the OpenAI JSON response to reliably carry forward patient details, report metadata, and findings.
  5. Uses OpenAI (gpt-4o-mini) to rewrite the raw findings into a warm, jargon-free plain-English Markdown summary with a “What to do next” section.
  6. Uses OpenAI (gpt-4o-mini) to translate the Markdown summary into the patient’s preferred language while preserving formatting.
  7. Builds a final Markdown report, converts it into a .md attachment, and sends it to the patient via Gmail.
  8. Posts error details to a Slack channel if extraction, simplification, or translation fails.

Setup

  1. Connect Google Drive OAuth2 credentials and set the folder ID in the Google Drive trigger to the lab-reports folder you want to monitor.
  2. Add an OpenAI API key credential (the workflow uses the gpt-4o-mini model for extraction, summarization, and translation).
  3. Connect Gmail OAuth2 credentials and ensure the recipient expression resolves to a real patient email (the workflow uses {{$json.patient_email}}).
  4. Connect Slack OAuth2 credentials and replace YOUR_SLACK_CHANNEL_ID with the channel where error alerts should be posted.
  5. Upload a sample PDF to the watched Google Drive folder and verify you receive the email with the Markdown attachment and any errors appear in Slack.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Section: File Ingestion

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Section: AI Extraction & Parsing

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Section: Plain-Language Summary

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Section: Translation & Report Assembly

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Section: Patient Email Delivery

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Credentials & Security

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Google Drive: Watch for New Lab Report

Type / Role
n8n-nodes-base.googleDriveTrigger - googleDriveTrigger
Config choices
Version 1

Block 9 - Google Drive: Download PDF

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 10 - Extract Text: Parse PDF to Raw Text

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 11 - AI: Extract Structure + Detect Language

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.4

Block 12 - Code: Parse & Sanitise Extraction JSON

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - AI: Simplify Findings to Plain English

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.4

Block 14 - Code: Attach Plain English Summary

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - AI: Translate Summary to Patient Language

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.4

Block 16 - Code: Build Final Markdown Report

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Code: Convert Report to Markdown File

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Gmail: Email Summary to Patient

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 19 - Slack: Alert on Extraction Error

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 20 - Slack: Alert on Simplification Error

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 21 - Slack: Alert on Translation Error

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

3. Summary Table

Workflow Translate lab report PDFs for patients with Google Drive, OpenAI and Gmail
Complexity advanced
Nodes 21
Categories Automation
Author Rahul Joshi
Published 16 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16427/16427.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Translate lab report PDFs for patients with Google Drive, OpenAI and Gmail do?

Quick Overview This workflow watches a Google Drive folder for new lab report PDFs, extracts their text, uses OpenAI (gpt 4o mini) to structure and simplify results, translates the summary into the...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Automation use case.