Gmail email auto-organizer with Google Sheets rules
Transform your Gmail inbox from chaos to clarity with this revolutionary email organization system that uses Google Sheets as your command center for automated email management.
This powerful n8n workflow automatically processes, categorizes, and organizes your Gmail inbox using customizable rules stored in Google Sheets. Say goodbye to manual email sorting and hello to a perfectly organized inbox that adapts to your needs through simple spreadsheet management.
Key Innovation: Unlike traditional email filters that require complex Gmail setup, this system uses Google Sheets for intuitive rule management, allowing anyone to update email organization rules through a simple spreadsheet interface - no technical knowledge required!
What Makes This Different:
- Google Sheets Integration - Manage email rules through an easy-to-use spreadsheet interface
- Smart Pattern Matching - Automatically detects sender patterns and applies appropriate actions
- Flexible Rule System - Support for DELETE, PROMO, and LABEL actions with custom label names
- Intelligent Email Parsing - Extracts clean email addresses from various sender formats
- Automatic Inbox Management - Removes processed emails from inbox and marks as read
- Real-time Notifications - Slack integration for monitoring and completion alerts
Key Benefits of Sheet-Based Organization:
- Easy Rule Management - Update email rules without touching the workflow code
- Visual Rule Interface - See all your email organization rules in one place
- Scalable Organization - Add unlimited rules without workflow modifications
- Team Collaboration - Share and manage rules with team members through Google Sheets
- Flexible Actions - Choose between deleting, promoting, or labeling emails
- Custom Label Support - Create and apply custom Gmail labels automatically
Who's it for
This template is designed for busy professionals, entrepreneurs, small business owners, and anyone overwhelmed by email management. It's perfect for individuals and teams who receive high volumes of emails and need an intelligent, automated system to organize their Gmail inbox without manual intervention. Ideal for users who want to maintain a clean, organized inbox while ensuring important emails are properly categorized and promotional emails are handled appropriately.
How it works / What it does
This workflow creates an intelligent email organization system that automatically processes and categorizes your Gmail inbox using customizable rules stored in Google Sheets. The system:
- Triggers automatically on a schedule (configurable interval) to check for new emails
- Retrieves all unread emails from your Gmail inbox
- Parses sender email addresses to extract clean email addresses from various formats
- Loads organization rules from a Google Sheets document with customizable patterns
- Applies intelligent pattern matching to categorize emails based on sender patterns
- Executes appropriate actions (DELETE, PROMO, or LABEL) based on matched rules
- Manages Gmail labels automatically, creating new labels if needed
- Removes processed emails from inbox and marks them as read
- Sends completion notifications via Slack for monitoring
Key Innovation: Sheet-Based Rule Management - Unlike traditional email filters that require complex setup in Gmail, this system uses Google Sheets for easy rule management, allowing non-technical users to update email organization rules through a simple spreadsheet interface.
How to set up
1. Configure Gmail API Credentials
- Set up Gmail OAuth2 API credentials in n8n
- Ensure the account has permissions to read, modify, and manage Gmail messages
- Grant access to Gmail labels and message operations
2. Set up Google Sheets Integration
- Create a Google Sheets document for email organization rules
- Set up Google Sheets OAuth2 API credentials in n8n
- Configure the sheet with the required columns: Pattern, Action, LabelName, RemoveFromInbox
3. Configure Email Organization Rules
- Add your email organization rules to the Google Sheets document
- Use the Pattern column to specify sender patterns (e.g., "@company.com", "newsletter@")
- Set Action to DELETE, PROMO, or LABEL based on desired behavior
- Specify LabelName for custom labels when Action is LABEL
- Set RemoveFromInbox to TRUE/FALSE to control inbox removal
4. Set up Slack Notifications (Optional)
- Configure Slack API credentials for the notification channel
- Update the channel ID where completion notifications will be sent
- Customize notification messages as needed
5. Configure Schedule
- Adjust the Schedule Trigger node for your preferred interval
- Consider running every few minutes for real-time organization
- Test with manual execution first to verify setup
6. Test the Integration
- Run a manual execution to verify all components work correctly
- Check your Gmail inbox and labels to see organized emails
- Verify Slack notifications are received (if configured)
Requirements
- n8n instance (self-hosted or cloud) with API access
- Gmail account with API access and sufficient email volume
- Google Sheets account for rule management
- Slack workspace for notifications (optional but recommended)
- Gmail labels that need to be created and managed automatically
How to customize the workflow
Modify Email Processing Frequency
- Adjust the Schedule Trigger node for different intervals (every few minutes, hourly, daily)
- Add multiple schedule triggers for different email types
- Implement conditional scheduling based on email volume
Enhance Rule Management
- Add more complex pattern matching (regex support, multiple conditions)
- Implement rule priorities and conflict resolution
- Add rule validation and error handling
Expand Notification System
- Add email notifications for organization events
- Integrate with monitoring systems (PagerDuty, OpsGenie)
- Add detailed reporting on email organization statistics
Advanced Email Processing
- Add support for email content analysis and categorization
- Implement sentiment analysis for email prioritization
- Add support for attachment handling and organization
Security and Privacy Enhancements
- Implement email content encryption for sensitive information
- Add audit logging for email organization actions
- Set up access controls for rule management
Performance Optimizations
- Add batch processing for high-volume email accounts
- Implement intelligent caching for frequently accessed rules
- Add email processing metrics and performance monitoring
Key Features
- Google Sheets Integration - Manage email rules through an intuitive spreadsheet interface
- Smart Pattern Matching - Automatically detects sender patterns and applies appropriate actions
- Flexible Action System - Support for DELETE, PROMO, and LABEL actions with custom configurations
- Intelligent Email Parsing - Extracts clean email addresses from various sender formats
- Automatic Gmail Management - Creates labels, removes from inbox, and marks as read automatically
- Real-time Notifications - Slack integration for monitoring and completion alerts
- Scalable Rule System - Add unlimited rules without workflow modifications
- Error Handling - Graceful failure handling with detailed error reporting
Technical Architecture Highlights
Google Sheets Integration
- Dynamic Rule Loading - Rules are loaded from Google Sheets on each execution
- Real-time Rule Updates - Changes to the sheet are immediately reflected in email processing
- Flexible Rule Format - Support for Pattern, Action, LabelName, and RemoveFromInbox columns
- Error Handling - Graceful handling of missing or invalid rule configurations
Email Processing Optimization
- Intelligent Email Parsing - Extracts clean email addresses from various sender formats
- Pattern Matching - Efficient substring matching for sender identification
- Batch Processing - Processes multiple emails in a single execution cycle
- Gmail API Integration - Direct integration with Gmail for label management and inbox operations
Workflow Efficiency
- Parallel Data Loading - Gmail messages and labels are loaded simultaneously
- Smart Rule Application - Efficient pattern matching and action execution
- Automatic Label Management - Creates and manages Gmail labels automatically
- Streamlined Notifications - Single completion notification per execution cycle
Use Cases
- Busy professionals with high email volumes needing automated organization
- Small business owners managing multiple email streams and client communications
- Entrepreneurs handling various business emails requiring different priority levels
- Teams needing consistent email organization across multiple team members
- Customer service departments requiring automated email categorization
- Sales teams needing lead and prospect email organization
Business Value
- Time Savings - Eliminates manual email sorting and organization tasks
- Improved Productivity - Focus on important emails without inbox clutter
- Consistent Organization - Automated email categorization ensures nothing is missed
- Reduced Stress - Clean, organized inbox reduces email overwhelm
- Team Efficiency - Standardized email organization across team members
- Scalable Solution - Handles increasing email volume without performance degradation
Google Sheets Rule Configuration
Required Columns:
- Pattern - Substring to match in sender email (e.g., "@company.com", "newsletter@")
- Action - Action to take: DELETE, PROMO, or LABEL
- LabelName - Custom label name (only required when Action = LABEL)
- RemoveFromInbox - TRUE/FALSE to control inbox removal (optional)
Example Rules:
Pattern: @newsletter.com
Action: PROMO
LabelName:
RemoveFromInbox: TRUE
Pattern: @client.com
Action: LABEL
LabelName: Clients
RemoveFromInbox: FALSE
Pattern: spam@
Action: DELETE
LabelName:
RemoveFromInbox: TRUE
This template revolutionizes email management by providing an intuitive, spreadsheet-based approach to email organization that grows with your needs while maintaining the highest levels of automation and reliability.
Gmail Email Auto-Organizer with Google Sheets Rules
This n8n workflow automates the organization of your Gmail inbox by applying rules defined in a Google Sheet. It periodically checks for new emails, processes them based on your custom rules, and can optionally send notifications to Slack if an email matches a rule.
What it does
- Triggers on a Schedule: The workflow runs at a set interval (e.g., every 5 minutes) to check for new emails.
- Fetches Gmail Emails: It retrieves a specified number of recent emails from your Gmail inbox.
- Loads Rules from Google Sheets: It reads a list of email organization rules from a designated Google Sheet. Each rule likely contains criteria (e.g., sender, subject keywords) and an action (e.g., mark as read, label).
- Processes Emails in Batches: Emails are processed in manageable batches to prevent overwhelming the system or hitting API rate limits.
- Applies Rules to Emails: For each email, it iterates through the rules from the Google Sheet.
- Conditional Rule Application: An
Ifnode checks if an email matches a rule's criteria. - Executes Gmail Actions: If a rule matches, it performs the specified action on the email in Gmail (e.g., adds a label, marks as read, archives).
- Sends Slack Notifications (Optional): If an email matches a rule, it can send a notification to a specified Slack channel.
- Merges Results: After processing, the results from different branches are merged back together.
Prerequisites/Requirements
- n8n Instance: A running n8n instance.
- Gmail Account: A Google account with Gmail access.
- Google Sheets Account: A Google account with access to Google Sheets.
- Slack Account (Optional): A Slack workspace if you wish to receive notifications.
Setup/Usage
- Import the Workflow: Import the provided JSON into your n8n instance.
- Configure Credentials:
- Gmail: Set up a Google OAuth2 credential for Gmail. Ensure it has permissions to read, modify, and manage labels for your emails.
- Google Sheets: Set up a Google OAuth2 credential for Google Sheets. Ensure it has permissions to read from your designated spreadsheet.
- Slack (Optional): Set up a Slack API credential if you plan to use Slack notifications.
- Configure Google Sheets Node:
- Specify the Spreadsheet ID and Sheet Name where your email organization rules are defined. The sheet should have columns corresponding to your rule criteria (e.g.,
sender,subjectKeyword,action,label).
- Specify the Spreadsheet ID and Sheet Name where your email organization rules are defined. The sheet should have columns corresponding to your rule criteria (e.g.,
- Configure Gmail Node (Trigger):
- Adjust the
maxResultsproperty to control how many recent emails are fetched at each run. - Consider adding a
queryto filter emails (e.g.,is:unreadorafter:YYYY/MM/DD).
- Adjust the
- Configure Code Node:
- The
Codenode is crucial for implementing the logic to match emails against your Google Sheet rules. You will need to customize the JavaScript code within this node to define how rules are applied. This includes parsing the rule data from Google Sheets and comparing it against email properties (sender, subject, body, etc.).
- The
- Configure If Node:
- The
Ifnode will likely be configured based on the output of theCodenode to determine if a rule was matched and what action to take.
- The
- Configure Gmail Node (Actions):
- Customize the actions (e.g.,
Add Label,Mark as Read,Archive) based on your rules. These actions will use expressions to dynamically apply labels or other modifications based on the matched rule data.
- Customize the actions (e.g.,
- Configure Slack Node (Optional):
- If enabled, specify the Slack channel and customize the message content to be sent when an email matches a rule.
- Activate the Workflow: Once configured, activate the workflow to start automatic email organization.
Related Templates
Auto-create TikTok videos with VEED.io AI avatars, ElevenLabs & GPT-4
π₯ Viral TikTok Video Machine: Auto-Create Videos with Your AI Avatar --- π― Who is this for? This workflow is for content creators, marketers, and agencies who want to use Veed.ioβs AI avatar technology to produce short, engaging TikTok videos automatically. Itβs ideal for creators who want to appear on camera without recording themselves, and for teams managing multiple brands who need to generate videos at scale. --- βοΈ What problem this workflow solves Manually creating videos for TikTok can take hours β finding trends, writing scripts, recording, and editing. By combining Veed.io, ElevenLabs, and GPT-4, this workflow transforms a simple Telegram input into a ready-to-post TikTok video featuring your AI avatar powered by Veed.io β speaking naturally with your cloned voice. --- π What this workflow does This automation links Veed.ioβs video-generation API with multiple AI tools: Analyzes TikTok trends via Perplexity AI Writes a 10-second viral script using GPT-4 Generates your voiceover via ElevenLabs Uses Veed.io (Fabric 1.0 via FAL.ai) to animate your avatar and sync the lips to the voice Creates an engaging caption + hashtags for TikTok virality Publishes the video automatically via Blotato TikTok API Logs all results to Google Sheets for tracking --- π§© Setup Telegram Bot Create your bot via @BotFather Configure it as the trigger for sending your photo and theme Connect Veed.io Create an account on Veed.io Get your FAL.ai API key (Veed Fabric 1.0 model) Use HTTPS image/audio URLs compatible with Veed Fabric Other APIs Add Perplexity, ElevenLabs, and Blotato TikTok keys Connect your Google Sheet for logging results --- π οΈ How to customize this workflow Change your Avatar: Upload a new image through Telegram, and Veed.io will generate a new talking version automatically. Modify the Script Style: Adjust the GPT prompt for tone (educational, funny, storytelling). Adjust Voice Tone: Tweak ElevenLabs stability and similarity settings. Expand Platforms: Add Instagram, YouTube Shorts, or X (Twitter) posting nodes. Track Performance: Customize your Google Sheet to measure your most successful Veed.io-based videos. --- π§ Expected Outcome In just a few seconds after sending your photo and theme, this workflow β powered by Veed.io β creates a fully automated TikTok video featuring your AI avatar with natural lip-sync and voice. The result is a continuous stream of viral short videos, made without cameras, editing, or effort. --- β Import the JSON file in n8n, add your API keys (including Veed.io via FAL.ai), and start generating viral TikTok videos starring your AI avatar today! π₯ Watch This Tutorial --- π Documentation: Notion Guide Need help customizing? Contact me for consulting and support : Linkedin / Youtube
Two-way property repair management system with Google Sheets & Drive
This workflow automates the repair request process between tenants and building managers, keeping all updates organized in a single spreadsheet. It is composed of two coordinated workflows, as two separate triggers are required β one for new repair submissions and another for repair updates. A Unique Unit ID that corresponds to individual units is attributed to each request, and timestamps are used to coordinate repair updates with specific requests. General use cases include: Property managers who manage multiple buildings or units. Building owners looking to centralize tenant repair communication. Automation builders who want to learn multi-trigger workflow design in n8n. --- βοΈ How It Works Workflow 1 β New Repair Requests Behind the Scenes: A tenant fills out a Google Form (βRepair Request Formβ), which automatically adds a new row to a linked Google Sheet. Steps: Trigger: Google Sheets rowAdded β runs when a new form entry appears. Extract & Format: Collects all relevant form data (address, unit, urgency, contacts). Generate Unit ID: Creates a standardized identifier (e.g., BUILDING-UNIT) for tracking. Email Notification: Sends the building manager a formatted email summarizing the repair details and including a link to a Repair Update Form (which activates Workflow 2). --- Workflow 2 β Repair Updates Behind the Scenes:\ Triggered when the building manager submits a follow-up form (βRepair Update Formβ). Steps: Lookup by UUID: Uses the Unit ID from Workflow 1 to find the existing row in the Google Sheet. Conditional Logic: If photos are uploaded: Saves each image to a Google Drive folder, renames files consistently, and adds URLs to the sheet. If no photos: Skips the upload step and processes textual updates only. Merge & Update: Combines new data with existing repair info in the same spreadsheet row β enabling a full repair history in one place. --- π§© Requirements Google Account (for Forms, Sheets, and Drive) Gmail/email node connected for sending notifications n8n credentials configured for Google API access --- β‘ Setup Instructions (see more detail in workflow) Import both workflows into n8n, then copy one into a second workflow. Change manual trigger in workflow 2 to a n8n Form node. Connect Google credentials to all nodes. Update spreadsheet and folder IDs in the corresponding nodes. Customize email text, sender name, and form links for your organization. Test each workflow with a sample repair request and a repair update submission. --- π οΈ Customization Ideas Add Slack or Telegram notifications for urgent repairs. Auto-create folders per building or unit for photo uploads. Generate monthly repair summaries using Google Sheets triggers. Add an AI node to create summaries/extract relevant repair data from repair request that include long submissions.
Automate Dutch Public Procurement Data Collection with TenderNed
TenderNed Public Procurement What This Workflow Does This workflow automates the collection of public procurement data from TenderNed (the official Dutch tender platform). It: Fetches the latest tender publications from the TenderNed API Retrieves detailed information in both XML and JSON formats for each tender Parses and extracts key information like organization names, titles, descriptions, and reference numbers Filters results based on your custom criteria Stores the data in a database for easy querying and analysis Setup Instructions This template comes with sticky notes providing step-by-step instructions in Dutch and various query options you can customize. Prerequisites TenderNed API Access - Register at TenderNed for API credentials Configuration Steps Set up TenderNed credentials: Add HTTP Basic Auth credentials with your TenderNed API username and password Apply these credentials to the three HTTP Request nodes: "Tenderned Publicaties" "Haal XML Details" "Haal JSON Details" Customize filters: Modify the "Filter op ..." node to match your specific requirements Examples: specific organizations, contract values, regions, etc. How It Works Step 1: Trigger The workflow can be triggered either manually for testing or automatically on a daily schedule. Step 2: Fetch Publications Makes an API call to TenderNed to retrieve a list of recent publications (up to 100 per request). Step 3: Process & Split Extracts the tender array from the response and splits it into individual items for processing. Step 4: Fetch Details For each tender, the workflow makes two parallel API calls: XML endpoint - Retrieves the complete tender documentation in XML format JSON endpoint - Fetches metadata including reference numbers and keywords Step 5: Parse & Merge Parses the XML data and merges it with the JSON metadata and batch information into a single data structure. Step 6: Extract Fields Maps the raw API data to clean, structured fields including: Publication ID and date Organization name Tender title and description Reference numbers (kenmerk, TED number) Step 7: Filter Applies your custom filter criteria to focus on relevant tenders only. Step 8: Store Inserts the processed data into your database for storage and future analysis. Customization Tips Modify API Parameters In the "Tenderned Publicaties" node, you can adjust: offset: Starting position for pagination size: Number of results per request (max 100) Add query parameters for date ranges, status filters, etc. Add More Fields Extend the "Splits Alle Velden" node to extract additional fields from the XML/JSON data, such as: Contract value estimates Deadline dates CPV codes (procurement classification) Contact information Integrate Notifications Add a Slack, Email, or Discord node after the filter to get notified about new matching tenders. Incremental Updates Modify the workflow to only fetch new tenders by: Storing the last execution timestamp Adding date filters to the API query Only processing publications newer than the last run Troubleshooting No data returned? Verify your TenderNed API credentials are correct Check that you have setup youre filter proper Need help setting this up or interested in a complete tender analysis solution? Get in touch π LinkedIn β Wessel Bulte