FlowKit

n8n template · AI Inbox Pack

Generate AI reply drafts in Gmail with n8n

This workflow watches your Gmail, filters out the noise (newsletters, no-reply), then asks Claude to write a reply proposal saved as a draft in the conversation thread. AI prepares, you decide: nothing leaves without your review.

Pipelinebrouillons-reponse-ia-gmail.json · 5 nodes
  1. Nouvel email GmailtriggerGmail (trigger)
  2. Écarter newsletters et no-replyFilter
  3. Rédiger la réponseLLM chain
  4. Créer le brouillon GmailGmail

Attached AI sub-nodes

  • Modèle ClaudeAnthropic model

The problem it solves

Half of professional replies follow recurring patterns: acknowledge receipt, offer a time slot, ask for a detail, confirm handling. Writing them consumes time with no added value — but automating them as direct sends would be reckless.

The draft is the right compromise: the model writes inside the thread, with [PRICE], [DATE] placeholders wherever it can't know, and you keep control of every send. The gain is immediate, the risk zero.

How the workflow works, node by node

Node names are in French, exactly as they appear in the imported workflow — the logic is language-agnostic.

  1. 01

    Nouvel email Gmail

    Gmail (trigger)

    Polls Gmail every minute and triggers the workflow for each new message, with subject, sender, snippet and threadId.

  2. 02

    Écarter newsletters et no-reply

    Filter

    Three cumulative conditions remove no-reply senders and emails containing an unsubscribe link: we only draft where a reply makes sense.

  3. 03

    Rédiger la réponse

    LLM chain

    The prompt tightly frames the writing: direct professional tone, 1–3 short paragraphs, clear next step, placeholders for any unknown information, never an invented commitment.

  4. 04

    Modèle Claude

    Anthropic model

    Claude (Anthropic) as the ai_languageModel sub-node: particularly strong at nuanced writing. Swappable for an OpenAI model if you prefer a single bill.

  5. 05

    Créer le brouillon Gmail

    Gmail

    Creates the draft with the 'Re: …' subject directly in the original thread (threadId): it waits for you in Gmail, ready to review and send.

What you need to run it

  • n8n ≥ 1.60 with the LangChain nodes
  • A Google account with the Gmail OAuth2 credential set up in n8n
  • An Anthropic API key (or OpenAI if you swap the model sub-node)
  • Your signature to fill in the prompt (placeholders provided)

Customization ideas

  • Restrict to emails addressed directly to you (filter on the to field) to skip CCs
  • Feed the prompt your style guide: informal address, house phrases, default language
  • Limit to business hours by inserting an IF on the current time after the trigger

FAQ

Frequently asked questions

How do I import this template into n8n?

Import brouillons-reponse-ia-gmail.json via 'Import from File', connect your Gmail OAuth2 credential on the trigger and draft nodes, your Anthropic key on the model, customize the signature in the prompt, then activate.

Can the workflow send an email on its own?

No. The final node creates a draft (resource draft), never a send. That's deliberate: switching to auto-send would require explicitly changing the operation — we advise against it for client replies.

Why Claude rather than GPT for this use case?

For writing quality and adherence to caution rules (placeholders, no invented commitments). The model sub-node remains swappable in two clicks if your preference differs.