Templates / Extract and log email orders with Gmail, GPT-4o-mini, and Google Drive/Sheets

Extract and log email orders with Gmail, GPT-4o-mini, and Google Drive/Sheets

Ready for 3.0

by Rahul Joshi ✓ · 7 views · created 2026-09-02 · Document Extraction, AI RAG

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 40 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Gmail, OpenAI, Google Drive and Google Sheets. It also calls api.openai.com over HTTP.

How it runs

Trigger: On Gmail events (plus 1 other trigger).

  1. Route by Email MIME Type (Switch): routes items into 2 branches
  2. Is iPaper Order Subject? (If): checks a condition and branches into true / false
  3. Limit: keeps the first few items
  4. Extract Email Body Fields (Edit Fields (Set)): sets 1 field: text
  5. Get Full Email Message (Gmail): get
  6. Loop Over Orders (Loop Over Items (Split in Batches)): loops over the items in batches
  7. Loop Over Emails (Loop Over Items (Split in Batches)): loops over the items in batches
  8. Parse iPaper Order Email Text (Code): runs custom JavaScript code
  9. Create Vector Store (HTTP Request): calls api.openai.com (POST)
  10. Split iPaper Order Items (Split Out): splits a list into separate items

…plus 28 more steps. See the full node list below.

Services it uses

GmailOpenAIGoogle DriveGoogle Sheets

HTTP calls to: api.openai.com

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger, Gmail Trigger - iPaper Order Emails).
Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (16)

From the author

Quick overview This workflow watches Gmail for incoming order emails, extracts structured order and line-item data using OpenAI (vector stores and GPT-4o-mini), then exports the results as CSV files to Google Drive and logs each order to Google Sheets. How it…

Excerpt from Rahul Joshi's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.