Mindket

New Gmail emails sorted by AI and logged to Google Sheets

Newversion 1 · updated

Overview

An n8n workflow that picks up new unread Gmail messages, asks GPT to label each as urgent, important, informational or spam with a one-line summary, and logs it in a Google Sheet. It moves and deletes nothing.

New Gmail emails sorted by AI and logged to Google Sheets is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

At a glance

Runs in
  • n8n Cloud: import the file and publish it
  • Your own n8n server: the same file and steps
  • Google Sheets: one tab called Email log with five named columns

Platform

Connects 3 apps

How it works

Trigger

New unread email

It starts when a new unread email reaches your Gmail, checked every minute. It brings:

  • The sender’s name and address
  • The subject and the date
  • The body, of which the first 500 characters are used

Actions

  1. Keeps the sender, the subject, the date and the first 500 characters of each message
  2. Asks GPT to label the message urgent, important, informational or spam, with a one-sentence summary
  3. Joins each answer to its email, and logs an unreadable answer as informational
  4. Appends one row for each message to your Google Sheet

Result

A Google Sheet log with the date, sender, subject, category and a one-line summary of every new unread email, and no change to your mailbox

Integrations

What you need before you start.

Gmail

Mail source

Fetches new unread messages and parses them in full.

NeedsA Gmail OAuth2 credential

OpenAI

Language model

Labels each message and writes its summary. The copy asks for gpt-6-luna.

NeedsAn OpenAI API key

Google Sheets

Spreadsheet

Appends one row for each message.

NeedsA Google Sheets OAuth2 credential and a tab with five named columns

Workflow check

Checked by Mindket on 13 Nov 2026

Steps
5 steps, starting on a Gmail event
AI
1 step calls an AI model: AI: Classify
Sign-ins
Signs in to: Google Sheets and Gmail
API keys
No API key is left in the file
Step types
Mindket’s checker reads all 4 of its step types

Read from the workflow’s file, not from a run.

About

What it is

This n8n workflow sorts your new unread email and keeps a log of it. Every minute it picks up new unread messages in Gmail. A Code step keeps the sender, the subject, the date and the first 500 characters of the body. GPT labels each message as urgent, important, informational or spam and writes a one-sentence summary as JSON. A second Code step joins the answer to its email, and Google Sheets adds a row. Nothing is moved, labelled, deleted or answered. Five nodes run it, beside one sticky note.

Who it suits

Anyone with a busy inbox who wants to see how an AI would sort it before they let it act. Skip it if you want mail moved or labelled on its own. This one only logs. Each message goes to OpenAI.

Who uses it, and how
IndustryWho uses itHow they use itExample
OperationsTeam leadsCheck what an assistant would flag before they give it any powerA lead reads the log and sees which urgent mail the model caught.
SupportShared inboxesMeasure how much of the inbox is spam or newsA support lead counts the categories after a week.
SalesAccount managersSpot important mail among long threadsA manager filters the sheet for important and acts on those first.
FreelanceIndependent workersGet a daily list of what arrivedA freelancer reads one-line summaries instead of every message.

You need to know n8n’s settings: import a file, add three credentials and name a sheet.

Where to use it

Any n8n that can reach Gmail, OpenAI and Google Sheets will run it.

  • n8n Cloud: import the file and publish it
  • Your own n8n server: the same file and steps
  • Google Sheets: one tab called Email log with five named columns

Setup

Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Setup is three credentials and one sheet id.

What you need first
NeedDetail
n8nOn n8n Cloud or on a server of your own
GmailAn OAuth2 credential for the mailbox to sort
OpenAIAn API key. The model is gpt-6-luna
Google SheetsAn OAuth2 credential and a tab called Email log with the columns Date, From, Subject, Category and Summary
  1. In n8n, create a workflow, open its menu, choose Import from File and pick workflow.json.
  2. Add a Gmail credential and select it in Gmail: New Email.
  3. Add an OpenAI credential and select it in AI: Classify.
  4. Add a Google Sheets credential and select it in Log to Sheets. Replace <YOUR_SHEET_ID> with your sheet’s id.
  5. Publish the workflow, then send yourself a test email from another address.

How to use it

Leave it running and open the sheet when you want to see what came in. Read the first rows to judge whether the categories fit your mail, then change the prompt if they do not.

What to change for a different result
To changeWhere
Which mail is looked atThe filters in Gmail: New Email
The categories and the summaryThe system message in AI: Classify
How much of the body the model seesThe length in Parse Email
The columnsThe mapping in Log to Sheets, and row 1 of your tab

Example

A message arrives with the subject “Contract needs your signature today”.

{"category": "urgent", "summary": "A contract is waiting for your signature by the end of today."}

The sheet gets a row with the date, the sender, the subject, the category urgent and that one-line summary.

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. This one reads mail, asks a model to label it and writes a row. Start by sending yourself two or three test emails.

For experts. Two Code steps wrap one call to the model.

Where to look closer
NodeWhat it doesWhat to know
Gmail: New EmailTrigger on unread mail, full parseOne item for each new message
Parse EmailKeeps sender, subject, date and 500 charactersIt handles every item of a check
AI: ClassifyOpenAI node with JSON output onThe answer comes back as an object
Merge ResultPairs each answer with its emailAn unreadable answer becomes informational
Log to SheetsAppends the rowRow 1 must hold the five names

Good to know

