Auto-detect actionable emails with OpenAI & get alert message on Teams via flow
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.
What this workflow does
This AI workflow has 6 nodes and runs when a new email arrives over IMAP. Along the way it connects OpenAI.
How it runs
Trigger: When a new email arrives over IMAP.
- OpenAI: uses OpenAI
- Extract mail details (Edit Fields (Set)): sets or maps fields
- Is mail actionable (If): checks a condition and branches into true / false
- Build gmail search URL (Code): runs custom JavaScript code
- Send alert to MS team (HTTP Request): calls an HTTP API (POST)
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- OpenAI
@n8n/n8n-nodes-langchain.openAi - Email Trigger (IMAP)
n8n-nodes-base.emailReadImap - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - HTTP Request
n8n-nodes-base.httpRequest
From the author
What It Does This workflow automatically runs when a new email is received in the user's Gmail account. It sends the email content to OpenAI (GPT-4.1-mini), which intelligently determines whether the message requires action. If the email is identified as…