Templates / Send legal AI news digests from IMAP email with OpenAI, Tavily, and Gmail

Send legal AI news digests from IMAP email with OpenAI, Tavily, and Gmail

Needs changes

by AI Solutions ✓ · 5 views · created 2026-08-01 · Market Research, AI Summarization

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 15 nodes and runs on a schedule (every 5 hours). Along the way it connects OpenAI Chat Model, Gmail, Imap (community) and Tavily (community).

How it runs

Trigger: On a schedule (every 5 hours).

  1. Imap: work with email
  2. Set — Extract Email Fields (Edit Fields (Set)): sets 5 fields: emailUid, emailSubject, emailFrom…
  3. OpenAI Agent — Score Relevance (AI Agent): runs an AI agent, with model: OpenAI — Relevance Model
  4. Code: runs custom JavaScript code
  5. Filter: keeps only the items that match a condition
  6. Imap: delete email
  7. Aggregate: combines items into one
  8. If: checks a condition and branches into true / false
  9. OpenAI Agent — Research Topics (AI Agent): runs an AI agent, with model: OpenAI — Research Model; 1 tool (Tavily — Web Search)
  10. Code: runs custom JavaScript code

…plus 1 more step. See the full node list below.

Services it uses

OpenAI Chat ModelGmailImap (community)Tavily (community)

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 OpenAI Agent — Score Relevance (v1.9), OpenAI Agent — Research Topics (v1.9): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

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)
OpenAI Agent — Score Relevance (v1.9), OpenAI Agent — Research Topics (v1.9)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (11)

From the author

Quick overview Monitor an inbox, keep only emails about AI in the legal industry (or any topic), research each topic with web search, and email a branded HTML digest. How it works 1. A schedule trigger polls an IMAP mailbox every few hours for unread emails.…

Excerpt from AI Solutions'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.