Back to Integrations
integrationGoogle Drive node
integrationGmail node

Google Drive and Gmail integration

Save yourself the work of writing custom integrations for Google Drive and Gmail and use n8n instead. Build adaptable and scalable Data & Storage, and Communication workflows that work with your technology stack. All within a building experience you will love.

How to connect Google Drive and Gmail

  • Step 1: Create a new workflow
  • Step 2: Add and configure nodes
  • Step 3: Connect
  • Step 4: Customize and extend your integration
  • Step 5: Test and activate your workflow

Step 1: Create a new workflow and add the first step

In n8n, click the "Add workflow" button in the Workflows tab to create a new workflow. Add the starting point – a trigger on when your workflow should run: an app event, a schedule, a webhook call, another workflow, an AI chat, or a manual trigger. Sometimes, the HTTP Request node might already serve as your starting point.

Google Drive and Gmail integration: Create a new workflow and add the first step

Step 2: Add and configure Google Drive and Gmail nodes

You can find Google Drive and Gmail in the nodes panel. Drag them onto your workflow canvas, selecting their actions. Click each node, choose a credential, and authenticate to grant n8n access. Configure Google Drive and Gmail nodes one by one: input data on the left, parameters in the middle, and output data on the right.

Google Drive and Gmail integration: Add and configure Google Drive and Gmail nodes

Step 3: Connect Google Drive and Gmail

A connection establishes a link between Google Drive and Gmail (or vice versa) to route data through the workflow. Data flows from the output of one node to the input of another. You can have single or multiple connections for each node.

Google Drive and Gmail integration: Connect Google Drive and Gmail

Step 4: Customize and extend your Google Drive and Gmail integration

Use n8n's core nodes such as If, Split Out, Merge, and others to transform and manipulate data. Write custom JavaScript or Python in the Code node and run it as a step in your workflow. Connect Google Drive and Gmail with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

Google Drive and Gmail integration: Customize and extend your Google Drive and Gmail integration

Step 5: Test and activate your Google Drive and Gmail workflow

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from Google Drive to Gmail or vice versa. Easily debug your workflow: you can check past executions to isolate and fix the mistake. Once you've tested everything, make sure to save your workflow and activate it.

Google Drive and Gmail integration: Test and activate your Google Drive and Gmail workflow

Send specific PDF attachments from Gmail to Google Drive using OpenAI

This workflow reads PDF textual content and sends the text to OpenAI. Attachments of interest will then be uploaded to a specified Google Drive folder. For example, you may wish to send invoices received from an email to an inbox folder in Google Drive for later processing. This workflow has been designed to easily change the search term to match your needs. See the workflow for more details.

Prerequisites

OpenAI credentials.
Google credentials.

How it works

Triggers off on the On email received node.
Iterates over the attachments in the email.
Uses the OpenAI node to filter out the attachments that do not match the search term set in the Configure node. You could match on various PDF files (i.e. invoice, receipt, or contract).
If the PDF attachment matches the search term, the workflow uses the Google Drive node to upload the PDF attachment to a specific Google Drive folder.

Nodes used in this workflow

Popular Google Drive and Gmail workflows

+4

🤖🧑‍💻 AI Agent for Top n8n Creators Leaderboard Reporting

This n8n workflow is designed to automate the aggregation, processing, and reporting of community statistics related to n8n creators and workflows. Its primary purpose is to generate insightful reports that highlight top contributors, popular workflows, and key trends within the n8n ecosystem. Here's how it works and why it's important: How It Works Data Retrieval: The workflow fetches JSON data files from a GitHub repository containing statistics about creators and workflows. It uses HTTP requests to access these files dynamically based on pre-defined global variables. Data Processing: The data is parsed into separate streams for creators and workflows. It processes the data to identify key metrics such as unique weekly and monthly inserters/visitors. Ranking and Filtering: The workflow sorts creators by their weekly inserts and workflows by their popularity. It selects the top 10 creators and top 50 workflows for detailed analysis. Report Generation: Using AI tools like GPT-4 or Google Gemini, the workflow generates a Markdown report summarizing trends, contributors, and workflow statistics. The report includes tables with detailed metrics (e.g., unique visitors, inserters) and insights into why certain workflows are popular. Distribution: The report is saved locally or uploaded to Google Drive. It can also be shared via email or Telegram for broader accessibility. Automation: A schedule trigger ensures the workflow runs daily or as needed, keeping the reports up-to-date. Why It's Important Community Insights**: This workflow provides actionable insights into the n8n community by identifying impactful contributors and popular workflows. This fosters collaboration and innovation within the ecosystem. Time Efficiency**: By automating data collection, processing, and reporting, it saves significant time and effort for community managers or administrators. Recognition of Contributors**: Highlighting top creators encourages engagement and recognizes individuals driving value in the community. Trend Analysis**: The workflow helps uncover patterns in usage, enabling better decision-making for platform improvements or feature prioritization. Scalability**: With its modular design, this workflow can be easily adapted to include additional metrics or integrate with other tools.
+5

