(5/5)

Compose reply draft in Gmail with OpenAI Assistant

Reply draft with OpenAI Assistant This workflow automatically transfers content of incoming email messages with specific labels into OpenAI Assitant and returns reply draft. After draft is composed, trigger label is deleted from the thread. Please remember to configure your OpenAI Assistant first.

Integrations Used (4)

Workflow Structure (13 nodes)
100%
Schedule Trigger
Schedule trigger (1 min)
Gmail
Get threads with specific labels
Split In Batches
Loop over threads
Gmail
Get single message content
Langchain.open Ai
Ask OpenAI Assistant
Set
Map fields for further processing
Markdown
Convert response to HTML
Set
Build email raw
Code
Convert raw to base64
Http Request
Add email draft to thread
Gmail
Remove AI label from email
Gmail
Get thread messages
Limit
Return last message in thread
Node Types:
code
http
default
trigger
transform
logic
Requires credentials

Prerequisites

Required Credentials (2)

Gmail

Used by: Add email draft to thread, Remove AI label from email +3 more

Docs

OpenAI

Used by: Ask OpenAI Assistant

Docs

Complexity

Advanced

Expert level. Custom code, complex logic, many integrations.

Setup time: ~45 min
Score: 67/100
Custom Code
Loops
5 Integrations

When to Use This Workflow

Streamline Team Communication

Automatically route notifications and updates to the right channels and people.

Reduce information overload while keeping everyone informed.

Email Automation

Automate email responses, forwarding, or organization based on rules.

Handle routine email tasks automatically and focus on what matters.

Scheduled Operations

Run automated tasks at specific times - daily reports, weekly cleanups, monthly backups.

Set it and forget it - reliable automation that runs on your schedule.

workflow.json
{
  "nodes": [
    {
      "id": "a99b3164-fe36-4dde-9525-110c1ae08afb",
      "name": "Convert raw to base64",
      "type": "n8n-nodes-base.code",
      "position": [
        3320,
        580
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const encoded = Buffer.from($json.raw).toString('base64');\n\nreturn { encoded };"
      },
      "typeVersion": 2
    },
    {
      "id": "f0f731bd-7b2f-4c39-bc06-42fd57bc4ae8",
      "name": "Add email draft to thread",
      "type": "n8n-nodes-base.httpRequest",
...

Workflow Details

Nodes
23
Trigger
Scheduled
Source
awesome
Added
Dec 4, 2025

Need Help?

Check out the official n8n documentation for detailed guides.

Related Workflows

Send daily translated Calvin and Hobbes Comics to Discord

![](https://raw.githubusercontent.com/2innnnn0/30-Days-of-ChatGPT/refs/heads/main/datapopcornlogo50px.png) Daily Cartoo...

Schedule
Openai
Discord
Lmchatopenai
8 nodesScheduled
Curated

Email Summary Agent

- Starts the workflow every day at 7 AM. - Adjust the time if you want the workflow to run at a different hour.

Schedule
Gmail
Openai
9 nodesScheduled
Curated

Generate Instagram Content from Top Trends with AI Image Generation

All Credentials You Need Instagram Business Account Id Telegram Chat Id Rapid Api Key Replicate Token

Telegram
Schedule
Http-request
Postgres
44 nodesScheduled
Curated

Template - SSL Expiry Alert System

Automated workflow: Template - SSL Expiry Alert System. This workflow integrates 9 different services: stickyNote, httpR...

Google-sheets
Schedule
Http-request
Gmail
21 nodesScheduled

Analyze Suspicious Email Contents with ChatGPT Vision

![Gmail](https://uploads.n8n.io/templates/gmail.png) Gmail Integration and Data Extraction This section of the workflow...

Gmail
Outlook
Http-request
Openai
18 nodesEvent
Curated

Analyze & Sort Suspicious Email Contents with ChatGPT

![hctiapi](https://uploads.n8n.io/templates/hctiapi2.png) Email Body Screenshot Creation The Screenshot HTML node sends...

Gmail
Outlook
Http-request
Openai
25 nodesEvent
Curated