Triage shared inbox emails with OpenAI and human-in-the-loop approval
Ready for 3.0What this workflow does
This AI workflow has 47 nodes and runs manually, when you click “Execute workflow” (plus 4 other triggers). Along the way it connects Gmail, Microsoft Outlook and OpenAI Chat Model.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 4 other triggers).
- Create table inbox_log (Data table): create (table)
- Configuration (Edit Fields (Set)): sets 15 fields: provider, company_name, sender_email…
- Already processed? (Data table): row not exists
- Create table inbox_knowledge (Data table): create (table)
- Normalize email (Code): runs custom JavaScript code
- Log: received (Data table): insert (row)
- Example knowledge entries (Code): runs custom JavaScript code
- Process each email separately (Execute Sub-workflow): calls another n8n workflow
- Automated or newsletter? (If): checks a condition and branches into true / false
- Insert knowledge entries (Data table): insert (row)
…plus 29 more steps. See the full node list below.
Services it uses
Other OpenAI + Gmail templates (1,623) · Other Microsoft Outlook + OpenAI templates (52) · Other Gmail + Microsoft Outlook templates (21)
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.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (New email (Gmail)).
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (19)
- Email Trigger (IMAP)
n8n-nodes-base.emailReadImap - Gmail Trigger
n8n-nodes-base.gmailTrigger - Microsoft Outlook Trigger
n8n-nodes-base.microsoftOutlookTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Execute Sub-workflow
n8n-nodes-base.executeWorkflow - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Data table
n8n-nodes-base.dataTable - If
n8n-nodes-base.if - Extract from File
n8n-nodes-base.extractFromFile - No Operation, do nothing
n8n-nodes-base.noOp - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Send Email
n8n-nodes-base.emailSend - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail - Microsoft Outlook
n8n-nodes-base.microsoftOutlook - Manual Trigger
n8n-nodes-base.manualTrigger
From the author
Quick overview This workflow monitors a shared IMAP inbox, uses OpenAI to classify each incoming email and draft a short reply, then emails the draft to an approver for one-click approval before sending the response back to the original sender. How it works…