Smart Email Assistant: Automate Customer Support with AI & Supabase

Intelligent Email Support System with Vector Database Overview This n8n workflow automates email support using AI and vector database technology to provide smart, context-aware responses. It seamlessly integrates email automation and document management, ensuring efficient customer support. 📌 System Components ✉️ Email Support System Email Monitoring & Classification Gmail trigger node monitoring inbox AI-powered email classification Intelligent routing (support vs non-support inquiries) AI Response Generation LangChain agent for response automation OpenAI integration for NLP-driven replies Vector-based knowledge retrieval Automated draft creation in Gmail Vector Database System Supabase vector store for document management OpenAI embeddings for vector conversion Fast and efficient similarity search 📂 Document Management System Google Drive Integration Monitors specific folders for new/updated files Automatic document processing Supports various file formats Document Processing Pipeline Auto file download & text extraction Smart text chunking for better indexing Embedding generation via OpenAI Storage in Supabase vector database 🔄 Workflow Processes 📧 Email Support Flow Monitor Gmail inbox for new emails AI classification of incoming messages Route support emails to AI response generator Perform vector similarity search for knowledge retrieval Generate personalized AI-driven response Create email drafts in Gmail 📁 Document Management Flow Monitor Google Drive for new/updated files Auto-download and process documents Clean up outdated vector entries for updated files Extract and split document text efficiently Generate OpenAI embeddings Store processed data in Supabase vector DB ⚙️ Setup Instructions 1️⃣ Prerequisites Supabase** account & project OpenAI API key** Gmail account** with OAuth2 setup Google Drive API** access n8n installation** 2️⃣ Supabase Database Setup -- Create the vector extension create extension if not exists vector; -- Create the documents table create table documents ( id bigserial primary key, content text, metadata jsonb, embedding vector(1536) ); -- Create an index for similarity search create index on documents using ivfflat (embedding vector_cosine_ops) with (lists = 100); 3️⃣ Google Drive Setup Create & configure two monitored folders: RAG folder for new documents documents Assign correct folder permissions Add folder IDs to the workflow 4️⃣ Document Processing Configuration Set up triggers for file creation and file updates Configure text extraction: Define chunk size & overlap settings Set document metadata processing 🔍 Maintenance & Optimization 📌 Regular Tasks Monitor system performance Update the knowledge base regularly Review AI response quality Optimize vector search parameters Clean up outdated document embeddings ✅ Best Practices Document Organization Maintain structured folders & naming conventions Keep knowledge base content updated System Optimization Track AI classification accuracy Tune response times & chunk sizes Perform regular database maintenance 🛠️ Troubleshooting Email Issues Verify Gmail API credentials Check AI service uptime Monitor classification performance Document Processing Issues Ensure correct file permissions Validate extraction & embedding processes Debug vector database insertions
+7

Effortless Email Management with AI-Powered Summarization & Review

How it Works This workflow automates the handling of incoming emails, summarizes their content, generates appropriate responses using a retrieval-augmented generation (RAG) approach, and obtains approval or suggestions before sending replies. Below is an explanation of its functionality divided into two main sections: Email Handling and Summarization: The process begins with the Email Trigger (IMAP) node which listens for new emails in a specified inbox. Once an email is received, the Markdown node converts its HTML content into plain text if necessary, followed by the Email Summarization Chain that uses AI to create a concise summary of up to 100 words. Response Generation and Approval: A Write email node generates a professional response based on the summarized content, ensuring brevity and professionalism while keeping within the word limit. Before sending out any automated replies, the system sends these drafts via Gmail for human review and approval through the Gmail node configured with free-text response options. If approved, the finalized email is sent back to the original sender using the Send Email node; otherwise, it loops back for further edits or manual intervention. Additionally, there's a Text Classifier node designed to categorize feedback from humans as either "Approved" or "Declined", guiding whether the email should proceed directly to being sent or require additional editing. Set Up Steps To replicate this workflow within your own n8n environment, follow these essential configuration steps: Configuration: Begin by setting up an n8n instance either locally or via cloud services offered directly from their official site. Import the provided JSON configuration file into your workspace, making sure all required credentials such as IMAP, SMTP, OpenAI API keys, etc., are properly set up under Credentials since multiple nodes rely heavily on external integrations for functionalities like reading emails, generating summaries, crafting replies, and managing approvals. Customization: Adjust parameters according to specific business needs, including but not limited to adjusting the conditions used during conditional checks performed by nodes like Approve?. Modify the template messages given to AI models so they align closely with organizational tone & style preferences while maintaining professionalism expected in business communications. Ensure correct mappings between fields when appending data to external systems where records might need tracking post-interaction completion, such as Google Sheets or similar platforms.

