Triage support emails and draft Gmail replies with OpenAI

Go to Workflow
0 views
Built by Thomas Abraham Thomas Abraham
Created on August 19, 2026

Description

Quick overview
This workflow monitors Gmail for new messages, detects emails by subject keywords, uses OpenAI to draft a reply grounded only in your provided guidelines, and saves the response as a Gmail draft in the original thread for manual review.

How it works
Triggers every minute when a new email arrives in Gmail.
Checks the email subject for support-style keywords (for example “pricing”, “refund”, or “help”) and continues only if it matches.
Adds your FAQ/policy text as context for the response.
Uses OpenAI (GPT-4o-mini) to generate a friendly, concise reply using only the FAQ content and the incoming email snippet.
Creates a Gmail draft reply (not sent) with “Re:” subject and the original thread ID so it stays on the same conversation.

Setup
Connect your Gmail OAuth2 credentials for both the Gmail trigger and the Gmail draft action.
Add your OpenAI credentials for the OpenAI Chat Model node.
Replace the placeholder FAQ/policy text in the FAQ context step with your real support content.
Update the subject keyword filters to match the types of support/FAQ messages you want to auto-draft replies for.

Nodes Used (5)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
Google Sheets
n8n-nodes-base.googleSheets
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi