{"product_id":"n8n-gmail-order-extractor-gpt-4o-mini-to-google-sheets","title":"n8n Gmail Order Extractor: GPT-4o-mini to Google Sheets","description":"\u003ch3\u003eTurn Gmail order emails into structured spreadsheets automatically\u003c\/h3\u003e\n\u003cp\u003eThe \u003cstrong\u003en8n Gmail Order Extractor (GPT-4o-mini to Google Sheets)\u003c\/strong\u003e workflow monitors your Gmail for incoming order messages, extracts order headers and line items with \u003cstrong\u003eOpenAI (vector stores + GPT-4o-mini)\u003c\/strong\u003e, then exports results as \u003cstrong\u003eCSV files\u003c\/strong\u003e to \u003cstrong\u003eGoogle Drive\u003c\/strong\u003e and logs each order to \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eChecks new Gmail messages every minute\u003c\/strong\u003e and routes emails based on MIME type (attachments vs. other formats).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFor attachment-based orders:\u003c\/strong\u003e downloads attachments from Gmail, uploads them to OpenAI Files, creates an OpenAI \u003cstrong\u003evector store\u003c\/strong\u003e, and attaches the uploaded files to it.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWaits for vector store processing\u003c\/strong\u003e, then queries \u003cstrong\u003eGPT-4o-mini\u003c\/strong\u003e using \u003cem\u003efile search against the vector store\u003c\/em\u003e to extract structured \u003cstrong\u003eorder details and all line items\u003c\/strong\u003e as JSON.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eConverts extracted items into CSV\u003c\/strong\u003e, then \u003cstrong\u003euploads the CSV to a specified Google Drive folder\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAI fallback handling:\u003c\/strong\u003e if the extraction indicates an error, it calls the \u003cstrong\u003eOpenAI Chat Completions API\u003c\/strong\u003e as a fallback parser, converts results to CSV, uploads to Google Drive, and \u003cstrong\u003elogs the order link and key customer\/order fields\u003c\/strong\u003e in Google Sheets.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSecondary pipeline for forwarded iPaper emails:\u003c\/strong\u003e triggers on forwarded iPaper order emails in Gmail, parses email text with custom logic, exports line items to CSV, uploads to Google Drive, and appends an order log row to Google Sheets.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAutomatically capture orders sent via email with attachments and keep an up-to-date fulfillment spreadsheet.\u003c\/li\u003e\n  \u003cli\u003eNormalize order line items into CSV for inventory, shipping, or reporting pipelines.\u003c\/li\u003e\n  \u003cli\u003eReduce manual copy\/paste from customer emails to Google Sheets and Drive.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n triggers \u0026amp; nodes:\u003c\/strong\u003e Gmail, if, set, code, wait, limit\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOpenAI:\u003c\/strong\u003e OpenAI Files + vector store, then GPT-4o-mini with file search; fallback via OpenAI Chat Completions API\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eExports \u0026amp; logging:\u003c\/strong\u003e CSV uploads to Google Drive and order logging to Google Sheets\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSetup:\u003c\/strong\u003e add \u003cstrong\u003eGmail OAuth\u003c\/strong\u003e\n\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45945717620915,"sku":"N8N-19084","price":55.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/0TLLmgX0u2YipouMA-c5v_BYBGH8mK.png?v=1788426807","url":"https:\/\/buyflowscripts.com\/products\/n8n-gmail-order-extractor-gpt-4o-mini-to-google-sheets","provider":"N8N Commerce","version":"1.0","type":"link"}