Skip to main content

Extract Gmail metadata to Google Sheets

Workflow preview

Workflow preview
100%
Extract Gmail metadata to Google Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Extract Gmail Metadata to Google Sheets This n8n template shows how to fetch new emails from a Gmail account, extract key metadata (sender name, email, subject, and message body), and append each e...

Best for

  • Ticket Management automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.code, n8n-nodes-base.set, n8n-nodes-base.googlesheets, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mohammed Abid.

Original n8n.io source

1.1 Workflow description

Title
Extract Gmail metadata to Google Sheets
Workflow name
Extract Gmail metadata to Google Sheets

Extract Gmail Metadata to Google Sheets

This n8n template shows how to fetch new emails from a Gmail account, extract key metadata (sender name, email, subject, and message body), and append each email as a new row in a Google Sheet for record-keeping or follow-up workflows.

Good to Know

Gmail API Quotas: Gmail’s API has usage limits—make sure your application stays under 2500 read requests per day or implement exponential backoff on rate limit errors.

OAuth Credentials: You’ll need to configure OAuth2 credentials in n8n to authenticate with Gmail.

Sheet Structure: Prepare your Google Sheet with columns: Timestamp, Sender Name, Sender Email, Subject, Message.

How It Works

Gmail Trigger: Watches for new emails matching your search criteria (e.g., is:unread).

Extract Metadata: A Function node reads the incoming payload and pulls:

Name and Email from headers or body text

Subject from common subject fields

Message from body, text, or snippet

Timestamp from current system time

Append to Sheet: The Google Sheets node appends each processed email as a row in your target spreadsheet.

How to Use

Import the Template: Click "Use Template" in your n8n instance.

Configure Credentials:

Gmail OAuth2: Set up your Gmail account credentials in n8n.

Google Sheets: Authorize with your Google account and select the spreadsheet.

Adjust Search Criteria: Modify the Gmail Trigger to filter specific labels or queries.

Activate and Test: Enable the workflow and send a test email.

Verify Sheet: Check your Google Sheet for new rows with the extracted email data.

Requirements

n8n@latest

Gmail OAuth2 Credentials

Google Sheets API enabled in your Google Cloud project

Customizing This Workflow

Additional Fields: Extend the Function node to capture attachments, threads, or labels.

Notification Flow: Add Slack or email nodes to notify your team of important messages.

Data Enrichment: Integrate with NLP or sentiment analysis APIs to annotate messages.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Gmail Trigger

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.2

Block 2 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - Append row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 5 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Extract Gmail metadata to Google Sheets
Complexity intermediate
Nodes 7
Categories Ticket Management
Author Mohammed Abid
Published 26 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6496/6496.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Extract Gmail metadata to Google Sheets do?

Extract Gmail Metadata to Google Sheets This n8n template shows how to fetch new emails from a Gmail account, extract key metadata (sender name, email, subject, and message body), and append each e...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management use case.