Back to Integrations
integrationGmail node
integrationS3 node

Gmail and S3 integration

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

How to connect Gmail and S3

  • 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.

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

Step 2: Add and configure Gmail and S3 nodes

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

Gmail and S3 integration: Add and configure Gmail and S3 nodes

Step 3: Connect Gmail and S3

A connection establishes a link between Gmail and S3 (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.

Gmail and S3 integration: Connect Gmail and S3

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

Gmail and S3 integration: Customize and extend your Gmail and S3 integration

Step 5: Test and activate your Gmail and S3 workflow

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from Gmail to S3 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.

Gmail and S3 integration: Test and activate your Gmail and S3 workflow

Expense organizer with Google Drive routing and Gemini AI entity detection

Who's it for

This workflow is perfect for individuals, small businesses, or households who need to:
Automatically process and categorize expense receipts
Extract structured data from invoices and receipts using AI
Store receipts in multiple locations (Google Drive and S3)
Send automated email notifications with expense details
Send documents to accounting systems via email hooks

How it works

This comprehensive expense processing workflow combines AI-powered document analysis with automated file management and notifications. Here's the complete flow:

Form Submission: Users submit expenses through a web form with receipt upload and category selection (Personal, Business, or Shared/Home)

AI Document Processing: The workflow extracts text from PDF receipts using OCR, then uses Google Gemini AI to parse and structure the data into a standardized JSON format including vendor details, amounts, dates, and categorization

Smart Routing: Based on the expense category, receipts are automatically routed to different processing paths with category-specific folder organization

Multi-Destination Storage: Receipts are uploaded to:
Google Drive (organized by year/month folders)
S3 cloud storage buckets
Different destinations based on expense type

Email Notifications: Sends formatted HTML email notifications with complete expense details and links to stored receipts

Accounting System Integration: Automatically forwards business expenses to accounting systems via email hooks (customizable per user requirements)

Requirements

Credentials needed:
Google Gemini API**: For AI-powered document analysis
Google Drive OAuth2**: For personal and business drive access
Gmail OAuth2**: For sending email notifications
S3 Storage**: For cloud backup (AWS S3, Wasabi, etc.)

Services used:
Google Drive (multiple accounts supported)
Google Gemini AI
Gmail
S3-compatible storage
Form trigger webhook

How to set up

Step 1: Configure Credentials
Set up Google Gemini API credentials in n8n
Configure Google Drive OAuth2 for both personal and business accounts
Add Gmail OAuth2 credentials
Set up S3 storage credentials

Step 2: Update Configuration
Replace all placeholder values:
YOUR_GEMINI_CREDENTIAL_ID with your Gemini credential ID
YOUR_PERSONAL_GDRIVE_CREDENTIAL_ID with personal Drive credential
YOUR_BUSINESS_GDRIVE_CREDENTIAL_ID with business Drive credential
YOUR_GMAIL_CREDENTIAL_ID with Gmail credential
YOUR_S3_CREDENTIAL_ID with S3 credential

Update Google Drive folder structure:
Replace YOUR_BUSINESS_DRIVE_ID and YOUR_SHARED_DRIVE_ID with actual drive IDs
Update the JavaScript code in the three Code nodes with your actual folder mapping

Configure email addresses:
Replace [email protected] with your notification email
Replace [email protected] with your accounting system's email hook (this is a mail hook for uploading documents to small business accounting systems - can be modified per user requirements)

Update S3 bucket names:
Replace business-expenses, personal-expenses, and shared-expenses with your bucket names

Step 3: Set Up Folder Structure
Create organized folder structures in your Google Drives:
Drive Root/
├── 2024/
│ ├── January/
│ ├── February/
│ └── ... (all months)
├── 2025/
│ ├── January/
│ └── ... (all months)
└── 2026/
└── ... (all months)

Step 4: Test the Workflow
Activate the workflow
Submit a test expense through the form
Verify files are uploaded to correct locations
Check email notifications are received

How to customize the workflow

Expense Categories
Modify the form dropdown options and conditional logic to add/remove expense categories:
Edit the "On form submission" node form fields
Update the IF condition nodes for routing
Add new processing paths as needed

AI Processing Schema
Customize the structured output parser schema to extract different fields:
Modify the JSON schema in the "Structured Output Parser" node
Update the AI system prompt for different extraction requirements
Add new fields for specific business needs

Storage Destinations
Add or modify storage locations:
Duplicate upload nodes for additional cloud services
Modify folder organization logic in Code nodes
Add new conditional routing for different storage rules

Email Templates
Customize the HTML email template:
Edit the email message content in the Gmail node
Add/remove expense fields in the table
Modify styling and branding

Folder Organization
Update the JavaScript code in Code nodes to match your folder structure:
Modify the CSV data with your actual folder IDs
Change the date-based organization logic
Add custom folder naming conventions

Integration Extensions
Extend the workflow with additional integrations:
Add Slack notifications
Connect to accounting software (QuickBooks, Xero)
Integrate with expense management platforms
Add approval workflows for business expenses

Nodes used in this workflow

Popular Gmail and S3 workflows

+2

Expense Organizer with Google Drive Routing and Gemini AI Entity Detection

Who's it for This workflow is perfect for individuals, small businesses, or households who need to: Automatically process and categorize expense receipts Extract structured data from invoices and receipts using AI Store receipts in multiple locations (Google Drive and S3) Send automated email notifications with expense details Send documents to accounting systems via email hooks How it works This comprehensive expense processing workflow combines AI-powered document analysis with automated file management and notifications. Here's the complete flow: Form Submission: Users submit expenses through a web form with receipt upload and category selection (Personal, Business, or Shared/Home) AI Document Processing: The workflow extracts text from PDF receipts using OCR, then uses Google Gemini AI to parse and structure the data into a standardized JSON format including vendor details, amounts, dates, and categorization Smart Routing: Based on the expense category, receipts are automatically routed to different processing paths with category-specific folder organization Multi-Destination Storage: Receipts are uploaded to: Google Drive (organized by year/month folders) S3 cloud storage buckets Different destinations based on expense type Email Notifications: Sends formatted HTML email notifications with complete expense details and links to stored receipts Accounting System Integration: Automatically forwards business expenses to accounting systems via email hooks (customizable per user requirements) Requirements Credentials needed: Google Gemini API**: For AI-powered document analysis Google Drive OAuth2**: For personal and business drive access Gmail OAuth2**: For sending email notifications S3 Storage**: For cloud backup (AWS S3, Wasabi, etc.) Services used: Google Drive (multiple accounts supported) Google Gemini AI Gmail S3-compatible storage Form trigger webhook How to set up Step 1: Configure Credentials Set up Google Gemini API credentials in n8n Configure Google Drive OAuth2 for both personal and business accounts Add Gmail OAuth2 credentials Set up S3 storage credentials Step 2: Update Configuration Replace all placeholder values: YOUR_GEMINI_CREDENTIAL_ID with your Gemini credential ID YOUR_PERSONAL_GDRIVE_CREDENTIAL_ID with personal Drive credential YOUR_BUSINESS_GDRIVE_CREDENTIAL_ID with business Drive credential YOUR_GMAIL_CREDENTIAL_ID with Gmail credential YOUR_S3_CREDENTIAL_ID with S3 credential Update Google Drive folder structure: Replace YOUR_BUSINESS_DRIVE_ID and YOUR_SHARED_DRIVE_ID with actual drive IDs Update the JavaScript code in the three Code nodes with your actual folder mapping Configure email addresses: Replace [email protected] with your notification email Replace [email protected] with your accounting system's email hook (this is a mail hook for uploading documents to small business accounting systems - can be modified per user requirements) Update S3 bucket names: Replace business-expenses, personal-expenses, and shared-expenses with your bucket names Step 3: Set Up Folder Structure Create organized folder structures in your Google Drives: Drive Root/ ├── 2024/ │ ├── January/ │ ├── February/ │ └── ... (all months) ├── 2025/ │ ├── January/ │ └── ... (all months) └── 2026/ └── ... (all months) Step 4: Test the Workflow Activate the workflow Submit a test expense through the form Verify files are uploaded to correct locations Check email notifications are received How to customize the workflow Expense Categories Modify the form dropdown options and conditional logic to add/remove expense categories: Edit the "On form submission" node form fields Update the IF condition nodes for routing Add new processing paths as needed AI Processing Schema Customize the structured output parser schema to extract different fields: Modify the JSON schema in the "Structured Output Parser" node Update the AI system prompt for different extraction requirements Add new fields for specific business needs Storage Destinations Add or modify storage locations: Duplicate upload nodes for additional cloud services Modify folder organization logic in Code nodes Add new conditional routing for different storage rules Email Templates Customize the HTML email template: Edit the email message content in the Gmail node Add/remove expense fields in the table Modify styling and branding Folder Organization Update the JavaScript code in Code nodes to match your folder structure: Modify the CSV data with your actual folder IDs Change the date-based organization logic Add custom folder naming conventions Integration Extensions Extend the workflow with additional integrations: Add Slack notifications Connect to accounting software (QuickBooks, Xero) Integrate with expense management platforms Add approval workflows for business expenses

Sync Gmail emails to PostgreSQL with S3 attachment storage

Sync Gmail emails to PostgreSQL with S3 attachment storage Automated Gmail Email Processing System Who's it for Businesses and individuals who need to: Archive email communications in a searchable database Backup email attachments to cloud storage Analyze email patterns and communication data Comply with data retention policies Integrate emails with other business systems What it does This workflow automatically captures, processes, and stores Gmail emails in a PostgreSQL database while uploading file attachments to S3/MinIO storage. It handles both individual emails (via Gmail Trigger) and bulk processing (via Schedule Trigger). Key features: Dual processing: real-time individual emails + scheduled bulk retrieval Complete email metadata extraction (sender, recipients, labels, timestamps) HTML to plain text conversion for searchable content Binary attachment processing with metadata extraction Organized S3/MinIO file storage structure UPSERT database operations to prevent duplicates How it works Email Capture: Gmail Trigger detects new emails, Schedule Trigger gets bulk emails from last hour Parallel Processing: Emails with attachments go through binary processing, others go directly to transformation Attachment Handling: Extract metadata, upload to S3/MinIO, create database references Data Transformation: Convert Gmail API format to PostgreSQL structure Storage: UPSERT emails to database with linked attachment information Requirements Credentials needed: Gmail OAuth2 (gmail.readonly scope) PostgreSQL database connection S3/MinIO storage credentials Database setup: Run the provided SQL schema to create the messages table with JSONB fields for flexible data storage. How to set up Gmail OAuth2: Enable Gmail API in Google Cloud Console, create OAuth2 credentials PostgreSQL: Create database and run the SQL schema provided in setup sticky note S3/MinIO: Create bucket "gmail-attachments" with proper upload permissions Configure: Update authenticatedUserEmail in transform scripts to your email Test: Start with single email before enabling bulk processing How to customize Email filters**: Modify Gmail queries (in:sent, in:inbox) to target specific emails Storage structure**: Change S3 file path format in Upload node Processing schedule**: Adjust trigger frequencies based on email volume Database fields**: Extend PostgreSQL schema for additional metadata Attachment types**: Add file type filtering in binary processing logic Note: This workflow processes emails from the last hour to avoid overwhelming the system. Adjust timeframes based on your email volume and processing needs.
+2

Human-in-the-Loop Post Designer with Mistral AI, ImageKit, and LinkedIn Publishing

📋 Description This n8n workflow streamlines AI-powered post creation with image banners, includes manual approval steps, and publishes to LinkedIn — all dynamically. It uses ImageKit.io to edit images, stores them on S3, and generates and revises posts through a Mistral AI Agent with human review. 🧠 How it Works (High-Level) 🔄 Triggered via incoming chat message 🧠 AI drafts a post and adds image instructions 🖼️ ImageKit API adds text overlay to image ☁️ Image is uploaded to S3 for public use 🧑‍⚖️ Human approval step via email 🔁 Optional revision loop 📢 Publishes approved content to LinkedIn 🛠️ Setup Requirements 🔑 API key for ImageKit.io 🧠 AI model via Mistral (or substitute like OpenAI) 📩 Email setup for Approval node ☁️ AWS S3 Bucket access 🔗 LinkedIn credentials for posting

Build your own Gmail and S3 integration

Create custom Gmail and S3 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.

Gmail supported actions

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

S3 supported actions

Create
Create a bucket
Delete
Delete a bucket
Get Many
Get many buckets
Search
Search within a bucket
Copy
Copy a file
Delete
Delete a file
Download
Download a file
Get Many
Get many files
Upload
Upload a file
Create
Create a folder
Delete
Delete a folder
Get Many
Get many folders

FAQs

  • Can Gmail connect with S3?

  • Can I use Gmail’s API with n8n?

  • Can I use S3’s API with n8n?

  • Is n8n secure for integrating Gmail and S3?

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

Need help setting up your Gmail and S3 integration?

Discover our latest community's recommendations and join the discussions about Gmail and S3 integration.
jake chard
Jan Koch
Paul Kennard

Looking to integrate Gmail and S3 in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate Gmail with S3

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