I’m working on an AI agent project that reads the emails I receive, crafts a reply, and then saves it as a draft.
The agent works perfectly—it crafts the email and saves it in the draft without any issues. However, the problem arises when I manually approve the draft and send it to the person I received the email from. Instead of staying in the thread, it gets sent as a new email.
I’ve cross-checked everything, including the thread ID, and it all seems correct. The reply should stay in the same thread, but it doesn’t. I’m using the self-hosted version of the tool.
Any insights or suggestions to fix this would be greatly appreciated!
and this node : {
“meta”: {
“instanceId”: “15c8a3ba652c1e7f75f8a7cfe11f041c4eb96aae66f5492f945501ab9114eba0”
},
“nodes”: [
{
“parameters”: {
“resource”: “draft”,
“subject”: “={{ $(‘Gmail Trigger’).item.json.headers.subject }}”,
“emailType”: “html”,
“message”: “={{ $json.message.content }}”,
“options”: {
“threadId”: “={{ $(‘Gmail Trigger’).item.json.threadId }}”,
“sendTo”: “={{ $(‘Gmail Trigger’).item.json.from.value[0].address }}”
}
},
“type”: “n8n-nodes-base.gmail”,
“typeVersion”: 2.1,
“position”: [
2140,
-160
],
“id”: “c3099d6f-bf64-43b1-8a50-743d46a3c557”,
“name”: “Gmail”,
“webhookId”: “96e5865b-b427-481f-899e-e96390029482”,
“credentials”: {
“gmailOAuth2”: {
“id”: “QPdKszxGEwwH0wAK”,
“name”: “n8n Email Automation”
}
}
}
],
“connections”: {},
“pinData”: {}
}