Developer & DevOps

Intelligent email responses using ChatGPT saved to Google Sheets

49 nodes 311 175 Automatic trigger
Download

Workflow Description

Automate incoming email handling by processing messages with ChatGPT to generate contextual replies, then automatically send responses and log all interactions in Google Sheets for complete audit trails and data organization.

How it works

  1. 1.Trigger on new incoming Gmail message arrival
  2. 2.Process email content through OpenAI ChatGPT API for intelligent response generation
  3. 3.Send automated reply to sender via Gmail
  4. 4.Record original message and generated response in Google Sheets
  5. 5.Archive metadata including timestamps and sender information for future reference

Use cases

  • Autonomous customer support system for handling common inquiries without manual intervention
  • Permanent communication archive for compliance, auditing, and legal documentation purposes
  • Build searchable knowledge base from Q&A pairs for continuous process improvement

Requirements

  • Active Gmail account with full read and send permissions on inbox and sent folder
  • OpenAI API key with sufficient token quota for expected message volume
  • Pre-configured Google Sheets with column headers for emails, responses, timestamps, and metadata

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

OpenAI Gmail Google Sheets

Details

Trigger Automatic trigger
Nodes 49
Apps 3
Views 311
Downloads 175

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (49)

/

Generate reply

OpenAI

#1

On email received

Gmail

#2

Only continue for specific emails

If

#3

Configure

Set

#4

Note5

Sticky Note

#5

Send reply to recipient

Gmail

#6

Generate UUID

Crypto

#7

Thanks for your response!

HTML Page

#8

Extract message content (advanced)

Code

#9

If spreadsheet doesn't exist

If

#10

Successfully created or updated row

No Op

#11

Note1

Sticky Note

#12

Note2

Sticky Note

#13

Note3

Sticky Note

#14

Create spreadsheet

Google Sheets

#15

Store spreadsheet ID

Code

#16

Paste data

Google Sheets

#17

If no sheet IDs

If

#18

Create or update rows

Google Sheets

#19

Get data from `Format data`

Code

#20

Get data from `Format data` node

Code

#21

Format data

Set

#22

Send email reply

No Op

#23

On feedback given

Webhook

#24

Send feedback for fine-tuned data

Google Sheets

#25

Show HTML page

Webhook

#26

Get sheet IDs #1

Code

#27

Note

Sticky Note

#28

If no spreadsheet in configuration #2

If

#29

Store specific sheet IDs #2

Code

#30

Get sheet IDs #2

Code

#31

If no spreadsheet in configuration #1

If

#32

Store specific sheet IDs #1

Code

#33

Email template

HTML Page

#34

Record feedback

No Op

#35

Fallback route

No Op

#36

Identify trigger #2

Set

#37

Identify trigger #1

Set

#38

Do not send unfinished email reply

No Op

#39

If reply is complete

If

#40

Sticky Note

Sticky Note

#41

Do not send email to this recipient

No Op

#42

Send reply to database

No Op

#43

Sticky Note1

Sticky Note

#44

Determine which trigger ran

Switch

#45

Sticky Note2

Sticky Note

#46

Is text within token limit?

If

#47

Do nothing

No Op

#48

Sticky Note3

Sticky Note

#49