Automated Workflow for Intelligent Filtering of PDF Attachments via OpenAI and Uploading to Google Drive

This workflow automatically monitors the Gmail inbox and processes email attachments in real-time, intelligently identifying and filtering PDF files. It utilizes an OpenAI model to determine whether the content of the PDF matches preset keywords, and matching files are automatically uploaded to a designated Google Drive folder. This process significantly enhances document management efficiency, reduces manual intervention, and is suitable for fields such as finance and legal, helping teams achieve efficient classification and storage of email attachments.

Workflow Diagram
Automated Workflow for Intelligent Filtering of PDF Attachments via OpenAI and Uploading to Google Drive Workflow diagram

Workflow Name

Automated Workflow for Intelligent Filtering of PDF Attachments via OpenAI and Uploading to Google Drive

Key Features and Highlights

This workflow continuously monitors the Gmail inbox and, upon receiving new emails, automatically iterates through all attachments to identify and extract content from PDF files. Leveraging OpenAI models, it intelligently determines whether the PDF content contains user-defined keywords (such as “payslip,” “invoice,” etc.). Only the matching PDF files are automatically uploaded to a specified Google Drive folder.
The highlight lies in the integration of AI-based text recognition and intelligent filtering, significantly enhancing the automation and accuracy of attachment management while eliminating the tedious manual screening process.

Core Problems Addressed

Traditional email management involves time-consuming and complex tasks for filtering and archiving large volumes of email attachments, especially when automation is required based on document content keyword matching. This workflow solves the challenges of automatic identification, filtering, and categorized uploading of email attachments, reducing manual intervention and improving office efficiency.

Application Scenarios

  • Automated collection and classification of financial documents such as invoices and payslips for corporate finance departments
  • Automatic organization of contract files for legal teams
  • Any scenario requiring automatic filtering and archiving of PDF attachments based on document content
  • Intelligent management of email attachments in remote working environments

Main Process Steps

  1. Monitor the Gmail inbox and trigger actions in real-time upon receiving new emails
  2. Check if the email contains attachments; if none, terminate the process
  3. Iterate through all attachments and filter out PDF files
  4. Extract text content from PDFs and verify if the file size complies with OpenAI model token limits
  5. Invoke the OpenAI intelligent model to determine if the PDF content matches configured keywords
  6. Automatically upload matched PDF attachments to the designated Google Drive folder
  7. Skip processing for non-matching or non-PDF files

Involved Systems or Services

  • Gmail (email trigger and attachment download)
  • OpenAI (natural language processing for intelligent content matching)
  • Google Drive (cloud storage for automatic upload of matched files)
  • n8n (workflow automation platform)

Target Users and Value

  • Corporate finance, legal, and administrative personnel seeking improved document management efficiency
  • Professionals who need to automate the processing of large volumes of email attachments
  • Teams and individuals aiming to leverage AI for intelligent email attachment filtering and archiving
  • Users who want to reduce repetitive manual operations and enhance office automation

By combining intelligent AI filtering with cloud storage, this workflow enables users to achieve automated and precise management of email attachments, making the cumbersome tasks of searching and archiving attachments effortless and efficient.