Zum Inhalt springen
CommunicationPro — €97

Process Gmail PDF Attachments to Google Drive via Webhook

100/100
18 Nodes

Beschreibung

Verarbeitet PDF-Anhänge aus Gmail, die über einen Webhook empfangen werden, und speichert sie in Google Drive.

Setup-Anleitung

## Gmail PDF Invoice/Receipt Classifier & Google Drive Uploader (via n8n & OpenAI)

_**DISCLAIMER**: AI classification isn't perfect. Always double-check that the correct documents were identified and uploaded._

This n8n workflow, triggered via a webhook, scans your Gmail for emails within a specified date range, extracts PDF attachments, and uses OpenAI to determine if each PDF matches a defined category (defaulting to "receipt or invoice"). Matched PDFs are then uploaded to a uniquely named Google Drive folder based on the date range. You can customize the classification term (e.g., change "receipt or invoice" to "contract") and optionally have the workflow email the collected PDFs to a specified address.

### How it works
1.  Triggers via a `Webhook` receiving a start date, end date, and an optional flag to send an email.
2.  Creates a dated folder in `Google Drive` (e.g., `invoices_YYYY-MM-DD_YYYY-MM-DD`).
3.  Fetches emails with attachments from `Gmail` within the specified date range.
4.  Iterates through each attachment, filtering specifically for `PDF` files.
5.  Extracts text from each PDF (skipping if the text exceeds token limits set in the `Configure` node).
6.  Uses the `OpenAI` node to ask if the PDF content and filename look like the item defined in the `Configure` node's "Match on" field (e.g., "receipt or invoice").
7.  If OpenAI responds with "true", the original `PDF` file is uploaded to the `Google Drive` folder created in step 2.
8.  If the initial webhook request included the flag to send an email, it aggregates all successfully matched PDFs and sends them via `Gmail` to the address specified in the `Configure` node.

Workflow written by [Tom]({{ $env.WEBHOOK_URL }}

Benötigte Integrationen (5)

Filter

Filter

Gmail

Gmail

API Key

Google API

Google Drive

API Key

Read PDF

ReadPDF

Webhook

Webhook

API Key

Workflow freischalten

Kaufe das Pro Bundle für €97 — erhalte sofortigen Zugang zu diesem und allen weiteren Starter + Pro Workflows als ZIP-Datei zum Import in n8n.

Sichere Zahlung via Stripe. 7-Tage Geld-zurück-Garantie.
← Zurück zum Marketplace