AI Agents

Analyze and organize email messages with AI

23 nodes 346 145 Scheduled trigger
Download

Workflow Description

A scheduled automation that retrieves incoming Gmail messages and processes them through OpenAI to extract key information, categorize content, and organize emails automatically without manual intervention.

How it works

  1. 1.Schedule the automation to run at defined intervals to check for new messages
  2. 2.Fetch emails from Gmail with limits applied to control processing volume
  3. 3.Split emails into batches for faster parallel processing
  4. 4.Send each batch to OpenAI for content analysis and key information extraction
  5. 5.Structure results and route them for further actions or storage

Use cases

  • Summarize and categorize incoming emails automatically by priority or type
  • Extract specific data from large volumes of incoming mail at scale
  • Reduce manual email handling by automating intelligent message processing

Requirements

  • Active Gmail account with API access enabled
  • Valid OpenAI API key
  • Configured schedule for appropriate check frequency (hourly or daily)

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Gmail OpenAI Split In Batches

Details

Trigger Scheduled trigger
Nodes 23
Apps 3
Views 346
Downloads 145

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (23)

/

Convert raw to base64

Code

#1

Add email draft to thread

HTTP Request

#2

Remove AI label from email

Gmail

#3

Schedule trigger (1 min)

Schedule Trigger

#4

Map fields for further processing

Set

#5

Convert response to HTML

Markdown

#6

Build email raw

Set

#7

Sticky Note

Sticky Note

#8

Sticky Note2

Sticky Note

#9

Sticky Note1

Sticky Note

#10

Sticky Note4

Sticky Note

#11

Sticky Note5

Sticky Note

#12

Sticky Note7

Sticky Note

#13

Sticky Note8

Sticky Note

#14

Sticky Note9

Sticky Note

#15

Get threads with specific labels

Gmail

#16

Ask OpenAI Assistant

OpenAI

#17

Loop over threads

Split In Batches

#18

Get thread messages

Gmail

#19

Return last message in thread

Limit

#20

Get single message content

Gmail

#21

Sticky Note10

Sticky Note

#22

Sticky Note11

Sticky Note

#23