The category is a guess, so read the first rows before you rely on them.

  • Fixes: the AI step used a node type that does not exist at that version, so it is now n8n’s OpenAI node. The original also handled only the first email of each check, and it read a snippet field that the full output lacks
  • Model: gpt-4o-mini shuts down on 14 January 2027, so this copy asks for gpt-6-luna and leaves out the temperature and the token limit
  • Cost and data: each email is one call to OpenAI with the sender, the subject and 500 characters of the body
  • Read status: the workflow marks nothing as read, so the unread filter only limits what each check fetches
  • Sheet: row 1 must hold Date, From, Subject, Category and Summary, or the sheet step stops
  • Not run: Mindket did not run it against Gmail, OpenAI or Google Sheets
  • Credentials: the JSON holds none

README and files

README

New Gmail emails sorted by AI and logged to Google Sheets

An n8n workflow that sorts your new unread email and keeps a log. Every minute it picks up new unread messages in
Gmail. A model labels each one as urgent, important, informational or spam and writes a one-sentence summary. The result
goes into a Google Sheet. It is the safe first step: nothing is moved, deleted, labelled or answered.

What is inside

  • workflow.json: the workflow as n8n exports it, six nodes. One is a sticky note. It holds no credential.
  • README.md: these notes.

What we changed from the original copy

  • The AI step was an n8n-nodes-base.openAi node at version 1.8. That node type only exists at versions 1 and 1.1, and
    its options differ. AI: Classify is now n8n's OpenAI node, which has version 1.8, with its Message a Model operation and
    JSON output turned on.
  • The model was gpt-4o-mini, which OpenAI shuts down on 14 January 2027. It now asks for gpt-6-luna, the replacement
    OpenAI names. The temperature of 0.2 and the limit of 200 tokens are gone. The model's page does not list a temperature
    setting, and OpenAI counts a reasoning model's thinking against the output limit, so a small cap can cut the answer off.
  • Parse Email handled only the first email of each check. When several emails arrive between two checks, the others were
    lost. It now handles all of them, and Merge Result pairs each answer with its email.
  • The snippet was read from a field that the full email output does not have, so the model saw only the sender and the
    subject. It now falls back to the start of the plain text.
  • Merge Result expected the answer as text. The OpenAI node now returns it as an object, so the code takes either.
  • The sheet id came from an environment variable, which only a self-hosted n8n can set. It is now
    the placeholder <YOUR_SHEET_ID>. The tab is Email log, and the node lists its five columns.
  • The sticky note has a shorter title and a plainer last line.

Before you start

  • A Gmail account you can connect to n8n with OAuth2.
  • An OpenAI API key.
  • A Google Sheet with a tab called Email log. Row 1 holds these names: Date, From, Subject, Category and
    Summary. If one is missing, the sheet step stops.

Set it up

  1. In n8n, create a workflow, open its menu and choose Import from File. Pick workflow.json.
  2. Add a Gmail OAuth2 credential and select it in Gmail: New Email.
  3. Add an OpenAI credential and select it in AI: Classify.
  4. Add a Google Sheets OAuth2 credential and select it in Log to Sheets. Replace <YOUR_SHEET_ID> with your sheet's id,
    the part of its address between /d/ and /edit.
  5. Publish the workflow, then send yourself a test email from another address.

How a run goes

  1. Gmail: New Email fetches new unread messages and parses them in full.
  2. Parse Email keeps the message id, the sender's address and name, the subject, the first 500 characters of the body and
    the date.
  3. AI: Classify asks the model for JSON with a category and a summary. The category is urgent, important,
    informational or spam.
  4. Merge Result joins each answer with its email. If an answer cannot be read, the email is logged as informational with
    no summary.
  5. Log to Sheets appends a row to the Email log tab.

Change the result

  • Which mail is looked at: the Read Status and other filters in Gmail: New Email.
  • The categories and the summary: the system message in AI: Classify, and the fallback in Merge Result.
  • How much of the body the model sees: the substring length in Parse Email.
  • The columns: the mapping in Log to Sheets and row 1 of your tab.

Good to know

  • The workflow marks nothing as read. The unread filter only limits which mail is fetched at each check.
  • Each new email is one call to OpenAI. It sends the sender, the subject and the start of the body.
  • The model's category is a guess. Read the first rows before you trust them.
  • Mindket did not run this workflow against Gmail, OpenAI or Google Sheets. These notes follow n8n's published node code
    and OpenAI's pages, read on 12 November 2026, and the two Code steps were run on sample emails on a local computer.
Files
NOTICE.md  628 B
README.md  4 KB
workflow.json  6 KB

3 files, 11 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

Huashu Design

alchaincyf · Skill

Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…

New29.4k

Guizang PPT Skill

op7418 · Skill

Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…

New29.8k

Claude Code Skills & Plugins

alirezarezvani · Skill

Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…

New29.8k

Similar in Productivity

See all in Productivity

Frontend Slides

zarazhangrui · Skill

Builds HTML presentations from scratch or from a PowerPoint file and shows visual style previews to pick from, for people who want web slides with no CSS or Ja…

New32.3k

IPTV

iptv-org · Kit

Collects publicly available live TV channels from many countries into playlists that any video player with live streaming can open. Made for viewers and for de…

New144k

upscaler

uwg · Kit

Holds a set of image upscaling models gathered from the OpenModelDB community, for people who want to enlarge low-resolution pictures with AI on their own comp…

New