Latenode

Streamline your Gmail-to-ChatGPT workflow with automated conversations

This template watches Gmail for new messages, cleans the body in JavaScript, asks ChatGPT for a reply, and saves that text as a Gmail draft reply.

Connect Gmail with permission to read mail and create drafts. ChatGPT is a Latenode AI step. Review the draft in Gmail before you send it.

Updated Sep 16, 2026Est. run: 16sEst. cost: $0.001
How Latenode estimates time and cost

Latenode bills workflow runtime in CPU seconds. The first 10,000 CPU seconds are free each month, then usage follows pay-as-you-go CPU-second pricing. Plug-and-Play (PnP) AI nodes are billed separately—each PnP token is $1 USD, charged pay-as-you-go at vendor cost plus a small processing fee, with no API keys required.

Full pricing — how CPU seconds work →

Workflow preview

What this template does

  • Turns new Gmail messages into draft replies you can review
  • Cleans quoted threads in JavaScript before the prompt
  • Writes the reply with ChatGPT
  • Saves the text as a Gmail draft reply

How it works

1
Trigger

New Gmail message

The scenario starts when a new email arrives in the inbox you connect.

2
Logic

Clean the email body

JavaScript keeps the latest message text and drops quoted threads or signatures you do not want in the prompt.

3
AI

Write the reply

ChatGPT reads the subject and cleaned body and returns a draft reply.

4
Action

Save a Gmail draft

Gmail creates a draft reply on that thread so you can review it before sending.

Setup guide

1

Connect Gmail

Add a Gmail connection with permission to read messages and create drafts.

2

Watch new mail

Add a Gmail trigger for new email. Narrow it with a label if you only want a subset of threads.

3

Draft with ChatGPT

Clean the body in JavaScript, send subject and text to ChatGPT, then create a Gmail draft reply. ChatGPT is a Latenode AI step.

Requirements

A Gmail account connected in Latenode
Permission to read messages and create drafts
ChatGPT available as a Latenode AI step

FAQ

Common questions about this template

Each run uses credits on your Latenode plan. We charge for processing time (1 credit = 30 seconds). Your actual cost depends on your plan and how long the run takes. See pricing plans for plans and how credits work. Plug-and-Play AI nodes are billed separately.