Openai Workflow: ChatGPT, n8n and Code
Triggered by a webhook. Connects Code, Condition, Filter, Gmail, Google Drive, Read Pdf, Respond To Webhook, Webhook. 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
Front matter
name: Openai Workflow
description: Triggered by a webhook. Connects Code, Condition, Filter, Gmail, Google Drive, Read Pdf, Respond To Webhook, Webhook. ## 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 G
category: Automation
kind: Workflow
software: Code|Condition|Filter|Gmail|Google Drive|Read Pdf|Respond To Webhook|WebhookOpenai Workflow
Triggered by a webhook. Connects Code, Condition, Filter, Gmail, Google Drive, Read Pdf, Respond To Webhook, Webhook. ## 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 G
Steps
- OpenAI (noOp)
- Configure (set)
- Iterate over email attachments (code)
- Not a PDF (noOp)
- Is text within token limit? (if)
- Merge (merge)
- Is matched (if)
- Upload file to folder (googleDrive)
- Webhook (webhook)
- Respond to Webhook (respondToWebhook)
- Create folder (googleDrive)
- Aggregate attachments (code)
- Send email with invoices? (if)
- Send to my accountant (gmail)
- Get emails with attachments (gmail)
- Read PDF email attachments (readPDF)
- Is attachment a PDF? (if)
- Optional filter for emails (filter)
- Sticky Note (stickyNote)
- Sticky Note1 (stickyNote)
Import
Download the JSON from the GitHub source and import it in n8n (Workflows, Import from file).
Source: https://github.com/Zie619/n8n-workflows/blob/main/Webhook/0892_Webhook_Code_Create_Webhook.md
Author: Zie619, n8n workflow collection. License: MIT.
Shown here with formatting for the web. Keep the author and license notice when you reuse it.
Related entries
There are more like this in the members library
The n8n workflow library holds 1,814 entries. Members can search all of them by meaning and read every one in full.