Block 1 - Gmail Trigger
- Type / Role
- n8n-nodes-base.gmailTrigger - gmailTrigger
- Config choices
- Version 1.3
This workflow is provided as-is. Please review and test before using in production.
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...
n8n-nodes-base.gmailtrigger, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.notiontool, n8n-nodes-base.gmail, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.code
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jameson Kanakulya.
Original n8n.io source⚠️ 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.
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.).
Before setting up this workflow, ensure you have:
Create a Notion database with the following 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 |
| 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 |
Message Receivedgemini-1.5-pro or gemini-1.5-flashgpt-4o or gpt-4-turbohttps://notion.so/workspace/DATABASE_ID?v=...
^^^^^^^^^^^^
Click on Search a database in Notion node
Click Create New Credential
Paste your Integration Token
In the node parameters:
Order Number propertyRepeat credential setup for Create a database page in Notion and Update a database page in Notion nodes
Click on the Email Classification and Extraction Agent node
Review the system prompt (pre-configured for common order emails)
Update the {{$now}} variable if using a different timezone
(Optional) Customize extraction rules for specific vendors
Click on the Order Database Sync Agent node
Replace {{notion_database_id}} with your actual database ID in the prompt
Review status handling logic
Monitors Gmail inbox for new incoming emails and triggers the workflow when a message is received.
JavaScript code node that analyzes email content using pattern matching to identify order-related emails based on keywords, order numbers, and shipping terminology.
Routes emails based on classification results:
AI-powered parser using Google Gemini or OpenAI to extract structured order information:
Validates and formats AI extraction output into clean JSON for downstream processing.
Queries the Notion database by order number to check if a record already exists, preventing duplicates.
Intelligent database manager that decides whether to create new records or update existing ones based on search results and status comparison.
Adds new order records to Notion when no existing record is found.
Modifies existing records when order status changes, appending timestamped notes for audit history.
Terminates workflow branch for non-order emails with no further processing.
Edit the Check Email Type node to add vendor-specific keywords:
const customVendors = [
'your-vendor-name',
'vendor-domain.com'
];
Update the Email Classification and Extraction Agent prompt to add custom status values or change status progression logic.
Insert a Send Email node after database sync to receive notifications for status changes.
Configure Gmail Trigger to monitor only specific labels (e.g., "Orders", "Shopping").
Duplicate the Notion sync section to route different vendors to separate databases.
Order NumberFound a bug or have a suggestion? Please open an issue or contribute improvements to this template!
This template is provided as-is under the MIT License. Feel free to modify and distribute as needed.
Created for the n8n community to streamline e-commerce order tracking across multiple platforms.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Parse & track orders from email with Gemini/GPT & Notion database sync |
|---|---|
| Complexity | advanced |
| Nodes | 21 |
| Categories | Document Extraction, AI RAG |
| Author | Jameson Kanakulya |
| Published | 15 Oct 2025 |
Use the JSON export at /data/workflows/9689/9689.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
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...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI RAG use case.