Back to Integrations
integrationGoogle Drive node
integrationMailgun node

Google Drive and Mailgun integration

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

How to connect Google Drive and Mailgun

  • 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 Mailgun integration: Create a new workflow and add the first step

Step 2: Add and configure Google Drive and Mailgun nodes

You can find Google Drive and Mailgun 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 Mailgun nodes one by one: input data on the left, parameters in the middle, and output data on the right.

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

Step 3: Connect Google Drive and Mailgun

A connection establishes a link between Google Drive and Mailgun (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 Mailgun integration: Connect Google Drive and Mailgun

Step 4: Customize and extend your Google Drive and Mailgun 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 Mailgun with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

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

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

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from Google Drive to Mailgun 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 Mailgun integration: Test and activate your Google Drive and Mailgun workflow

Process scanned invoices with Google Drive, OCR & OpenAI to Google Sheets

This template allows you to automatically process scanned invoices from Google Drive, extract key information using AI, and organize the data in Google Sheets with email notifications.

Overview
This comprehensive workflow automates the entire invoice processing pipeline by monitoring a Google Drive folder for new invoice uploads, intelligently processing both PDF and image formats, extracting structured data using AI-powered information extraction, and automatically organizing the results in a Google Sheet while sending email notifications. The system handles various file formats and includes smart fallback mechanisms for challenging documents like CamScanner PDFs.

How it Works

File Monitoring: The workflow continuously monitors a specified Google Drive folder for new invoice files using a trigger that checks every minute for newly created files.

File Processing: When new files are detected, the system downloads them and determines the file type (PDF or image) using a smart switch mechanism.

Text Extraction:
For PDFs: Attempts direct text extraction first
For Images: Uses OCR.Space API for optical character recognition
For problematic PDFs (like CamScanner): Falls back to OCR processing

AI Information Extraction: Processes the extracted text through OpenAI's language model to identify and extract key invoice information including:
Company name
Total amount
Currency
Invoice date
Invoice number

Data Storage: Automatically appends the extracted information to a Google Sheet with links back to the original scanned documents.

Notification: Sends formatted email notifications via Mailgun when new invoices are processed, including an HTML table summary.

How to Use

Setup Google Drive: Create a dedicated folder in Google Drive for invoice uploads and note the folder ID.

Configure Credentials: Set up the following credential connections in n8n:
Google Drive OAuth2 API
Google Sheets OAuth2 API
OpenAI API
OCR.Space API
Mailgun API

Update Configuration:
Replace the Google Drive folder ID with your target folder
Replace the Google Sheets document ID with your destination spreadsheet
Update email addresses in the Mailgun node

Test the Workflow: Use the manual trigger to process existing invoices in your folder for initial testing.

Activate: Enable the workflow to start automatic monitoring of new invoice uploads.

Requirements

External APIs:
OpenAI API** - For AI-powered information extraction from invoice text
OCR.Space API** - For optical character recognition of image-based invoices
Mailgun API** - For sending email notifications

Google Services:
Google Drive API** - For monitoring folders and downloading files
Google Sheets API** - For storing extracted invoice data

Setup Prerequisites:
Google Drive folder dedicated to invoice uploads
Google Sheet with appropriate column headers (date, company name, total, currency, invoice number, scan link, etc.)
Email domain configured with Mailgun (or alternative email service)
OCR.Space account for image processing capabilities: https://ocr.space/OCRAPI

Recommended Settings:
Set the Google Drive trigger to check for new files every minute
Ensure sufficient API rate limits for your expected invoice volume
Configure proper error handling for failed OCR or AI extraction attempts

Nodes used in this workflow

Popular Google Drive and Mailgun workflows

+2

Process Scanned Invoices with Google Drive, OCR & OpenAI to Google Sheets

This template allows you to automatically process scanned invoices from Google Drive, extract key information using AI, and organize the data in Google Sheets with email notifications. Overview This comprehensive workflow automates the entire invoice processing pipeline by monitoring a Google Drive folder for new invoice uploads, intelligently processing both PDF and image formats, extracting structured data using AI-powered information extraction, and automatically organizing the results in a Google Sheet while sending email notifications. The system handles various file formats and includes smart fallback mechanisms for challenging documents like CamScanner PDFs. How it Works File Monitoring: The workflow continuously monitors a specified Google Drive folder for new invoice files using a trigger that checks every minute for newly created files. File Processing: When new files are detected, the system downloads them and determines the file type (PDF or image) using a smart switch mechanism. Text Extraction: For PDFs: Attempts direct text extraction first For Images: Uses OCR.Space API for optical character recognition For problematic PDFs (like CamScanner): Falls back to OCR processing AI Information Extraction: Processes the extracted text through OpenAI's language model to identify and extract key invoice information including: Company name Total amount Currency Invoice date Invoice number Data Storage: Automatically appends the extracted information to a Google Sheet with links back to the original scanned documents. Notification: Sends formatted email notifications via Mailgun when new invoices are processed, including an HTML table summary. How to Use Setup Google Drive: Create a dedicated folder in Google Drive for invoice uploads and note the folder ID. Configure Credentials: Set up the following credential connections in n8n: Google Drive OAuth2 API Google Sheets OAuth2 API OpenAI API OCR.Space API Mailgun API Update Configuration: Replace the Google Drive folder ID with your target folder Replace the Google Sheets document ID with your destination spreadsheet Update email addresses in the Mailgun node Test the Workflow: Use the manual trigger to process existing invoices in your folder for initial testing. Activate: Enable the workflow to start automatic monitoring of new invoice uploads. Requirements External APIs: OpenAI API** - For AI-powered information extraction from invoice text OCR.Space API** - For optical character recognition of image-based invoices Mailgun API** - For sending email notifications Google Services: Google Drive API** - For monitoring folders and downloading files Google Sheets API** - For storing extracted invoice data Setup Prerequisites: Google Drive folder dedicated to invoice uploads Google Sheet with appropriate column headers (date, company name, total, currency, invoice number, scan link, etc.) Email domain configured with Mailgun (or alternative email service) OCR.Space account for image processing capabilities: https://ocr.space/OCRAPI Recommended Settings: Set the Google Drive trigger to check for new files every minute Ensure sufficient API rate limits for your expected invoice volume Configure proper error handling for failed OCR or AI extraction attempts

Build your own Google Drive and Mailgun integration

Create custom Google Drive and Mailgun 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

FAQs

  • Can Google Drive connect with Mailgun?

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

  • Can I use Mailgun’s API with n8n?

  • Is n8n secure for integrating Google Drive and Mailgun?

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

Need help setting up your Google Drive and Mailgun integration?

Discover our latest community's recommendations and join the discussions about Google Drive and Mailgun integration.
hubschrauber
Jon
David O'Neil

Looking to integrate Google Drive and Mailgun in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate Google Drive with Mailgun

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