
Configuring Gmail as a Source
In the Sources tab, click on the “Add source” button located on the top right of your screen. Then, select the Gmail option from the list of connectors. Click Next and you’ll be prompted to add your access.1. Add account access
Authorize Nekt to access your Gmail data. Click the Google Authorization button and sign in with the Google account whose mailbox you want to sync. Grant the scopes required for reading messages and labels. The following configurations are available:-
Start date: Only messages received on or after this date are included. The connector uses Gmail search (
after:YYYY/MM/DD) based on this value. - Include SPAM and Trash: When enabled, messages in Spam and Trash are included in the extraction. When disabled, they follow Gmail’s default visibility for listings.
-
Enable email attachments stream: (Default:
false) When enabled, the source adds an email attachments stream that downloads every message’s attachments and uploads them to a Nekt volume. This makes extractions significantly slower and heavier: each attachment is downloaded from Gmail and re-uploaded to Nekt. Only enable this if you need the email files stored in a Nekt volume. - Attachments Volume: Nekt volume to upload email attachments to. Required when the email attachments stream is enabled.
2. Select streams
Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. You can select entire groups of streams or pick specific ones.Tip: The stream can be found more easily by typing its name.Select the streams and click Next.
3. Configure data streams
Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.- Layer: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
- Folder: a folder can be created inside the selected layer to group all tables being created from this new data source.
- Table name: we suggest a name, but feel free to customize it. You have the option to add a prefix to all tables at once and make this process faster!
- Sync Type: you can choose between INCREMENTAL and FULL_TABLE.
- Incremental (recommended for Email): each run brings new or updated messages based on the replication key (
internalDate). Fits keeping a growing history of mail in the catalog. - Full table (typical for Label): each run replaces the table with the current set of labels and their counts from Gmail.
- Incremental (recommended for Email): each run brings new or updated messages based on the replication key (
4. Configure data source
Describe your data source for easy identification within your organization, not exceeding 140 characters. To define your Trigger, consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times). Optionally, you can define some additional settings:- Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource here.
- Determine when to execute an Additional Full Sync. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.
5. Check your new source
You can view your new source on the Sources page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.Streams and Fields
Below you’ll find all available data streams from Gmail and their corresponding fields:Email
Full Gmail messages for the authenticated user. The connector lists message IDs, then fetches each message resource so rows include headers, MIME structure, and nested parts. Sync is incremental on
internalDate (message receive time).Key fields:Email Attachments
Email Attachments
Downloads email attachments and uploads them to a Nekt volume. This stream is only active when “Enable email attachments stream” is enabled in the source configuration. It makes one API call per attachment to fetch its bytes and emits one metadata record per file.Key fields:
Label
Label
All labels in the mailbox (system and user-defined), including visibility settings and aggregate counts.Key fields:
Data Model
Use Cases for Data Analysis
Join messages to label names. ResolvelabelIds on each email to human-readable names using the Label table.
Example SQL (Trino / AWS Athena)
Example SQL (Trino / AWS Athena)
Replace schema and table names (
nekt_raw, gmail_email, gmail_label) with the layer and table names you configured for the source. On BigQuery, use JOIN LATERAL UNNEST(e.labelIds) AS label_id (or equivalent) instead of contains.Implementation Notes
Extraction Behavior
- Email uses the Gmail
messages.listquery withmaxResults: 500per page andmessages.getper message, so runtime grows with mailbox volume. - The Start date filter applies to the list query; ensure OAuth and API quotas are sufficient for initial backfills.
- Label is a single API call (
users.labels.list); it does not use incremental state. - The Email Attachments stream extracts each message’s attachment parts and makes a separate API call per attachment to fetch its bytes before uploading to the Nekt volume. Because this process is heavy, it should only be enabled when file extraction is explicitly required.
Payload and Timestamps
internalDateis normalized to Unix time in seconds in post-processing (API returns milliseconds).- Top-level
payload.bodyin the schema exposes size only; inline and attachment content typically appears underpayload.partswith optional decodeddata. Only text body parts are decoded inline; file attachments carry anattachmentIdand are fetched separately. - Threading and deduplication are based on
threadIdandidas returned by Gmail.
Skills for agents
Download Gmail skills file
Gmail connector documentation as plain markdown, for use in AI agent contexts.