Gmail creates a new mail instead of a reply draft

Hi there

:slight_smile:

I want to create a draft reply to an e-mail using N8n:

Unfortunately N8N creates a draft new mail with no recepient instead of a new mail:

{
“nodes”: [
{
“parameters”: {
“resource”: “draft”,
“subject”: “=RE: {{ $(‘Gmail Trigger’).item.json.headers.subject.replace('Subject: ', ‘’) }}\n”,
“message”: “={{ $json.message.content }}”,
“options”: {
“replyTo”: “={{ $(‘Gmail Trigger’).item.json.headers.from }}”,
“threadId”: “={{ $(‘Gmail Trigger’).item.json.threadId }}”,
“sendTo”: “={{ $(‘Gmail Trigger’).item.json.headers.from }}”
}
},
“type”: “n8n-nodes-base.gmail”,
“typeVersion”: 2.1,
“position”: [
1360,
208
],
“id”: “6e5a3eec-9f9d-4c2d-bce9-9b593655e2d4”,
“name”: “Create a draft1”,
“webhookId”: “5fa99944-d03f-46f5-913a-a3e7f2b46331”,
“credentials”: {
“gmailOAuth2”: {
“id”: “sAyFOzl9w93pAJym”,
“name”: “[email protected]
}
}
}
],
“connections”: {},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “32819fdcf614b2641160aa512ad278d3bddbc840e216318258d52b3e4e0062ae”
}
}

Are you able to help me out?

Here are my n8n setups:

n8n version:

  • Database (default: SQLite): SQLite

  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main

  • Running n8n via (Docker, npm, n8n cloud, desktop app): N8N Cloud; Google Chrome

  • Operating system: Windows 11 Pro

    Thank you in advance :slight_smile:

Hi @Noemi

At the bottom of Create a draft you can find Options and from there you have to choose Thread ID.

Thread ID points the msg to which this draft should be attached (you can take it ie. from Gmail Trigger node.