Templates / Email parser for RAG agent powered by Gmail and Mem0

Email parser for RAG agent powered by Gmail and Mem0

Needs changes

by Stephan Koning ✓ · 1,005 views · created 2025-08-07 · Document Extraction, Multimodal AI

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 10 nodes and runs on Gmail events. Along the way it connects Gmail, OpenAI Chat Model, Mistral Cloud Chat Model and Mcp (community). It also calls api.mem0.ai over HTTP.

How it runs

Trigger: On Gmail events.

  1. Set Target Email (Edit Fields (Set)): sets 10 fields: id, threadId, labelIds…
  2. Parse_Email Agent (AI Agent): runs an AI agent, with model: llm of your choice; memory: Window Buffer Memory; output parser: Auto-fixing Output Parser
  3. Add_Parsed email to memory (Mcp Client): execute tool
  4. email to mem (HTTP Request): calls api.mem0.ai (POST)

Services it uses

GmailOpenAI Chat ModelMistral Cloud Chat ModelMcp (community)

HTTP calls to: api.mem0.ai

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • AI Agent v1 (old agent modes) in Parse_Email Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
  • Also check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll).

Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).

Removed in 3.0Replace with
AI Agent v1 (old agent modes)
Parse_Email Agent (v1.7)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (10)

From the author

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Alternatively, you can delete the community node and use the HTTP node instead. Most email agent templates are fundamentally broken. They're stateless—they…

Excerpt from Stephan Koning'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.