> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/advanced-ai/recipes/gmail-ai-reply-drafts.md).

# Let AI draft Gmail replies to new emails with Duaer

In Duaer, each new email goes to a model that writes a reply, saved as a Gmail draft in the same thread. You review and send; the AI never sends for you.
## Build the reply draft flow in Duaer

1. Add [Gmail Trigger](/integrations/builtin/trigger-nodes/duaer-nodes-base.gmailtrigger.md) polling every minute, Simplify off for the body, filtered to unread.
2. Optionally add [If](/build/if.md) to skip noreply and notification senders.
3. Add [Basic LLM Chain](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm.md) with [Duaer Chat Model](/build/duaer-chat-model.md) on Chat Model. Prompt: Write a short, polite reply draft. Output only the body. Original email: {{ $json.text }}.
4. Add [Gmail](/build/gmail.md) with Resource Draft and Operation Create. Subject: Re: {{ $('Gmail Trigger').item.json.subject }}; Message: {{ $json.text }}.
5. Under Options add Thread ID {{ $('Gmail Trigger').item.json.threadId }} and To Email {{ $('Gmail Trigger').item.json.from.value[0].address }} so the draft sits in the original thread.
6. Publish the digital organization.

## Make Duaer drafts sound like you

- State your role, tone, and what not to promise in the prompt, such as Do not promise refunds; hand off to a person.
- To look up orders or calendars, swap Basic LLM Chain for an [AI Agent](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent.md) with the matching tools.
## Questions

### Does Duaer send the reply for me?

No. This Duaer flow only creates Gmail drafts; you decide whether to send.

### Why is the Duaer draft not in the original thread?

Add Thread ID under Options on the Duaer Gmail draft node, using threadId from the trigger.

## Related

- [Send mail with Gmail in Duaer](https://doc.duaer.com/build/gmail.md)
- [Pick a model in Duaer Chat Model](https://doc.duaer.com/build/duaer-chat-model.md)
- [Summarize new emails and list to-dos automatically with Duaer](https://doc.duaer.com/tasks/summarize-emails.md)
- [Fix Google invalid_grant and 7-day token expiry in Duaer](https://doc.duaer.com/troubleshooting/google-oauth-invalid-grant.md)

