Email trigger (IMAP) node is not working for me. It does not trigger when a new email is created, and when triggered manually it fails.
Execution stopped at this node with the following error:
n8n may have run out of memory while running this execution. More context and tips on how to avoid this in the docs
Error details
Other info
n8n version
1.101.1 (Cloud)
Time
17/07/2025, 20:38:14
Error cause
current workflow
{
"nodes": [
{
"parameters": {
"html": "={{ $json.textHtml }}",
"options": {}
},
"id": "38f0b929-a5c6-4bf7-8460-19d5bb747a8a",
"name": "Markdown",
"type": "n8n-nodes-base.markdown",
"position": [
400,
1180
],
"typeVersion": 1
},
{
"parameters": {
"fromEmail": "={{ $('Email Trigger (IMAP)').item.json.to }}",
"toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
"subject": "=Re: {{ $('Email Trigger (IMAP)').item.json.subject }}",
"html": "={{ $('Set Email text').item.json.email }}",
"options": {}
},
"id": "df77b310-688d-40a7-9dda-077be91410cc",
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"position": [
2360,
1160
],
"webhookId": "a79ae1b4-648c-4cb4-b6cd-04ea3c1d9314",
"typeVersion": 2.1,
"credentials": {
"smtp": {
"id": "LryJYva17tVX0pYz",
"name": "SMTP account"
}
}
},
{
"parameters": {
"operationMode": "nodeInputBinary",
"options": {
"binaryDataKey": "={{ $json.data }}",
"summarizationMethodAndPrompts": {
"values": {
"combineMapPrompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used.",
"prompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used."
}
}
}
},
"id": "8d78c3a2-cc80-403c-9073-e4e8c638ca94",
"name": "Email Summarization Chain",
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
"position": [
660,
1180
],
"typeVersion": 2
},
{
"parameters": {
"promptType": "define",
"text": "=Write the text to reply to the following email:\n\n{{ $json.response.text }}",
"hasOutputParser": true,
"options": {
"systemMessage": "You are an expert at answering emails. You need to answer them professionally based on the information you have. This is a business email. Be concise and never exceed 100 words. Only the body of the email, not create the subject"
}
},
"id": "e8b3bb6a-dc40-4d56-9de6-28a581d95d79",
"name": "Write email",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1100,
1180
],
"typeVersion": 1.7
},
{
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"id": "9cdbcb10-8ccf-48d7-ab0c-69590d4d0b9f",
"name": "OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1040,
1400
],
"typeVersion": 1.2,
"credentials": {
"openAiApi": {
"id": "riktAZCs4w4yt9y4",
"name": "OpenAi account"
}
}
},
{
"parameters": {
"content": "Chain that summarizes the received email",
"height": 240,
"width": 320
},
"id": "783a7619-3207-4ce0-8afa-31471b36a199",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
1100
],
"typeVersion": 1
},
{
"parameters": {
"content": "Agent that retrieves business information from a vector database and processes the response",
"height": 220,
"width": 340
},
"id": "f45a4170-6ac0-4700-aa06-8c7fa6f517e7",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1080,
1100
],
"typeVersion": 1
},
{
"parameters": {
"content": "Convert email to Markdown format for better understanding of LLM models",
"height": 240
},
"id": "588c0f7b-3680-4786-bf30-836255460f2b",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
340,
1100
],
"typeVersion": 1
},
{
"parameters": {
"content": "If the feedback is OK send email",
"height": 180
},
"id": "d0c54e10-b5bd-4f26-92a9-120d0355cbc9",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
2060,
1140
],
"typeVersion": 1
},
{
"parameters": {
"operation": "sendAndWait",
"fromEmail": "[email protected]",
"toEmail": "[email protected]",
"subject": "=[Approval Required] {{ $('Email Trigger (IMAP)').item.json.subject }}",
"message": "=<h3>MESSAGE</h3>\n{{ $('Email Trigger (IMAP)').item.json.textHtml }}\n\n<h3>AI RESPONSE</h3>\n{{ $json.email }}",
"options": {}
},
"id": "2c4ee2a6-74e8-466c-8c46-3f0c9d704524",
"name": "Approve Email",
"type": "n8n-nodes-base.emailSend",
"position": [
1820,
1180
],
"webhookId": "4f9f06e7-9b2b-4896-9b51-245972341d12",
"typeVersion": 2.1,
"credentials": {
"smtp": {
"id": "LryJYva17tVX0pYz",
"name": "SMTP account"
}
}
},
{
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "deepseek-chat",
"cachedResultName": "deepseek-chat"
},
"options": {}
},
"id": "97efd9cd-bd5f-4d61-b3d1-2c1f18d4cc5e",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
620,
1400
],
"typeVersion": 1.2,
"credentials": {
"openAiApi": {
"id": "riktAZCs4w4yt9y4",
"name": "OpenAi account"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "35d7c303-42f4-4dd1-b41e-6eb087c23c3d",
"name": "email",
"type": "string",
"value": "={{ $json.output }}"
}
]
},
"options": {}
},
"id": "02329f8b-e275-4de5-a029-8f2a675a4a6a",
"name": "Set Email text",
"type": "n8n-nodes-base.set",
"position": [
1540,
1180
],
"typeVersion": 3.4
},
{
"parameters": {
"content": "Human in the loop",
"height": 180
},
"id": "cb4d1a6c-052a-4f9f-882f-2315c8d4ad53",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
1760,
1140
],
"typeVersion": 1
},
{
"parameters": {
"content": "# How it works\nThis workflow automates the handling of incoming emails, summarizes their content, generates appropriate responses and validate it through send IMAP email with \"Human in the loop\" system. \n\nYou can quickly integrate Gmail and Outlook via the appropriate nodes",
"height": 260,
"width": 540,
"color": 3
},
"id": "6aa44e3b-8313-4389-a6cd-b3881fcfcc8b",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
340,
780
],
"typeVersion": 1
},
{
"parameters": {
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "62e26bc5-1732-4699-a602-99490c7406fd",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.data.approved }}",
"rightValue": ""
}
]
},
"options": {}
},
"id": "bc88eefb-92a3-49d8-b3a2-b07ccdfbd3b7",
"name": "Approved?",
"type": "n8n-nodes-base.if",
"position": [
2120,
1180
],
"typeVersion": 2.2
},
{
"parameters": {
"options": {
"customEmailConfig": "[\"UNSEEN\"]"
}
},
"type": "n8n-nodes-base.emailReadImap",
"typeVersion": 2,
"position": [
140,
1200
],
"id": "c4449523-6fe2-4475-ba9c-1a6ef5b68e59",
"name": "Email Trigger (IMAP)",
"credentials": {
"imap": {
"id": "glmQhmgPWRk2dtwq",
"name": "IMAP account 5"
}
}
}
],
"connections": {
"Markdown": {
"main": [
[
{
"node": "Email Summarization Chain",
"type": "main",
"index": 0
}
]
]
},
"Email Summarization Chain": {
"main": [
[
{
"node": "Write email",
"type": "main",
"index": 0
}
]
]
},
"Write email": {
"main": [
[
{
"node": "Set Email text",
"type": "main",
"index": 0
}
]
]
},
"OpenAI": {
"ai_languageModel": [
[
{
"node": "Write email",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Approve Email": {
"main": [
[
{
"node": "Approved?",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Email Summarization Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Set Email text": {
"main": [
[
{
"node": "Approve Email",
"type": "main",
"index": 0
}
]
]
},
"Approved?": {
"main": [
[
{
"node": "Send Email",
"type": "main",
"index": 0
}
]
]
},
"Email Trigger (IMAP)": {
"main": [
[
{
"node": "Markdown",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"instanceId": "f16d11897f82cadb4d7b0c93d9b48f3285c99ad68c1d873399568e81a86c047b"
}
}
## n8n setup
- **n8n version:** 1.101.1
- **n8n EXECUTIONS_PROCESS setting (default: own, main):**
- **Running n8n via Cloud Trial Version
