This workflow corresponds to n8n.io template #8336 — we link there as the canonical source.
This workflow follows the Agent → OpenRouter Chat recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "ZrzN9UGogerbca4m",
"meta": {
"templateId": "2454",
"templateCredsSetupCompleted": true
},
"name": "Fully Automatic Categorise Outlook Emails with AI",
"tags": [],
"nodes": [
{
"id": "d16f59dd-f54e-487b-9aac-67f109ba9869",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
1424,
-192
],
"parameters": {
"color": 7,
"width": 872,
"height": 111,
"content": "# Fully Automatic Categorise Outlook Emails with AI\nBuilt by [Can KURT](https://github.com/ck-cankurt/) at [ubden.com](https://ubden.com)"
},
"typeVersion": 1
},
{
"id": "d4969259-a3ae-473d-82ef-0c9f7933c899",
"name": "Loop Over Items1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1440,
64
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "ebf606f9-099c-4218-b23b-66e2487262d0",
"name": "Markdown1",
"type": "n8n-nodes-base.markdown",
"notes": "Converts the body of the email to markdown",
"position": [
1680,
64
],
"parameters": {
"html": "={{ $('Loop Over Items1').item.json.body.content }}",
"options": {}
},
"notesInFlow": true,
"typeVersion": 1
},
{
"id": "ff447dd5-3ef6-4a02-8453-3489af8bf6b5",
"name": "varEmal1",
"type": "n8n-nodes-base.set",
"notes": "Set email fields",
"position": [
1856,
64
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "edb304e1-3e9f-4a77-918c-25646addbc53",
"name": "subject",
"type": "string",
"value": "={{ $json.subject }}"
},
{
"id": "57a3ef3a-2701-40d9-882f-f43a7219f148",
"name": "importance",
"type": "string",
"value": "={{ $json.importance }}"
},
{
"id": "d8317f4f-aa0e-4196-89af-cb016765490a",
"name": "sender",
"type": "object",
"value": "={{ $json.sender.emailAddress }}"
},
{
"id": "908716c8-9ff7-4bdc-a1a3-64227559635e",
"name": "from",
"type": "object",
"value": "={{ $json.from.emailAddress }}"
},
{
"id": "ce007329-e221-4c5a-8130-2f8e9130160f",
"name": "body",
"type": "string",
"value": "={{ $json.data\n .replace(/<[^>]*>/g, '') // Remove HTML tags\n .replace(/\\[(.*?)\\]\\((.*?)\\)/g, '') // Remove Markdown links like [text](link)\n .replace(/!\\[.*?\\]\\(.*?\\)/g, '') // Remove Markdown images like \n .replace(/\\|/g, '') // Remove table separators \"|\"\n .replace(/-{3,}/g, '') // Remove horizontal rule \"---\"\n .replace(/\\n+/g, ' ') // Remove multiple newlines\n .replace(/([^\\w\\s.,!?@])/g, '') // Remove special characters except essential ones\n .replace(/\\s{2,}/g, ' ') // Replace multiple spaces with a single space\n .trim() // Trim leading/trailing whitespace\n}}\n"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "0a19d15c-0cd3-4f26-9be2-4914522751fb",
"name": "Filter1",
"type": "n8n-nodes-base.filter",
"position": [
1248,
64
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c8cd6917-f94e-4fb7-8601-b8ed8f1aa8bf",
"operator": {
"type": "array",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $json.categories }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "96e6e31c-6306-44a8-a57a-2b5216636b00",
"name": "If1",
"type": "n8n-nodes-base.if",
"notes": "Checks if the email has been read",
"position": [
2592,
288
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "f8cf2a56-cea8-4150-b7a0-048dbda20f2f",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.isRead }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "e2d8e7b5-4447-4327-9f4e-b8d52765667e",
"name": "Catch Errors1",
"type": "n8n-nodes-base.set",
"position": [
1184,
528
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "0dc6d439-60fb-49f6-b4d5-f5cce6f030ad",
"name": "error",
"type": "string",
"value": "={{ $json }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "17f6ac43-51e4-4bee-b0d8-13deb3bf3cc9",
"name": "varJSON1",
"type": "n8n-nodes-base.set",
"onError": "continueErrorOutput",
"position": [
1168,
288
],
"parameters": {
"options": {
"ignoreConversionErrors": true
},
"assignments": {
"assignments": [
{
"id": "0c52f57f-74eb-4385-ac6b-f3e5f4f50e73",
"name": "output",
"type": "object",
"value": "={{ $json.output.replace(/^.*?({.*}).*$/s, '$1') }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "85ff0348-16dc-46e6-bf70-48a10fe0ded8",
"name": "AI Agent1",
"type": "@n8n/n8n-nodes-langchain.agent",
"onError": "continueErrorOutput",
"position": [
848,
288
],
"parameters": {
"text": "=Categorise the following email\n<email>\n{{ $('varEmal1').first().json.toJsonString() }}\n</email>\n\nEnsure your final output is valid JSON with no additional text or token in the following format:\n\n{\n \"subject\": \"SUBJECT_LINE\",1\n \"category\": \"CATEGORY\",\n \"subCategory\": \"SUBCATEGORY\", //use sparingly\n \"analysis\": \"ANALYSIS_REASONING\"\n}\n\nRemember you can only use ONE of the following categories {{ $json.category }}. No other categories can be used. Use the subcategory for additional context, for example, if a SaaS email requires action, or if a business email requires action. Do not create any additional subcategories, you can only use ONE of the following {{ $json.category }}",
"options": {
"systemMessage": "=You are an advanced AI email categorization system for a freelance developer. Your mission is to intelligently analyze and categorize emails with maximum accuracy and context awareness.\n\n**INTELLIGENT CATEGORIZATION ENGINE:**\n\n**Phase 1 - Dynamic Category Processing:**\n- Parse and interpret all available categories from {{ $json.category }}\n- Automatically detect category hierarchies and relationships\n- Build intelligent mapping between email characteristics and categories\n\n**Phase 2 - Multi-Layer Email Analysis:**\n- **Sender Intelligence**: Domain reputation, email patterns, historical behavior\n- **Subject Line Analysis**: Keywords, urgency indicators, spam patterns, language detection\n- **Content Deep Scan**: Body text analysis, link analysis, attachment detection, HTML structure\n- **Contextual Understanding**: Business relevance, timing, frequency patterns\n- **Spam/Threat Detection**: Advanced phishing detection, scam patterns, malicious content identification\n\n**Phase 3 - Advanced Decision Logic:**\n\n**PRIORITY CATEGORIZATION RULES:**\n1. **SECURITY THREATS** \u2192 Immediate junk classification for phishing, scams, suspicious links\n2. **ACTION REQUIRED** \u2192 Critical business emails needing immediate response get \"Action\" category\n3. **BUSINESS CONTEXT** \u2192 Legitimate business communications vs promotional content distinction\n4. **SENDER REPUTATION** \u2192 Known vendors/partners vs unknown senders treatment\n5. **CONTENT ANALYSIS** \u2192 Marketing language detection vs technical communication\n6. **URGENCY DETECTION** \u2192 Time-sensitive content identification\n\n**SPECIALIZED CATEGORIZATION INTELLIGENCE:**\n- **Domain/Hosting/Server**: Automatically detect hosting providers, domain registrars, server notifications\n- **SaaS Action Items**: Distinguish between promotional SaaS emails vs critical system notifications\n- **E-commerce Detection**: Advanced marketplace email recognition (Amazon, local platforms)\n- **Financial Intelligence**: Invoice detection, payment confirmations, banking communications\n- **Support Ticket Analysis**: Technical support vs general customer service distinction\n- **Corporate Communication**: Contract emails, official business correspondence detection\n\n**ANTI-SPAM INTELLIGENCE:**\n- **Marketing Pattern Detection**: Newsletter signatures, unsubscribe links, promotional language\n- **Emoji Spam Detection**: Excessive emoji usage indicating promotional content\n- **Subject Line Red Flags**: Discount offers, limited time offers, \"act now\" language\n- **Sender Spoofing Detection**: Fake sender analysis, domain verification\n- **Content Authenticity**: Legitimate business communication vs mass marketing\n\n**DUAL CATEGORY LOGIC:**\n- Primary category assignment based on email nature\n- Secondary category for action requirements or business context\n- Smart combination logic (e.g., \"Technology & SaaS\" + \"Action\" for critical system alerts)\n\n**CONTEXTUAL LEARNING PATTERNS:**\n- Developer-specific email patterns recognition\n- Client communication identification\n- Project-related correspondence detection\n- Vendor relationship understanding\n- Support ticket escalation recognition\n\n**OUTPUT PRECISION:**\nReturn only valid JSON with enhanced analysis:\n{\n \"subject\": \"EXACT_EMAIL_SUBJECT\",\n \"category\": \"PRIMARY_CATEGORY_FROM_AVAILABLE_LIST\",\n \"subCategory\": \"SECONDARY_CATEGORY_IF_APPLICABLE\",\n \"analysis\": \"Detailed reasoning explaining categorization decision with specific indicators found\",\n \"confidence\": \"HIGH/MEDIUM/LOW based on analysis certainty\"\n}\n\n**AVAILABLE CATEGORIES:** {{ $json.category }}\n\n**CRITICAL INSTRUCTIONS:**\n- Use ONLY categories from the provided list\n- Never create new categories\n- Prioritize accuracy over speed\n- When uncertain, err on the side of caution (prefer Action category for potentially important emails)\n- Always provide detailed analysis reasoning\n- Consider the freelance developer context in all decisions\n\nAnalyze the email in <email> tags and provide intelligent categorization."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.6
},
{
"id": "93e7be79-9035-4b58-9a83-b9182a0515f8",
"name": "Merge1",
"type": "n8n-nodes-base.merge",
"position": [
2400,
288
],
"parameters": {},
"typeVersion": 3
},
{
"id": "b0972a88-e3c8-450c-a66f-eb4af5d8f868",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
2416,
64
],
"parameters": {
"jsCode": "// Gelen de\u011fer array olabilir\nconst raw = $json.appended_displayName;\n\n// Array olup olmad\u0131\u011f\u0131n\u0131 kontrol et, stringe \u00e7evir\nlet output;\nif (Array.isArray(raw)) {\n output = raw.join(\", \");\n} else {\n output = String(raw);\n}\n\nreturn {\n cleanedString: output\n};\n"
},
"typeVersion": 2
},
{
"id": "314869ec-fc75-4789-981b-5ada18b5b27c",
"name": "Get many folders",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
2064,
64
],
"parameters": {
"filters": {
"filter": ""
},
"options": {
"fields": [
"displayName",
"childFolderCount"
],
"includeChildFolders": true
},
"resource": "folder",
"operation": "getAll",
"returnAll": true
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "40313f17-5ede-4d85-9b29-410c14eeee57",
"name": "Summarize",
"type": "n8n-nodes-base.summarize",
"position": [
2240,
64
],
"parameters": {
"options": {},
"fieldsToSummarize": {
"values": [
{
"field": "displayName",
"aggregation": "append",
"includeEmpty": true
}
]
}
},
"typeVersion": 1.1
},
{
"id": "fab488d0-033f-4d10-92e1-c3ae83c8fe3c",
"name": "VarID Category",
"type": "n8n-nodes-base.set",
"position": [
2608,
64
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "de2ad4f2-7381-4715-a3f4-59611e161b74",
"name": "id",
"type": "string",
"value": "={{ $('RecievedEmail').item.json.id }}"
},
{
"id": "ea74a279-6763-4b67-9eb4-5e347e1d32f4",
"name": "category",
"type": "string",
"value": "={{ $json.cleanedString }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "46f626c0-fccb-4117-a744-7bbae8f63be7",
"name": "Get many folders1",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
1440,
288
],
"parameters": {
"filters": {},
"options": {
"fields": [
"displayName",
"childFolderCount",
"parentFolderId"
],
"includeChildFolders": true
},
"resource": "folder",
"operation": "getAll",
"returnAll": true
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "9a98c939-d5b9-4a35-ae55-aa273d899168",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
1664,
288
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "cccc6725-7053-4064-bef6-1c6b07dee680",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('varJSON1').item.json.output.category }}",
"rightValue": "={{ $json.displayName }}"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "e885cfdf-e498-493b-b4f3-a26c651ff239",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
848,
64
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"minutesInterval": 1
}
]
}
},
"typeVersion": 1.2
},
{
"id": "0583e196-37a5-43db-8c0a-aa624029c926",
"name": "RecievedEmail",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
1040,
64
],
"parameters": {
"limit": 1,
"fields": [
"flag",
"from",
"importance",
"replyTo",
"sender",
"subject",
"toRecipients",
"body",
"categories",
"isRead"
],
"output": "fields",
"options": {},
"filtersUI": {
"values": {
"filters": {
"custom": "flag/flagStatus eq 'notFlagged' and not categories/any()",
"foldersToInclude": [
"AQMkAGExN2Q4YTQ0AC01NDI4LTRhNmYtODYwZS05YzU0YzE5MzAyZjQALgAAA9jkZp65v9BIjLPAC68z-1MBAKhQNfuxpX5CpnvHa8QQO84AAAIBDAAAAA=="
]
}
}
},
"operation": "getAll"
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "a70910ff-2716-427a-8e47-7a5e4b22384f",
"name": "Update Category",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
1936,
272
],
"parameters": {
"messageId": {
"__rl": true,
"mode": "id",
"value": "={{ $('VarID Category').item.json.id }}"
},
"operation": "update",
"updateFields": {
"categories": "={{ \n [$('varJSON1').first().json.output.category, $('varJSON1').first().json.output.subCategory]\n .filter(item => item && item.trim() !== \"\")\n .map(item => item.charAt(0).toUpperCase() + item.slice(1))\n}}"
}
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "88b8d031-249c-445d-9c74-0ac928a847ff",
"name": "Move Folder",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
2160,
272
],
"parameters": {
"folderId": {
"__rl": true,
"mode": "id",
"value": "={{ $('If').item.json.id }}"
},
"messageId": {
"__rl": true,
"mode": "id",
"value": "={{ $('VarID Category').item.json.id }}"
},
"operation": "move"
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "6360c01a-f285-4653-97df-1a0e23c5e806",
"name": "OpenRouter Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
784,
528
],
"parameters": {
"model": "deepseek/deepseek-chat-v3.1:free",
"options": {}
},
"credentials": {
"openRouterApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "553437d9-6a18-4748-a4e3-10c35740c379",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"onError": "continueErrorOutput",
"position": [
944,
832
],
"parameters": {
"text": "=Categorise the following email\n<email>\n{{ $('varEmal1').first().json.toJsonString() }}\n</email>\n\nEnsure your final output is valid JSON with no additional text or token in the following format:\n\n{\n \"subject\": \"SUBJECT_LINE\",1\n \"category\": \"CATEGORY\",\n \"subCategory\": \"SUBCATEGORY\", //use sparingly\n \"analysis\": \"ANALYSIS_REASONING\"\n}\n\nRemember you can only use ONE of the following categories {{ $json.category }}. No other categories can be used. Use the subcategory for additional context, for example, if a SaaS email requires action, or if a business email requires action. Do not create any additional subcategories, you can only use ONE of the following {{ $json.category }}",
"options": {
"systemMessage": "=You are an advanced AI email categorization system for a freelance developer. Your mission is to intelligently analyze and categorize emails with maximum accuracy and context awareness.\n\n**INTELLIGENT CATEGORIZATION ENGINE:**\n\n**Phase 1 - Dynamic Category Processing:**\n- Parse and interpret all available categories from {{ $json.category }}\n- Automatically detect category hierarchies and relationships\n- Build intelligent mapping between email characteristics and categories\n\n**Phase 2 - Multi-Layer Email Analysis:**\n- **Sender Intelligence**: Domain reputation, email patterns, historical behavior\n- **Subject Line Analysis**: Keywords, urgency indicators, spam patterns, language detection\n- **Content Deep Scan**: Body text analysis, link analysis, attachment detection, HTML structure\n- **Contextual Understanding**: Business relevance, timing, frequency patterns\n- **Spam/Threat Detection**: Advanced phishing detection, scam patterns, malicious content identification\n\n**Phase 3 - Advanced Decision Logic:**\n\n**PRIORITY CATEGORIZATION RULES:**\n1. **SECURITY THREATS** \u2192 Immediate junk classification for phishing, scams, suspicious links\n2. **ACTION REQUIRED** \u2192 Critical business emails needing immediate response get \"Action\" category\n3. **BUSINESS CONTEXT** \u2192 Legitimate business communications vs promotional content distinction\n4. **SENDER REPUTATION** \u2192 Known vendors/partners vs unknown senders treatment\n5. **CONTENT ANALYSIS** \u2192 Marketing language detection vs technical communication\n6. **URGENCY DETECTION** \u2192 Time-sensitive content identification\n\n**SPECIALIZED CATEGORIZATION INTELLIGENCE:**\n- **Domain/Hosting/Server**: Automatically detect hosting providers, domain registrars, server notifications\n- **SaaS Action Items**: Distinguish between promotional SaaS emails vs critical system notifications\n- **E-commerce Detection**: Advanced marketplace email recognition (Amazon, local platforms)\n- **Financial Intelligence**: Invoice detection, payment confirmations, banking communications\n- **Support Ticket Analysis**: Technical support vs general customer service distinction\n- **Corporate Communication**: Contract emails, official business correspondence detection\n\n**ANTI-SPAM INTELLIGENCE:**\n- **Marketing Pattern Detection**: Newsletter signatures, unsubscribe links, promotional language\n- **Emoji Spam Detection**: Excessive emoji usage indicating promotional content\n- **Subject Line Red Flags**: Discount offers, limited time offers, \"act now\" language\n- **Sender Spoofing Detection**: Fake sender analysis, domain verification\n- **Content Authenticity**: Legitimate business communication vs mass marketing\n\n**DUAL CATEGORY LOGIC:**\n- Primary category assignment based on email nature\n- Secondary category for action requirements or business context\n- Smart combination logic (e.g., \"Technology & SaaS\" + \"Action\" for critical system alerts)\n\n**CONTEXTUAL LEARNING PATTERNS:**\n- Developer-specific email patterns recognition\n- Client communication identification\n- Project-related correspondence detection\n- Vendor relationship understanding\n- Support ticket escalation recognition\n\n**OUTPUT PRECISION:**\nReturn only valid JSON with enhanced analysis:\n{\n \"subject\": \"EXACT_EMAIL_SUBJECT\",\n \"category\": \"PRIMARY_CATEGORY_FROM_AVAILABLE_LIST\",\n \"subCategory\": \"SECONDARY_CATEGORY_IF_APPLICABLE\",\n \"analysis\": \"Detailed reasoning explaining categorization decision with specific indicators found\",\n \"confidence\": \"HIGH/MEDIUM/LOW based on analysis certainty\"\n}\n\n**AVAILABLE CATEGORIES:** {{ $json.category }}\n\n**CRITICAL INSTRUCTIONS:**\n- Use ONLY categories from the provided list\n- Never create new categories\n- Prioritize accuracy over speed\n- When uncertain, err on the side of caution (prefer Action category for potentially important emails)\n- Always provide detailed analysis reasoning\n- Consider the freelance developer context in all decisions\n\nAnalyze the email in <email> tags and provide intelligent categorization."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.6
},
{
"id": "e8ce531c-28ad-4ce9-bbd2-a215e60c00ed",
"name": "OpenRouter Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
976,
1024
],
"parameters": {
"model": "deepseek/deepseek-chat-v3.1:free",
"options": {}
},
"credentials": {
"openRouterApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
}
],
"active": true,
"settings": {},
"versionId": "97d331c2-d67e-475e-a2a8-f617060d3cc1",
"connections": {
"If": {
"main": [
[
{
"node": "Update Category",
"type": "main",
"index": 0
}
],
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
],
[]
]
},
"Code": {
"main": [
[
{
"node": "VarID Category",
"type": "main",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Filter1": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "varJSON1",
"type": "main",
"index": 0
}
]
]
},
"varEmal1": {
"main": [
[
{
"node": "Get many folders",
"type": "main",
"index": 0
}
]
]
},
"varJSON1": {
"main": [
[
{
"node": "Get many folders1",
"type": "main",
"index": 0
}
],
[
{
"node": "Catch Errors1",
"type": "main",
"index": 0
}
]
]
},
"AI Agent1": {
"main": [
[
{
"node": "varJSON1",
"type": "main",
"index": 0
}
],
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Markdown1": {
"main": [
[
{
"node": "varEmal1",
"type": "main",
"index": 0
}
]
]
},
"Summarize": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Move Folder": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"Catch Errors1": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"RecievedEmail": {
"main": [
[
{
"node": "Filter1",
"type": "main",
"index": 0
}
]
]
},
"VarID Category": {
"main": [
[
{
"node": "AI Agent1",
"type": "main",
"index": 0
}
]
]
},
"Update Category": {
"main": [
[
{
"node": "Move Folder",
"type": "main",
"index": 0
}
]
]
},
"Get many folders": {
"main": [
[
{
"node": "Summarize",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items1": {
"main": [
null,
[
{
"node": "Markdown1",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "RecievedEmail",
"type": "main",
"index": 0
}
]
]
},
"Get many folders1": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenRouter Chat Model1": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
microsoftOutlookOAuth2ApiopenRouterApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
> Zero manual mapping. The workflow automatically discovers your Outlook folders, understands the context, assigns the correct category, and moves the email into the right folder. It uses the original Microsoft Outlook nodes plus an AI Agent. You can connect OpenAI or any…
Source: https://n8n.io/workflows/8336/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
VeilleGPT copy. Uses agent, httpRequestTool, slackTool, notionTool. Scheduled trigger; 14 nodes.
Complete PostgreSQL-backed system: Keyword scoring → AI research → Multi-part content generation → fal.ai Nano Banana image generation → WordPress publishing
> Transform Your Email Workflow with Intelligent Automation
This workflow is for beauty salons who want consistent, high‑quality social media content without writing every post manually. It also suits agencies and automation builders who manage multiple beauty
Automate Microsoft Teams Meeting Analysis with GPT-4.1, Outlook & Mem.ai Watch the YouTube video to get started Follow along with the blog post