Gmail to using and
Workflow Description
An automation template that receives Gmail messages, processes them by splitting text content into manageable chunks, generates semantic embeddings using a local model, and stores both data and vectors in Postgres with vector search capabilities for intelligent retrieval.
How it works
- 1.Trigger on new Gmail messages
- 2.Split message content into chunks using recursive character splitting
- 3.Generate vector embeddings from text using Ollama
- 4.Store data and embeddings in Postgres with pgvector support
Use cases
- Build semantic search engine over email content
- Archive and retrieve email documents using intelligent vector similarity
Requirements
- Gmail account with API access enabled
- Postgres database with pgvector extension installed and configured
Service Value
Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (20)
Embeddings Ollama
Embeddings Ollama
Default Data Loader
Document Default Data Loader
Recursive Character Text Splitter
Text Splitter Recursive Character Text Splitter
Gmail Trigger
Gmail
Loop Over Items
Split In Batches
Split Out
Split Out
Was manually triggered?
If
Manual Trigger
Manual Trigger
No Operation, do nothing
No Op
Sticky Note
Sticky Note
Sticky Note1
Sticky Note
Sticky Note2
Sticky Note
Set before and after dates
Set
Extract email fields
Set
Sticky Note3
Sticky Note
Store structured
Postgres
Store vectorized
Vector Store P G Vector
Create the table
Postgres
Explode interval into weeks
Code
Get a batch of messages
Gmail