---
title: "AI email replies from Gmail with feedback saved to Sheets"
kind: "Kit"
category: "Business"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/f46ab2e0-1110-4699-a22d-f46ae824a257"
updated: "2026-11-12"
---

# AI email replies from Gmail with feedback saved to Sheets

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow that replies to listed Gmail senders with OpenAI and saves each exchange, plus a Yes or No rating, to Google Sheets.

AI email replies from Gmail with feedback saved to Sheets is an n8n workflow in the Business category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow answers new Gmail messages with replies written by OpenAI. It answers only the senders you list, or everyone if you use a star. Each reply carries a Yes and a No link, and the message, the reply and the click are saved to a Google Sheet. Forty-one nodes run it, beside nine sticky notes.

### Who it suits

Small teams that want a first reply drafted and sent for routine mail, and want rated examples to improve a model later. Skip it if a person must read every reply first, or if the mail cannot go to OpenAI.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Support | Support desks | Answer routine questions from known addresses | A desk sends first replies to a partner’s repeat questions. |
| Sales | Sales teams | Reply to inbound enquiries | A rep’s mailbox answers a pricing enquiry on its own. |
| Recruiting | Recruiters | Acknowledge applications | A recruiter’s inbox thanks each applicant and says what happens next. |
| Research | AI teams | Collect rated replies | A team gathers Yes and No ratings for later fine-tuning. |

You need some n8n and a Google account: import a file, add three credentials, list who to answer and set the `WEBHOOK_URL` variable.

### Where to use it

An n8n that can reach Gmail, OpenAI and Google Sheets will run it. The replies leave from your Gmail account, and the rating pages are served by your n8n.

- Gmail: the mail that is answered
- OpenAI: the model that writes the replies
- Google Sheets: the log of messages, replies and ratings
- Your n8n: the Yes and No links lead back to it

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. Setup takes three credentials, a list of senders and the `WEBHOOK_URL` variable.

What you need first

| Need | Detail |
| --- | --- |
| n8n | An instance with \`WEBHOOK\_URL\` set to the address people reach it at |
| Gmail | A Google account for the mailbox |
| Google Sheets | The same account, or your own sheet with four columns |
| OpenAI | An API key |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Add credentials for Gmail, Google Sheets and OpenAI, and select them in the nodes that ask for one.
3. In `Configure`, replace `<YOUR_RECIPIENT_EMAILS>` with the addresses to answer, or with a star for every sender.
4. Leave the sheet ids empty to let the workflow create a spreadsheet, or fill in your own.
5. Activate the workflow and send a test mail from a listed address.

### How to use it

Activate the workflow. Gmail is checked every minute, and a message from a listed sender gets an answer in the same thread. A click on Yes or No in the reply updates the sheet.

What to change for a different result

| To change | Where |
| --- | --- |
| The model and the prompt | The body of \`Generate reply\` |
| The reply length | \`replyTokenSize\` in \`Configure\` |
| Who gets an answer | \`recipients\` in \`Configure\` |
| The look of the reply | The HTML in \`Email template\` |

### Example

A partner writes twice a week to ask how to reset a device, and the address is on the list. The workflow writes a short reply and sends it in the thread.

It then adds a row to the sheet with the first message and the reply. The partner clicks Yes, and the last column of that row changes to Yes.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. Here one trigger watches Gmail, and a second waits for a click on a link in the reply. Start with your own address as the only sender.

**For experts.** Two triggers share one chain of Set, Switch and Configure nodes. The reply comes from one HTTP Request to Chat Completions, and a Code node keeps only the newest text of each message.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Extract message content (advanced)\` | Cuts quoted older mail from the message | The parser is long minified code, left as it was |
| \`Generate reply\` | Asks Chat Completions for the reply | The reasoning effort is none, so the length limit covers visible text only |
| \`Reply Fields\` | Picks \`text\` and \`finish\_reason\` | A reply that did not end on \`stop\` is not sent |
| \`Create or update rows\` | Adds the row, or reports a missing sheet | \`continueOnFail\` lets the next check see the error |

### Good to know

This workflow sends real replies to every matching sender, so try it with your own address first.

- The repair: n8n’s older OpenAI text node used its default model, \`gpt-3.5-turbo-instruct\`. OpenAI’s deprecations page, read on 12 November 2026, lists it as shut down on 28 September 2026. This copy calls Chat Completions with \`gpt-6-luna\`
- Length: reasoning tokens count toward \`max\_completion\_tokens\`, so the request switches reasoning off and the default of 300 leaves room for text
- The links: the Yes and No links come from \`WEBHOOK\_URL\`, and anyone who holds one can click it
- The limit: \`maxTokenSize\` is 4000, and the model page lists a context of 1,050,000 tokens, so you can raise it
- Not run: this copy was not run against Gmail, Google Sheets or OpenAI
- Your data: each email goes to OpenAI, and the sheet keeps messages and replies
- Credentials: the JSON holds none

## README

```markdown
# AI email replies from Gmail with feedback saved to Sheets

An n8n workflow that answers new Gmail messages from the senders you list with a reply written by OpenAI. It saves each message and its reply to a Google Sheet. Every reply carries a Yes and a No link, and a click writes the answer into the sheet, so you collect rated examples for fine-tuning later.

