Gmail Task Management Sync with Notion - n8n Workflow

Automate task creation by converting labeled emails in Gmail into actionable tasks within a Notion database. This comprehensive n8n workflow removes the original label when the task is marked complete.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

This is a perfect n8n workflow for:
Individuals using Gmail for task tracking who need a more powerful project management backend like Notion.
Automation enthusiasts looking for advanced n8n templates integrating scheduling, conditional logic, and bidirectional sync.
Teams seeking to standardize task capture directly from email communications.
Users who want to leverage the Notion n8n node for robust data manipulation.

Overview

Manually transferring tasks from your inbox to a project management system is tedious and error-prone. This specialized n8n workflow solves that problem by providing a seamless, automated bridge between Gmail labels and Notion databases. By simply applying a specific label to an email, the system automatically checks if the email already exists in Notion (preventing duplicates), and if not, creates a new database entry, including the email subject, snippet, and a direct link back to the email thread.

The real power of this n8n automation lies in its bidirectional capability: when you mark the task as 'Complete' within Notion, a secondary n8n trigger fires, instantly removing the original label from the email in Gmail, keeping your inbox clean and synchronized with your project status. This is a highly efficient example of advanced n8n templates for personal productivity.

How it Works

This n8n workflow operates using two distinct entry points to ensure full synchronization:

Part 1: Gmail to Notion Sync (Task Creation)


  1. Scheduled Polling: An n8n trigger fires every minute, initiating the process.

  2. Time Derivation: A Date & Time n8n node calculates the lookback time (1 minute prior) to efficiently query only recent emails.

  3. Gmail Retrieval: The Gmail n8n node fetches all emails bearing a specified task label (e.g., 'Notion').

  4. Notion Check: A Notion n8n node attempts to retrieve a database page using the Gmail Thread ID, checking for existing tasks.

  5. Data Merge: The results from Gmail and the Notion check are merged.

  6. Conditional Check: An If n8n node determines if the Thread ID property returned by Notion is empty (meaning the task is new).

  7. Task Creation: If the task is new, an HTTP Request node fetches the user's email address (for link construction), and a Notion n8n node creates a new database page using the email subject as the title, and the snippet and email URL for the body content and properties.

Part 2: Notion to Gmail Sync (Label Removal)


  1. Notion Trigger: A specialized Notion n8n trigger constantly monitors the target database for page updates.

  2. Completion Check: An If n8n node verifies if the 'Complete' checkbox property in the updated page is set to true.

  3. Label Removal: If checked off, a Gmail n8n node uses the stored Thread ID to remove the initial trigger label from the corresponding email, finalizing the synchronization cycle. If not checked off, the flow stops via a NoOp n8n node.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and paste it into your n8n canvas using the 'New' -> 'Import from JSON' option.

  2. Notion Credentials: Locate the Notion n8n node instances ('Try get database page', 'Create database page', 'On updated database page') and update the placeholder credentials ([UPDATE ME]) with your valid Notion API key.

  3. Gmail Credentials: Update the Gmail OAuth2 credentials (REPLACE ME) in the 'Get emails from label and last request time', 'Remove label from target email', and 'Find my email address' n8n node settings.

  4. Database Configuration: Ensure your target Notion database exists and contains the necessary properties, specifically a Title field, a 'Thread ID' (Rich Text) field, and an 'Email thread' (URL) field. Update all Notion n8n node configurations with your specific database ID.

  5. Label Configuration: In the 'Get emails from label and last request time' and 'Remove label from target email' n8n node parameters, update the placeholder Label_9178764513576607415 with the ID of the specific Gmail label you intend to use as your n8n trigger.

Node Details

On schedule (Schedule Trigger n8n trigger):
Function: Starts the Gmail polling process periodically.
Key Configuration: Set to run every 1 minute.
Get emails from label and last request time (Gmail n8n node):
Function: Fetches emails from Gmail that have the designated label and were received since the last workflow execution, based on the time derived by the previous n8n node.
Key Configuration: Uses a specific labelId filter and sets Return All to True.
Try get database page (Notion n8n node):
Function: Serves as the duplicate checker. It searches the Notion database for a page where the 'Thread ID' property matches the current email's ID.
Key Configuration: Operation set to getAll, filtered by Rich Text value matching the incoming $json.id.
If database page not found (If n8n node):
Function: Controls the flow path based on the duplicate check. If the Notion property is empty, it proceeds to create the task.
Key Configuration: Checks if propertythreadid is isEmpty.
Create database page (Notion n8n node):
Function: Creates the new Notion task page using data extracted from the email (Subject, Snippet, and Thread ID).
Key Configuration: Dynamically maps Gmail data to Notion properties like Title and URL, demonstrating powerful n8n templating capabilities.
On updated database page (Notion Trigger n8n trigger):
Function: Listens for updates specifically within the configured Notion database. This is a crucial n8n trigger for the bidirectional sync.
Key Configuration: Listens for the pagedUpdatedInDatabase event.
If checked off (If n8n node):
Function: Determines if the update signal means the task has been marked complete.
Key Configuration: Checks if the Boolean value of Complete is True.
Remove label from target email (Gmail n8n node):
Function: Performs the final action: cleaning up the Gmail inbox by removing the specified task label.
Key Configuration: Operation removeLabels, targets the specific email message ID.

Related n8n Workflows

Free

Nodes: 0 Nodes
Updated: December 26 2025
View all
Created by
n8n Team
n8n Team

Meet the official n8n team. We specialize in building workflows that transform intricate tasks into seamless operations.

Featured*