Gmail to Notion: Save Important Emails to a Database for Free (Apps Script)
Gmail to Notion: label an email and a free Apps Script saves it to your Notion database through the Notion API. Setup, quotas and Zapier limits.
Yes, you can save Gmail emails to a Notion database for free. A Google Apps Script label check runs on a free consumer Gmail account, and it creates one Notion page per labelled email through the Notion API. Google limits each script run to 6 minutes, which is far more than this job needs. Last checked: 27 October 2026.
What do you need before you start?
- A Gmail account. A free consumer account is enough. Apps Script is free to access on consumer Gmail accounts for building and running small automations.
- A Notion database for the emails, with a title column.
- Permission to create an internal integration in your Notion workspace.
- A Gmail label named
save-to-notion. You apply it to any email you want saved. - About 30 minutes.
How do you set up Notion for the script?
The script authenticates with a Notion integration token. The setup is the same in two independent guides: create an internal integration, copy its token, set its capabilities, and share the target database with it (SFAI Labs; Digital Malayali).
- Open Notion's My Integrations page and create an internal integration.
- Copy the integration token (the secret).
- Set the integration's capabilities so it can insert content.
- Open your emails database in Notion and share it with the integration.
- Copy the database ID from the database's URL.
Every request to the Notion API must include an Authorization: Bearer <token> header. The Notion create-page reference lists 2026-03-11 as the latest API version, so the script sends Notion-Version: 2026-03-11.
Alternative: a personal access token. Notion's personal access token guide says a token authenticates as the user who created it, and pages do not need to be shared with a bot. The trade-off is that the script then has your full access, not just the one database. Use an integration unless you have a reason not to.
How do you save labelled Gmail emails to Notion?
- In Gmail, create a label named
save-to-notion. - Create a new Apps Script project. Verify this step: the menu may differ, including where script properties are kept. Add a script property named
NOTION_TOKENthat holds the integration token. Keep the token out of the code. - Replace the sample code with the script below.
- Set
NOTION_DATABASE_IDto your database ID. - Set
TITLE_PROPERTYto the exact name of your database's title column. Notion matches property names to the database schema. - Run
saveLabelledEmailsToNotiononce and approve the Gmail and external request permissions.
// Saves each thread labelled "save-to-notion" as a Notion page, then relabels it.
// Store the token in the script properties as NOTION_TOKEN.
const NOTION_DATABASE_ID = 'PASTE_YOUR_DATABASE_ID';
const TITLE_PROPERTY = 'Name'; // must match the title column in your database
const SAVE_LABEL = 'save-to-notion';
const DONE_LABEL = 'saved-to-notion';
const MAX_THREADS_PER_RUN = 20;
function saveLabelledEmailsToNotion() {
const token = PropertiesService.getScriptProperties().getProperty('NOTION_TOKEN');
if (!token) throw new Error('Add the NOTION_TOKEN script property first.');
const saveLabel = GmailApp.getUserLabelByName(SAVE_LABEL);
if (!saveLabel) throw new Error(`Create a Gmail label named "${SAVE_LABEL}" first.`);
const doneLabel = GmailApp.getUserLabelByName(DONE_LABEL) || GmailApp.createLabel(DONE_LABEL);
saveLabel.getThreads(0, MAX_THREADS_PER_RUN).forEach(thread => {
const message = thread.getMessages()[0]; // first message in the thread
createNotionPage(token, message);
thread.removeLabel(saveLabel);
thread.addLabel(doneLabel);
Utilities.sleep(400); // about 2.5 requests per second, under Notion's average of about 3
});
}
function createNotionPage(token, message) {
// Trim the body so the request stays within Notion's limits for rich text.
const body = `From: ${message.getFrom()}\nDate: ${message.getDate()}\n\n${message.getPlainBody()}`.slice(0, 1900);
const payload = {
parent: { database_id: NOTION_DATABASE_ID }, // Verify this step against the create-page reference
properties: {
[TITLE_PROPERTY]: {
title: [{ text: { content: (message.getSubject() || '(no subject)').slice(0, 200) } }],
},
},
children: [{
object: 'block',
type: 'paragraph',
paragraph: { rich_text: [{ type: 'text', text: { content: body } }] },
}],
};
const response = UrlFetchApp.fetch('https://api.notion.com/v1/pages', {
method: 'post',
contentType: 'application/json',
headers: {
Authorization: `Bearer ${token}`,
'Notion-Version': '2026-03-11',
},
payload: JSON.stringify(payload),
muteHttpExceptions: true,
});
if (response.getResponseCode() >= 300) {
// The thread keeps its save label, so the next run retries it.
throw new Error(`Notion returned ${response.getResponseCode()}: ${response.getContentText()}`);
}
}
The script reads up to 20 labelled threads per run. It creates one Notion page per thread, with the subject as the title and the sender, date and first part of the body as text. It then swaps the save-to-notion label for saved-to-notion, so an email is not saved twice.
How do you run the script automatically?
In the Apps Script project, add a time-driven trigger for saveLabelledEmailsToNotion that runs every 15 minutes. Quotas decide whether that schedule fits a free account:
| Check | Math | Consumer limit | Result |
|---|---|---|---|
| Trigger runtime | 96 runs a day × 30 seconds = 48 minutes | 90 minutes per day (DEV Community) | Fits |
| UrlFetch calls | 96 runs × 20 threads = 1,920 calls at most | 20,000 per day (DEV Community) | Fits |
| Run length | 20 threads with a 400 ms pause each | 6 minutes per run (DEV Community) | Fits |
The 30-second run time is an assumption for the math, not a measured figure. If a run ever gets close to 6 minutes, lower MAX_THREADS_PER_RUN. Google's quota page says quotas are per user, reset 24 hours after the first request, and can change without notice.
Is there a free Zapier alternative?
Yes, for simple saves. Zapier's free plan supports only two-step Zaps, meaning one trigger and one action, according to Alltomate. On the free plan, Zapier checks for new trigger data every 15 minutes, according to Alltomate. A two-step Zap can send each new email to Notion without any code.
The free plan has limits that matter here. According to LowCode Agency and AutomateOps, filters and Paths are not included on the free plan, so a free Zap cannot branch or check conditions before it saves. Quicktion also reports that automation platforms often capture email bodies as plain text, which can make the Notion page look flat. Check each trigger's options on the free plan before you rely on it.
Which method should you choose?
| Method | Cost | Difficulty | Limits | Best for |
|---|---|---|---|---|
| Apps Script with the Notion API (this guide) | Free on consumer Gmail | Medium: a token and about 60 lines of code | 6 minutes per run, 90 minutes of trigger time per day, 20,000 UrlFetch calls per day, about 3 Notion requests per second per connection on most plans | Saving only labelled emails, with no vendor fee |
| Zapier free plan | Free | Easy: a point-and-click Zap | Two-step Zaps only, checks every 15 minutes | Saving every new email without code |
| Zapier paid plans | Paid, see Zapier's pricing page | Easy | Multi-step Zaps, filters and Paths | Formatting, filtering and longer workflows |
| Notion AI Connector for Gmail | Requires a paid Google Workspace account and a Notion Business plan | Easy | Read-only: search and summarise, cannot write rows | Asking questions about your email, not saving it |
What's free and what costs money?
| Item | Free (consumer Gmail) | Google Workspace | Source and date |
|---|---|---|---|
| Apps Script | Free to use | Free to use | Numerous.ai, 7 January 2026 |
| Run time per execution | 6 minutes | 6 minutes | DEV Community, 25 July 2026 |
| Trigger runtime per day | 90 minutes | 6 hours | DEV Community, 25 July 2026 |
| UrlFetch calls per day | 20,000 | 100,000 | DEV Community, 25 July 2026 |
| Notion API requests | About 3 per second per connection on most plans (10 on Business and Enterprise) | Same as consumer | Notion API documentation, 21 October 2026 |
| Zapier free plan | Two-step Zaps, 15-minute checks | Not applicable | Alltomate, 25 June 2026 |
| Zapier filters and Paths | Not included | Not applicable | LowCode Agency and AutomateOps, 2026 |
Google's quota page lists these limits for each account type. It says quotas are per user, reset 24 hours after the first request, and can change at any time without notice.
What can go wrong, and how do you fix it?
- The request is rejected with an authorization error. The token is wrong, has extra spaces, or the header is missing
Bearer. Re-copy the token into theNOTION_TOKENscript property. - The page is not created in the right database. The database is not shared with the integration. Share it again from the database's page in Notion.
- The property is not found or the request fails on a property. The property name in
TITLE_PROPERTYdoes not match the database. Notion requires property names and IDs to align with the parent database schema. - You want to map a Formula, Rollup, ID, Created time or Last edited time field. The API cannot set these. Notion sets them itself, so leave them out of the payload.
- A run stops at the 6-minute limit. Lower
MAX_THREADS_PER_RUN. Threads that did not finish keep thesave-to-notionlabel, so the next run picks them up. - Notion returns HTTP 429. Increase the
Utilities.sleeppause. Notion's average is about 3 requests per second per connection on most plans (10 on Business and Enterprise). A per-workspace limit is shared across that workspace's connections.
What's still unclear?
- The parent format depends on your API version. The create-page reference lists
database_idas a validparenttype, alongsidedata_source_id, but its prose describes parents as data sources. Confirm that thedatabase_idparent works with your database before you run the script. - The weakest point is the trigger. If the trigger stops, nothing alerts you, and labelled emails wait until you notice.
Frequently asked questions
Can I save Gmail emails to Notion for free?
Yes. A Google Apps Script on a consumer Gmail account can create a Notion page for each labelled email through the Notion API, at no cost. The script is subject to Google's quotas: each run stops after 6 minutes, consumer accounts get 90 minutes of trigger runtime per day, and 20,000 UrlFetch calls per day. Zapier's free plan can also do it, but only with two-step Zaps.
Do I need Google Workspace for this?
No. A free consumer Gmail account works. Google Workspace accounts get higher limits, including 6 hours of trigger runtime per day and 100,000 UrlFetch calls per day, but the 6-minute limit per run is the same for both account types.
Can Notion's own Gmail connector save emails to a database?
No. According to MailNotes, the Notion AI Connector for Gmail is read-only. You can search and query your emails, but nothing is saved to a database. The connector also requires a paid Google Workspace account and a Notion Business plan.
Why does the script fail when it writes to my database?
Most often the property names in the request do not match your database. The title property name in the code must match the title column in Notion exactly. Notion also does not let the API set Formula, Rollup, ID, Created time or Last edited time properties, because Notion sets those itself.
Is it safe to paste my Notion token into the script?
Store it in the script's properties, not in the code. Anyone who has the token can act through the integration, so share the database only with the integration and never paste the token into a shared document or chat.
Sources
- Create a page: Notion API reference, Notion Docs (2026-10-21)
- Personal access tokens, Notion Docs (2026-03-11)
- GmailApp class, Google for Developers (2026-04-13)
- Apps Script quotas, Google for Developers (2026-09-03)
- Google Apps Script quota limits 2026, DEV Community (2026-07-25)
- Is Google Apps Script free?, Numerous.ai (2026-01-07)
- Is Zapier free?, Alltomate (2026-06-25)
- How to get your Notion API key, SFAI Labs (2026-04-11)
- Sync Notion with Gmail, Forms and Sheets via Apps Script, Digital Malayali (2026-03-22)