## What is inside

- `workflow.json`: the workflow as n8n exports it, fifty nodes: forty-one that do the work and nine sticky notes. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- The credential links are gone. Select your own for Gmail, Google Sheets and OpenAI.
- `Generate reply` was n8n's older OpenAI text node. The file names no model, so the node used its default, `gpt-3.5-turbo-instruct`. OpenAI's deprecations page, read on 12 November 2026, lists that model as shut down on 28 September 2026 with `gpt-5.6-terra` as the replacement. The model page for `gpt-5.6-terra` shows the legacy Completions endpoint as not supported.
- `Generate reply` is now an HTTP Request to Chat Completions. It names `gpt-6-luna`, sets `reasoning_effort` to none and takes `max_completion_tokens` from `replyTokenSize`. OpenAI's reference counts reasoning tokens in that limit, so the default of 300 could run out before any text appears with reasoning switched on.
- A new `Reply Fields` node follows it. It turns the answer into `text` and `finish_reason`, the two fields the rest of the workflow reads, and `Format data` reads `text` from it.
- The first line of the email parser Code node was a comment with its author's link. That line is removed and the parser is as it was.
- `recipients` held `[UPDATE ME]`. It holds `<YOUR_RECIPIENT_EMAILS>` now.
- The notes are rewritten. One of them named Pipedrive, which belongs to another workflow.
- Nothing else.

## Before you start

- An n8n instance with the `WEBHOOK_URL` environment variable set to the address people reach it at. The Yes and No links in each reply are built from it. n8n's security page lists `N8N_BLOCK_ENV_ACCESS_IN_NODE` as false by default, which leaves that access on.
- A Gmail account, a Google account for Sheets, and an OpenAI API key.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Add a Gmail credential and select it in `On email received` and `Send reply to recipient`.
3. Add a Google Sheets credential and select it in `Create spreadsheet`, `Create or update rows`, `Paste data` and `Send feedback for fine-tuned data`.
4. Add an OpenAI credential and select it in `Generate reply`.
5. In `Configure`, replace `<YOUR_RECIPIENT_EMAILS>` with the addresses to answer, separated by commas, or with `*` to answer every sender.
6. Leave `spreadsheetId` and `worksheetId` empty and the workflow creates a spreadsheet named by `spreadsheetName`. To use your own sheet, fill both in and give it the columns `ID`, `Initial message`, `Generated reply` and `Good response?`.
7. Save and activate the workflow, then send a test message from a listed address.

## How a run goes

1. `On email received` polls Gmail every minute. `Identify trigger #1` marks the item as `gmail` and `Configure` adds the settings.
2. `Determine which trigger ran` sends it on. `Only continue for specific emails` checks the sender against `recipients`.
3. `Generate UUID` gives the exchange an id. `Extract message content (advanced)` keeps the newest text of the message and drops quoted older mail.
4. `Is text within token limit?` compares the text length divided by four with `maxTokenSize` minus `replyTokenSize`. A longer message is ignored.
5. `Generate reply` asks OpenAI, and `Reply Fields` picks out the answer. `If reply is complete` lets only a reply that ended on `stop` through to `Email template`, and `Send reply to recipient` answers the message in its thread.
6. `Format data` builds a row with the id, the first message, the reply and an empty `Good response?`. The sheet nodes create the spreadsheet if it is missing, or add the row to it.
7. `On feedback given` is a webhook. A click on Yes or No sends the id and the answer. `Identify trigger #2` marks it `webhook`, `Record feedback` passes it on and `Send feedback for fine-tuned data` writes the answer into the row with that id. The visitor sees a thank-you page.

## Change the look

- The model and the prompt: the body of `Generate reply`.
- The reply length: `replyTokenSize` in `Configure`.
- Who gets an answer: `recipients` in `Configure`.
- The look of the reply: the HTML in `Email template`.
- The names of the spreadsheet and the tab: `Configure`.

## Good to know

- The workflow sends real replies to every matching sender. Test with your own address first.
- A reply that stops at the length limit is not sent. Raise `replyTokenSize` if that happens.
- `maxTokenSize` is 4000, a cautious number. The model page for `gpt-6-luna` lists a context of 1,050,000 tokens, so you can raise it.
- The spreadsheet id is kept in the workflow's static data. Copy the workflow into a new one to refresh it.
- Anyone who has a feedback link can click it, and the link carries the exchange id.
- This copy was not run against Gmail, Google Sheets or OpenAI.
- The text of each email goes to OpenAI, and the sheet keeps messages and replies.
- The JSON holds no credential.
```

## What is in it

3 files, 85 KB, downloaded as a zip.

```text
NOTICE.md  673 B
README.md  5 KB
workflow.json  79 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 41 steps, starting on a Gmail event or when its webhook is called
- AI: No step calls an AI model
- Sign-ins: Signs in to: OpenAI, Gmail and Google Sheets
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 13 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/f46ab2e0-1110-4699-a22d-f46ae824a257)
- [Its page on Mindket](https://mindket.com/p/f46ab2e0-1110-4699-a22d-f46ae824a257)
