Parse & track orders from email with Gemini/GPT & Notion database sync
Ready for 3.0Ready 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-10-19.
Worth a look
- Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger)
Nodes used (10)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Notion Tool
n8n-nodes-base.notionTool - Gmail
n8n-nodes-base.gmail - AI Agent
@n8n/n8n-nodes-langchain.agent - Code
n8n-nodes-base.code - No Operation, do nothing
n8n-nodes-base.noOp - If
n8n-nodes-base.if
What it does
Automated Email Order Tracking System with AI Classification and Notion Sync Overview ⚠️ Self-Hosted Solution Required This workflow requires a self-hosted n8n instance with active integrations for Gmail, Google Gemini AI, OpenAI, and Notion. API credentials and database IDs must be configured before use. --- Template Image !image.png(fileId:3011) --- Description This intelligent automation system monitors your Gmail inbox for order-related emails, extracts key order information using AI, and automatically syncs the data to a Notion database for centralized order tracking. Perfect for individuals managing multiple e-commerce accounts or small businesses tracking customer orders across various platforms (Amazon, Noon, Namshi, etc.). What This Workflow Does 1. Email Monitoring: Continuously monitors Gmail inbox for new incoming emails 2. Smart Classification: Uses AI to identify order-related emails (confirmations, shipping notifications, delivery updates) 3. Intelligent Extraction: Parses email content to extract order details (order number, items, prices, status, delivery info) 4. Database Synchronization: Automatically creates or updates Notion database records with order information 5. Status Tracking: Monitors order progression through stages (Ordered → Shipped → Out for Delivery → Delivered) Key Features - Multi-vendor support: Works with any e-commerce platform (Amazon, Noon, Carrefour, Namshi, etc.) - Duplicate prevention: Searches existing records before creating new entries - Smart updates: Only modifies records when order status actually changes - Status validation: Detects backward status changes (potential returns/reshipments) - Graceful error handling: Handles missing data and optional fields intelligently - Timestamped history: Maintains audit trail of all status changes Technologies Used - Gmail Trigger: Email monitoring - JavaScript Code: Email content classification with pattern matching - Google Gemini AI / OpenAI: Natural language processing for order extraction - Structured Output Parser: JSON formatting and validation - Notion API: Database search, create, and update operations --- Prerequisites Before setting up this workflow, ensure you have: 1. Self-hosted n8n instance (version 1.0.0 or higher) 2. Gmail account with IMAP access enabled 3. Google Gemini API key OR OpenAI API key 4. Notion workspace with: - Integration access configured - Database created with the required schema (see below) - Integration token/API key --- Notion Database Schema Create a Notion database with the following properties: Required Properties | Property Name | Type | Description | |--------------|------|-------------| | Name of the Item | Title | Product/item name | | Order Number | Text | Unique order identifier | | Quantity | Number | Number of items | | Expected Date | Date or Text | Expected delivery date | | Order Status | Select | Options: Ordered, Shipped, Out for Delivery, Delivered | Optional Properties (Recommended) | Property Name | Type | Description | |--------------|------|-------------| | Vendor | Select | E-commerce platform (Amazon, Noon, etc.) | | Customer Name | Rich Text | Order recipient name | | Price | Number or Rich Text | Item price | | Order Total | Number | Total order amount | | Currency | Select | Currency code (AED, USD, SAR, etc.) | | Delivery Location | Rich Text | Delivery city/address | | Notes | Rich Text | Status change history | | Created Date | Created Time | Auto-populated by Notion | | Last Updated | Last Edited Time | Auto-populated by Notion | --- Setup Instructions Step 1: Import the Workflow 1. Copy the workflow JSON from this template 2. In your n8n instance, go to Workflows → Add Workflow → Import from File/URL 3. Paste the JSON and click Import --- Step 2: Configure Gmail Trigger 1. Click on the Gmail Trigger node 2. Click Create New Credential 3. Follow the OAuth authentication flow to connect your Gmail account 4. Configure trigger settings: - Trigger On: Message Received - Filter