Gmail on Autopilot: 15 Insane n8n Automation Hacks

Jono CatliffAbout 9 min readMay 30, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

Gmail automation, NADN (n8n), Gmail trigger, email filtering, auto-labeling, text classification, OpenAI, Chat GPT, auto-reply, draft emails, forwarding emails, task creation (ClickUp), Slack notifications, Google Drive upload, data extraction from PDFs, JSON data, Google Sheets integration, array aggregator, polling, self-hosting.

Gmail Automation with NADN: 15 Ways to Win Back Time

This video details 15 methods for automating Gmail using NADN (n8n), an automation platform. The speaker emphasizes the significant quality of life improvements achieved through these automations, which he personally uses daily. The approach starts with basic setups and progressively advances to more complex workflows.

1. Gmail Trigger: The Foundation of Automation

The core of Gmail automation in NADN is the Gmail trigger, specifically the "When a message is received in Gmail" trigger.

  • Simplifying Data: Initially, the trigger response hides crucial data, particularly the full email text. Unchecking the "Simplify" option reveals all email content, including the complete text, which is essential for comprehensive automation.
  • Gmail Search Filters: NADN allows leveraging Gmail's powerful search functionality through the "Filter" option in the trigger. This filter mirrors Gmail's search bar, enabling filtering by various criteria.
  • Filter Examples: Common filters include "file name" (e.g., finding only PDF documents) and "subject line" (e.g., filtering for emails with the subject "New Lead"). The video demonstrates setting up a filter for emails with the subject line "New Lead."
  • More Info: Clicking "More Info" provides a link to a comprehensive list of available filter options.

2. Auto-Labeling Emails: Categorizing Incoming Messages

Auto-labeling is a key automation technique for organizing Gmail inboxes.

  • Text Classifier: The "Text Classifier" node categorizes incoming emails based on their content. It analyzes the subject line and email body to determine the appropriate label.
  • Input Values: The text classifier receives two inputs: the subject line and the email body.
  • Classification Paths: The video demonstrates classifying emails into "Primary," "Social," and "Promotions" categories. A "Miscellaneous" category serves as a catch-all for uncategorized emails.
  • Description Importance: The description provided for each category is crucial for the AI's accuracy. Less is often more; concise descriptions prevent conflicts and mislabeling. Examples:
    • Primary: "Anything that is a personal message such as an email from a friend or family member."
    • Social: "Anything that is a social message such as an email notification from Facebook, Instagram, or YouTube."
    • Promotions: "Anything that is a promotional message such as a discount email, promotion, or anything from an e-commerce brand."
  • Large Language Model (LLM): A large language model, such as Chat GPT, is required for the text classifier to function. The video uses the GPT-4 Turbo model.
  • OpenAI API Key: To use Chat GPT, an OpenAI account with a paid API key is necessary. The video briefly explains how to obtain the API key from platform.openai.com.
  • Adding Labels: After classification, a Gmail node with the "Add a label to a message" operation applies the appropriate label to the email. The message ID is obtained from the Gmail trigger, and the label name is selected based on the text classifier's output.

3. Project Zero Inbox: Achieving Inbox Cleanliness

The speaker discusses the concept of "Project Zero Inbox," where all incoming emails are automatically routed to labels, resulting in an empty inbox. While aesthetically pleasing, the speaker cautions against completely hiding emails, as it can lead to missed important messages.

4. Marking Emails as Read/Unread and Deleting Junk Emails

To manage unwanted emails, NADN can automatically mark social and promotional emails as read. The video recommends starting with marking as read before implementing automatic deletion to avoid accidental data loss.

  • Mark Message as Unread: A Gmail node with the "Mark message as unread" operation is used. The message ID is obtained from the Gmail trigger.
  • Deleting Messages: A Gmail node can also be used to delete messages automatically. However, the speaker advises caution and thorough testing before enabling this feature.

5. Supercharging Gmail with Auto-Replies and Draft Responses

NADN can automate email responses using OpenAI.

  • OpenAI Message a Model: The OpenAI node with the "Message a Model" operation generates email replies.
  • System and User Messages: The OpenAI node requires two messages:
    • System Message: Provides context to the AI, instructing it to generate draft responses to incoming emails. The speaker recommends including personal details (name, job title, company) and specific rules (e.g., signing off with a name, addressing the user by their first name).
    • User Message: Contains the input email content (subject line and email body) that the AI should respond to.
  • Model Selection: The video uses the GPT-4 Turbo model for its speed and intelligence.
  • Creating Draft Emails: A Gmail node with the "Create a draft" operation creates a draft email with the generated response. The thread ID from the original email is used to attach the draft to the correct conversation.
  • Sending Messages: A Gmail node with the "Send a message" operation can be used to send the generated response automatically. The speaker recommends creating drafts first to ensure the quality of the responses.

6. Forwarding Emails: Automating Information Sharing

