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

Go to Workflow
1 views
Built by AI Solutions AI Solutions
Created on August 01, 2026

Description

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
A schedule trigger polls an IMAP mailbox every few hours for unread emails.
Each message is extracted and passed to an agent that scores it for relevance
Irrelevant emails are filtered out and the source message is deleted from the inbox
Relevant Emails are added to the digest
An email summary is sent to the recipient

Setup
Install the community nodes n8n-nodes-imap and @tavily/n8n-nodes-tavily (Settings → Community Nodes).
Add credentials for IMAP, OpenAI, Tavily, and Gmail OAuth2.
Set the recipient address in the Gmail — Send Digest node.
Optionally adjust the polling interval and the IMAP mailbox path
Set the cadence for you email digest

Requirements
IMAP, OpenAI, Tavily, and Gmail OAuth2 credentials
⚠️ Uses the n8n-nodes-imap and @tavily/n8n-nodes-tavily community nodes and requires a self-hosted n8n instance.

Customization
Change the polling frequency in the Schedule node.
Rewrite the topic list in OpenAI Agent — Score Relevance to target a different industry or subject.
Swap Gmail for another email node, or point the IMAP node at a specific subfolder.

Additional info
Support is available at [email protected]

Nodes Used (4)

AI Agent
@n8n/n8n-nodes-langchain.agent
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi