You are helping me build the following AI agent workflow. ## Goal Parse And Track Orders From Email: Monitors Gmail for order emails, uses AI to extract details like number and status, then syncs them to Notion while preventing duplicates. ## Specification - What it does: You automatically track your orders by having this agent scan Gmail for new emails, extract details like order numbers and status using AI, and sync them directly to Notion without creating duplicates. It keeps your database up to date whenever an order status changes so you always have the latest information in one place. - Trigger: Triggered by an event (Event ยท on new email in Gmail) - Autonomy: Fully hands-off - Expected setup effort: a few focused days - Tools/services involved: - Gmail: Monitor inbox for order emails - Google Gemini Chat Model: Extract structured order data from email text - Code: Classify emails using pattern matching - Notion API: Sync order records to database ## Known pitfalls, handle each one explicitly in your implementation 1. Email formatting varies widely so add a robust system prompt that handles HTML tags and inconsistent layouts gracefully. 2. Notion API has strict property type requirements so validate the extracted data types before sending them to the database. 3. Gmail triggers can fire on internal notifications so add a filter in your code step to ignore automated system emails from your own domain. ## Reference implementation https://n8n.io/workflows/9689 (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/parse-and-track-orders-from-email-with-ai/ via usecasesforagents.com