Emails can be automatically forwarded to team members or other services.

  • Example: Forwarding to Accounting Software (Dex): The video demonstrates forwarding accounting-related emails with attachments to Dex, an accounting software.
  • Workflow: The workflow filters for emails classified as "Accounting" that contain attachments. The email is then forwarded to Dex's designated email address.

7. Task Creation in ClickUp: Integrating with Project Management Tools

NADN can create tasks in ClickUp based on incoming emails.

  • ClickUp Node: The ClickUp node with the "Create a task" operation creates a new task in a specified ClickUp folder or list.
  • Task Details: The task details (name, description, etc.) can be populated with information from the email.

8. Slack Notifications: Keeping Teams Informed

NADN can send Slack notifications to alert team members about important emails or tasks.

  • Slack Node: The Slack node with the "Send a message" operation sends a message to a specified Slack channel or user.
  • Message Content: The message content can include information from the email, such as the subject line, sender, and body.

9. Uploading Attachments to Google Drive: Automating File Storage

Email attachments can be automatically uploaded to Google Drive.

  • Google Drive Node: The Google Drive node with the "Upload a file" operation uploads a file to a specified Google Drive folder.
  • Attachment Data: The "Input Data Field Name" should be set to "attachment_0" (or the appropriate attachment number) to specify the attachment to upload.
  • File Name: The file name can be customized using the email ID or other relevant information.

10. Extracting Structured Data from Unstructured Messages: The Power of AI

This section focuses on extracting structured data (e.g., first name, last name, email, budget) from unstructured email messages or PDF documents using OpenAI and Chat GPT.

  • Extract from PDF Node: If dealing with a PDF document, the "Extract from PDF" node converts the PDF into text. The "attachment_0" field specifies the attachment to extract text from.
  • OpenAI Message a Model: The OpenAI node with the "Message a Model" operation is used to extract the structured data.
  • System, User, and Assistant Messages:
    • System Message: Instructs the AI to extract specific information (e.g., first name, last name, email, budget) from the email text.
    • User Message: Contains the unstructured email text or the extracted text from the PDF.
    • Assistant Message: Provides a sample JSON data structure with blank values, guiding the AI on how to format the output.
  • JSON Data Structure: The video emphasizes the importance of providing a clear JSON data structure to the AI. This structure defines the fields to extract and their data types.
  • Output as JSON Data: The "Output as JSON Data" option in the OpenAI node ensures that the output is in JSON format.
  • Google Sheets Integration: The extracted data can be automatically added to a Google Sheet using the Google Sheets node with the "Append row" operation. The fields in the Google Sheet are mapped to the corresponding fields in the JSON data.

11. Summarizing Leads: Generating Reports from Your Inbox

NADN can generate daily, weekly, or monthly reports summarizing leads or other important information from your inbox.

  • Schedule Trigger: A "Schedule" trigger is used to run the workflow at a specified interval (e.g., daily).
  • Gmail Get Many Messages: The Gmail node with the "Get many messages" operation retrieves multiple emails from the inbox based on a search filter (e.g., subject equals "New Lead").
  • Array Aggregator: An "Array Aggregator" node merges the individual emails into a single list. This is crucial for sending a single summary message instead of multiple individual messages.
  • Slack Message: A Slack node sends a message containing the summarized information to a specified Slack channel or user.
  • Set/Edit Fields: A "Set/Edit Fields" node can be used to format the summarized information before sending it in the Slack message.

12. Granting Access to Your Account: Delegating Email Management

The speaker highlights the benefit of granting access to a virtual assistant or team member to manage your Gmail account. This can significantly reduce the time spent on email management.

  • Gmail Settings: In Gmail settings, under "Accounts and Imports," you can grant access to your account to another user.
  • Labeling for Delegation: You can create labels for your personal assistant to go through and assign tasks or emails to them.

13. Polling vs. Webhooks: Understanding Trigger Mechanisms

The video concludes by explaining the concept of polling and its implications for NADN usage.

  • Polling: The Gmail trigger uses polling, where NADN periodically sends requests to Gmail to check for new emails.
  • Operation Costs: Each poll, regardless of whether a new email is found, counts as an operation in NADN.
  • Plan Limitations: The limited number of operations in NADN's starter plan can be quickly exhausted with frequent polling.
  • Self-Hosting: The speaker recommends self-hosting NADN to bypass the operation limitations. Self-hosting options include Hostinger, Allesio, and Railway.

Conclusion

This video provides a comprehensive guide to automating Gmail using NADN. By implementing these 15 techniques, users can significantly reduce the time spent on email management, improve organization, and streamline workflows. The speaker emphasizes the importance of understanding the underlying concepts, such as polling and JSON data, to effectively leverage NADN's capabilities. The video also highlights the benefits of self-hosting NADN to overcome the limitations of the cloud-based plans.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.