Save n8n Cloud invoices received in Gmail in Google Drive

Who this is for This template is for everyone that wants to download their n8n Cloud invoices automatically as a PDF instead of downloading them manually. How it works This workflow checks your Gmail inbox for new n8n invoice emails from n8n's payment provider Paddle. Once it finds something, it converts the URL into a PDF using pdflayer and saves it in Google Drive. Setup Setup your Gmail and Google Drive credentials Create a free account at https://pdflayer.com/ Insert your pdflayer API key into the Setup node Insert the URL to the wanted drive folder into the setup node (make sure to remove everything after the ?) How to adjust it to your need Instead of saving the PDF in Google drive, you could also save it in your local system, any other storage provider or send the PDF automatically to the right person in your company.

Get Multiple Attachments from Gmail and upload them to GDrive

This is a simple template to show how to extract multiple email attachments and return them as an iterable output. How it works: The Gmail Trigger node detects any new email that has attachments. The Code node will then extract them as binary files and attaches them to the item. They can then be uploaded via the Google Drive node. Setup steps: add your Gmail Credentials add your Google Drive Credentials Follow the official n8n Documentation for help Feedback & Questions If you have any questions or feedback about this workflow - Feel free to get in touch at [email protected]

Send specific PDF attachments from Gmail to Google Drive using OpenAI

This workflow reads PDF textual content and sends the text to OpenAI. Attachments of interest will then be uploaded to a specified Google Drive folder. For example, you may wish to send invoices received from an email to an inbox folder in Google Drive for later processing. This workflow has been designed to easily change the search term to match your needs. See the workflow for more details. Prerequisites OpenAI credentials. Google credentials. How it works Triggers off on the On email received node. Iterates over the attachments in the email. Uses the OpenAI node to filter out the attachments that do not match the search term set in the Configure node. You could match on various PDF files (i.e. invoice, receipt, or contract). If the PDF attachment matches the search term, the workflow uses the Google Drive node to upload the PDF attachment to a specific Google Drive folder.

Build your own Google Drive and Gmail integration

Create custom Google Drive and Gmail workflows by choosing triggers and actions. Nodes come with global operations and settings, as well as app-specific parameters that can be configured. You can also use the HTTP Request node to query data from any app or service with a REST API.

Google Drive supported actions

Copy
Create a copy of an existing file
Create From Text
Create a file from a provided text
Delete
Permanently delete a file
Download
Download a file
Move
Move a file to another folder
Share
Add sharing permissions to a file
Update
Update a file
Upload
Upload an existing file to Google Drive
Search
Search or list files and folders
Create
Create a folder
Delete
Permanently delete a folder
Share
Add sharing permissions to a folder
Create
Create a shared drive
Delete
Permanently delete a shared drive
Get
Get a shared drive
Get Many
Get the list of shared drives
Update
Update a shared drive

Gmail supported actions

Add Label
Delete
Get
Get Many
Mark as Read
Mark as Unread
Remove Label
Reply
Send
Send and Wait for Approval
Create
Delete
Get
Get Many
Create
Delete
Get
Get Many
Add Label
Delete
Get
Get Many
Remove Label
Reply
Trash
Untrash

FAQs

  • Can Google Drive connect with Gmail?

  • Can I use Google Drive’s API with n8n?

  • Can I use Gmail’s API with n8n?

  • Is n8n secure for integrating Google Drive and Gmail?

  • How to get started with Google Drive and Gmail integration in n8n.io?

Need help setting up your Google Drive and Gmail integration?

Discover our latest community's recommendations and join the discussions about Google Drive and Gmail integration.
jake chard
Jan Koch
hubschrauber
Jon
David O'Neil

Looking to integrate Google Drive and Gmail in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate Google Drive with Gmail

Build complex workflows, really fast

Build complex workflows, really fast

Handle branching, merging and iteration easily.
Pause your workflow to wait for external events.

Code when you need it, UI when you don't

Simple debugging

Your data is displayed alongside your settings, making edge cases easy to track down.

Use templates to get started fast

Use 1000+ workflow templates available from our core team and our community.

Reuse your work

Copy and paste, easily import and export workflows.

Implement complex processes faster with n8n

red iconyellow iconred iconyellow icon