Library / Files & Cloud Storage
Files & Cloud Storage
Extract and log email orders with Gmail, GPT-4o-mini, and Google Drive/Sheets
When a new email arrives, it manages files with OpenAI / ChatGPT using Gmail, Google Drive, Google Sheets.
What it does
## 📧 AI Order Creation – Email-to-Structured-Order Automation ### How it works This workflow processes incoming order emails from two sources. Pipeline 1 (Attachment emails): A Gmail trigger fires on emails with PDF or image attachments (e.g. scanned purchase orders). Each email's attachments are uploaded to an OpenAI vector store, processed by GPT-4o-mini via the Files API, and the extracted order data is saved as a CSV to Google Drive and logged to Google Sheets. If the AI extraction fails, a fallback GPT call parses the raw email text instead. Pipeline 2 (iPaper order emails): A second Gmail trigger catches forwarded iPaper order emails. A code node extracts structured order data from the email text, splits the line items, formats them, and saves the result to Drive and Sheets. Both pipelines loop over batches of emails and log each order for fulfilment or CRM sync. ### Setup steps 1. Connect Gmail OAuth2 to all Gmail nodes. 2. Connect OpenAI API to all OpenAI and HTTP nodes that call the OpenAI API. 3. Connect Google Drive OAuth2 and replace YOUR_DRIVE_FOLDER_ID in all Upload file nodes. 4. Connect Google Sheets OAuth2 and replace YOUR_GOOGLE_SHEET_ID in all Append row nodes. 5. Adjust the Gmail trigger filters to match your actual order email subjects or labels. 6. Activate all three Gmail triggers.
The steps
- Gmail Trigger
- Route by Email MIME Type
- Limit
- Get Full Email Message
- Create Vector Store
- Get Email with Attachment (Loop)
- Split Attachments
- Upload Attachment to OpenAI Files
- Aggregate Files
- Prepare Messages
- Split Out
- Uploading File to Vector Store
- Aggregate
- Wait
40 steps in total.
Similar automations
E-commerce & PaymentsSend Shopify Orders to Business Central Sales Orders31 stepsE-commerce & PaymentsSync Shopify Orders to Business Central Sales Orders131 stepsFiles & Cloud StorageExtract tasks from Google Drive screenshots with GPT-4o-mini, Sheets and Slack11 stepsAI Agents & AssistantsReview cannabis orders for compliance with GPT-5 Mini, Gmail and Google Sheets13 steps