Hi
What is the error message (if any)?
When I run my workflow that uses the send and wait for approval email node to get approval on an email, I can respond to it once and then I have an AI model afterwards, which should see the free text response and then rewrite the email and give it back to me based on that and then send it for approval again. However, when the loop restarts it always get’s stuck at the send and wait for approval node. If I reopen the first email and respond again then the node executes. How can I be sent a new email for each time I enter in something in the free text other than yes (confirming it’s good to go)?
Thanks for the help
I only put in the wait node for experimenting:
Please share your workflow
{
“nodes”: [
{
“parameters”: {
“operation”: “sendAndWait”,
“fromEmail”: “xxxxx”,
“toEmail”: “xxxxxx”,
“subject”: “= {{ $(‘Email Request’).item.json.subject }}”,
“message”: “={{ $(‘Email Request’).item.json.body }}”,
“responseType”: “freeText”,
“options”: {}
},
“type”: “n8n-nodes-base.emailSend”,
“typeVersion”: 2.1,
“position”: [
940,
620
],
“id”: “xxxxxxxxxxxxxxx”,
“name”: “Send Email”,
“webhookId”: “xxxxxxxxxxxxxxxxxxx”,
“credentials”: {
“smtp”: {
“id”: “xxxxxx”,
“name”: “SMTP account”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “76741b7f-a9e6-4d3b-9e49-86cafdb352b2”,
“leftValue”: “={{ $json.data.text }}”,
“rightValue”: “y”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
1180,
760
],
“id”: “0012ec55-2366-45c8-ab7d-ea05bb12093f”,
“name”: “If”
},
{
“parameters”: {
“promptType”: “define”,
“text”: “=You are a personal assistant tasked on rewriting the email based on the user input from the previous input\n\nThis is the mail:\n{{ $(‘Edit Fields’).item.json.Email }}\n\nThis is the user’s instruction: \n{{ $(‘Send Email’).item.json.data.text }}\n\nIMPORTANT: ONLY OUTPUT THE EMAIL SO IT’S READY TO BE SENT NO OTHER COMMENTS”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.9,
“position”: [
1400,
860
],
“id”: “1fa6b13c-63a6-4b99-ae5c-030f55d5c119”,
“name”: “AI Agent”
},
{
“parameters”: {
“model”: “gemma3:4b”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOllama”,
“typeVersion”: 1,
“position”: [
1440,
1080
],
“id”: “01e4bf92-8ceb-4865-9b21-c93c149aa2ae”,
“name”: “Ollama Chat Model”,
“credentials”: {
“ollamaApi”: {
“id”: “AzcES2rMQWfV5Y6k”,
“name”: “Ollama account”
}
}
},
{
“parameters”: {
“sessionIdType”: “customKey”,
“sessionKey”: “my_test_session”,
“contextWindowLength”: 10
},
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“typeVersion”: 1.3,
“position”: [
1600,
1080
],
“id”: “8287768c-4f6f-40ad-b93d-6ece9a1995e5”,
“name”: “Simple Memory”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “0aa81929-cd35-4828-80f4-55001a0be0d3”,
“name”: “Email”,
“value”: “={{ $json.email }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
440,
620
],
“id”: “1ce2fbbf-ef8a-484d-89a3-b720d80b0083”,
“name”: “Edit Fields”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “2b081eba-bc82-4eaf-bdd8-e69c0153a9d9”,
“name”: “email”,
“value”: “={{ $json.output }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
1760,
860
],
“id”: “60335a7e-2370-451e-938c-ca7133e2a2cf”,
“name”: “Edit Fields2”
},
{
“parameters”: {
“amount”: 2,
“unit”: “minutes”
},
“type”: “n8n-nodes-base.wait”,
“typeVersion”: 1.1,
“position”: [
660,
620
],
“id”: “393e2527-81fb-4688-956d-7cbe4d2f37aa”,
“name”: “Wait”,
“webhookId”: “xxxxxxxxxxxxxxxxxxxxxxxxxx”
}
],
“connections”: {
“Send Email”: {
“main”: [
[
{
“node”: “If”,
“type”: “main”,
“index”: 0
}
]
]
},
“If”: {
“main”: [
,
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“AI Agent”: {
“main”: [
[
{
“node”: “Edit Fields2”,
“type”: “main”,
“index”: 0
}
]
]
},
“Ollama Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Simple Memory”: {
“ai_memory”: [
[
{
“node”: “AI Agent”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “Wait”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields2”: {
“main”: [
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
]
]
},
“Wait”: {
“main”: [
[
{
“node”: “Send Email”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“instanceId”: “c4d888a6c7a57536c04fcf7293d2a471d0d98b93b6ae47ff133345f08478f0d4”
}
}
Share the output returned by the last node
Information on your n8n setup
- **n8n_version:1.94.1
- **Database (default: SQLite):SQLite
- **n8n EXECUTIONS_PROCESS setting (default: own, main):tool call
- **Running n8n via (Docker, npm, n8n cloud, desktop app):Docker
- **Operating system:Windows