Triage and reply to email threads with GPT-5.2, IMAP, Gmail, and ESP suppression
Ready for 3.0What this workflow does
This AI workflow has 19 nodes and runs when a new email arrives over IMAP. Along the way it connects OpenAI and Gmail.
How it runs
Trigger: When a new email arrives over IMAP.
- Filter: keeps only the items that match a condition
- Parse Email Content (Code): runs custom JavaScript code
- Prepare AI Prompt (Code): runs custom JavaScript code
- Transfer Execution Data (Execution Data): uses Execution Data
- OpenAI: uses OpenAI
- Normalize AI Response (Code): runs custom JavaScript code
- Route by Email Status (Switch): routes items into 2 branches
- Fetch Email Thread ID (Gmail): work with thread
- Fetch Email Thread ID (Gmail): work with thread
- Reply to Email - Thread ID (Gmail): reply
…plus 8 more steps. See the full node list below.
Services it uses
Other OpenAI + Gmail templates (1,623)
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.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (9)
- Email Trigger (IMAP)
n8n-nodes-base.emailReadImap - OpenAI
@n8n/n8n-nodes-langchain.openAi - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail - HTTP Request
n8n-nodes-base.httpRequest - Data table
n8n-nodes-base.dataTable - Filter
n8n-nodes-base.filter - Execution Data
n8n-nodes-base.executionData
From the author
Quick overview Automatically read inbound email replies, use AI to detect intent and sentiment, and send natural in-thread responses. Opt-out requests are confirmed, pushed to your ESP suppression list, and logged. A hands-off reply layer that keeps your…