Skip to main content

Send a ChatGPT email reply and save responses to Google Sheets

Workflow preview

Workflow preview
100%
Send a ChatGPT email reply and save responses to Google Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow sends a OpenAI GPT reply when an email is received from specific email recipients. It then saves the initial email and the GPT response to an automatically generated Google spreadshee...

Best for

  • Ticket Management automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.openai, n8n-nodes-base.gmailtrigger, n8n-nodes-base.if, n8n-nodes-base.set, n8n-nodes-base.stickynote, n8n-nodes-base.gmail, n8n-nodes-base.crypto, n8n-nodes-base.html

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by n8n Team.

Original n8n.io source

1.1 Workflow description

Title
Send a ChatGPT email reply and save responses to Google Sheets
Workflow name
Send a ChatGPT email reply and save responses to Google Sheets

This workflow sends a OpenAI GPT reply when an email is received from specific email recipients. It then saves the initial email and the GPT response to an automatically generated Google spreadsheet. Subsequent GPT responses will be added to the same spreadsheet.

Additionally, when feedback is given for any of the GPT responses, it will be recorded to the spreasheet, which can then be used later to fine-tune the GPT model.

Prerequisites

How it works

This workflow is essentially a two-in-one workflow. It triggers off from two different nodes and have very different functionality from each trigger.

The flow triggered from On email received node is as follows:

  1. Triggers off on the On email received node.
  2. Extract the email body from the email.
  3. Generate a response from the email body using the OpenAI node.
  4. Reply to the email sender using the Send reply to recipient node. A feedback link is also included in the email body which will trigger the On feedback given node. This is used to fine-tune the GPT model.
  5. Save the email body and OpenAI response to a Google Sheet. If a sheet does not exist, it will be created.

The flow triggered from On feedback given node is as follows:

  1. Triggers off when a feedback link is clicked in the emailed GPT response.
  2. The feedback, either positive or negative, for that specific GPT response is then recorded to the Google Sheet.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Generate reply

Type / Role
n8n-nodes-base.openAi - openAi
Config choices
Version 1

Block 2 - On email received

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1

Block 3 - Only continue for specific emails

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 4 - Configure

Type / Role
n8n-nodes-base.set - set
Config choices
Version 1

Block 5 - Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Send reply to recipient

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2

Block 7 - Generate UUID

Type / Role
n8n-nodes-base.crypto - crypto
Config choices
Version 1

Block 8 - Thanks for your response!

Type / Role
n8n-nodes-base.html - html
Config choices
Version 1

Block 9 - Extract message content (advanced)

Type / Role
n8n-nodes-base.code - code
Config choices
Version 1

Block 10 - If spreadsheet doesn't exist

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 11 - Successfully created or updated row

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 12 - Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Create spreadsheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 3

Block 16 - Store spreadsheet ID

Type / Role
n8n-nodes-base.code - code
Config choices
Version 1

Block 17 - Paste data

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 3

Block 18 - If no sheet IDs

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 19 - Create or update rows

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 3

Block 20 - Get data from `Format data`

Type / Role
n8n-nodes-base.code - code
Config choices
Version 1

Block 21 - Get data from `Format data` node

Type / Role
n8n-nodes-base.code - code
Config choices
Version 1

Block 22 - Format data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 1

Block 23 - Send email reply

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 24 - On feedback given

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1

Showing the first 24 of 49 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Send a ChatGPT email reply and save responses to Google Sheets
Complexity advanced
Nodes 49
Categories Ticket Management, AI Chatbot
Author n8n Team
Published 10 Mar 2023

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/1898/1898.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Send a ChatGPT email reply and save responses to Google Sheets do?

This workflow sends a OpenAI GPT reply when an email is received from specific email recipients. It then saves the initial email and the GPT response to an automatically generated Google spreadshee...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management, AI Chatbot use case.