Automated Gmail reply drafts with OpenAI assistant for labeled emails
Ready for 3.0What 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).
- Get threads with specific labels (Gmail): work with thread
- Loop over threads (Loop Over Items (Split in Batches)): loops over the items in batches
- Get single message content (Gmail): get
- Get thread messages (Gmail): get (thread)
- Ask OpenAI Assistant (OpenAI): work with assistant
- Return last message in thread (Limit): keeps the first few items
- Map fields for further processing (Edit Fields (Set)): sets 5 fields: response, threadId, to…
- Convert response to HTML (Markdown): converts between Markdown and HTML
- Build email raw (Edit Fields (Set)): sets 1 field: raw
- Convert raw to base (Code): runs custom JavaScript code
…plus 2 more steps. See the full node list below.
Services it uses
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)
- Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Gmail
n8n-nodes-base.gmail - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Edit Fields (Set)
n8n-nodes-base.set - Markdown
n8n-nodes-base.markdown - OpenAI
@n8n/n8n-nodes-langchain.openAi - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Limit
n8n-nodes-base.limit
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…