Templates / Automated Gmail reply drafts with OpenAI assistant for labeled emails

Automated Gmail reply drafts with OpenAI assistant for labeled emails

Ready for 3.0

by Hichul · 2,230 views · created 2025-07-25 · Ticket Management, Multimodal AI

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 13 nodes and runs on a schedule (every minute). Along the way it connects Gmail and OpenAI. It also calls googleapis.com over HTTP.

How it runs

Trigger: On a schedule (every minute).

  1. Get threads with specific labels (Gmail): work with thread
  2. Loop over threads (Loop Over Items (Split in Batches)): loops over the items in batches
  3. Get single message content (Gmail): get
  4. Get thread messages (Gmail): get (thread)
  5. Ask OpenAI Assistant (OpenAI): work with assistant
  6. Return last message in thread (Limit): keeps the first few items
  7. Map fields for further processing (Edit Fields (Set)): sets 5 fields: response, threadId, to…
  8. Convert response to HTML (Markdown): converts between Markdown and HTML
  9. Build email raw (Edit Fields (Set)): sets 1 field: raw
  10. Convert raw to base (Code): runs custom JavaScript code

…plus 2 more steps. See the full node list below.

Services it uses

GmailOpenAI

HTTP calls to: googleapis.com

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (9)

From the author

n8n workflow template description template This workflow automatically drafts replies to your emails using an OpenAI Assistant, streamlining your inbox management. It's designed for support teams, sales professionals, or anyone looking to accelerate their…

Excerpt from Hichul's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.