How to send Gmail emails to a Google Sheet with n8n
Use a Gmail Trigger (or a Schedule Trigger followed by the Gmail node's Get Many messages) and connect it to a Google Sheets node set to Append Row, mapping from, subject, date and snippet to your columns. Use a Gmail search query to pick which emails count. To avoid duplicate rows, store the message ID and use Append or Update Row matched on that column.
Buy for $15 AI Automation Starter Pack for n8n — 8 ready-to-import workflows · $15
Build it in five nodes or fewer
- Make a sheet with row 1 headers, for example: logged_at, from, subject, snippet, message_id.
- Add a Gmail Trigger, or a Schedule Trigger plus a Gmail node (Message, Get Many) with a search filter such as in:inbox newer_than:1d.
- Add a Google Sheets node: Operation Append or Update Row, pick the document and tab, map columns, and set message_id as the column to match on.
- Run it once by hand, check the sheet, then make the workflow active (the Publish button in n8n 2.x, the Active toggle in 1.x).
Column mapping expressions
With the Gmail node's Simplify option on, these expressions usually work. Turn Simplify off when you need the full body or headers, and check field names in the node output first.
logged_at {{ $now.toISO() }}
from {{ $json.From }}
subject {{ $json.Subject }}
snippet {{ $json.snippet }}
message_id {{ $json.id }}
Google sign-in on self-hosted n8n
- In Google Cloud Console, create a project and enable the Gmail API and Google Sheets API.
- Set up the OAuth consent screen. While it is in testing mode, add your own Google address as a test user.
- Create an OAuth client ID of type Web application and paste the OAuth Redirect URL that n8n shows on the credential screen.
- Copy the client ID and secret into the Gmail OAuth2 API and Google Sheets OAuth2 API credentials, then sign in.
- On n8n Cloud you skip all of this and use the Sign in with Google button.
Common snags
- Duplicate rows on every run: a Schedule Trigger re-reads the same emails. Match on message_id, or keep a 'seen' list in workflow static data.
- Nothing written: row 1 headers must match the mapped column names exactly.
- Too many emails: Get Many has a limit. Narrow the search or run more often.
The same idea, with sorting added
Workflow 02 in our starter pack does Gmail to Google Sheets every 10 minutes and adds an AI step: each email gets a category, a priority, a one-line summary and a Gmail link, and high-priority ones also go to Slack. It remembers what it has seen (on active runs), reads up to 25 messages per run and never changes your mailbox.
It was tested end to end on n8n 2.49.9 with a local test copy of Gmail and Sheets; real Google sign-in and real AI providers weren't part of the test. You need your own AI key.
The product
Questions
Can I save attachments too?
Yes. Turn on attachment download in the Gmail node, then upload the binary to Google Drive and put the file link in the sheet.
Gmail Trigger or Schedule Trigger?
Gmail Trigger polls for new mail and suits one-email-at-a-time logging. A Schedule Trigger with Get Many gives you control over the search and batch size.
Does this read my whole inbox?
Only what your search query matches, up to the limit you set.
Related
Updated 2026-12-01