Extracts unread emails, summarizes each one with a fully local LLM, and loads structured results into a spreadsheet — zero external API calls, zero cost per run.
Extract → Transform → Load · the whole pipeline runs on your own machine
- What This Pipeline Does
- Architecture
- AI Model
- Output Format
- Required Integrations
- Setup
- Security
- Roadmap
| Step | Action |
|---|---|
| 📥 | Fetches the latest emails from Gmail |
| 📄 | Extracts subject + email body |
| 🤖 | Sends content to a local AI model (TinyLlama via Ollama) |
| ✨ | Generates a short 2-line summary |
| 📊 | Stores subject + summary in Google Sheets |
flowchart LR
A[📥 Gmail Inbox] -->|OAuth2| B[n8n: Fetch Latest Emails]
B --> C[📄 Extract Subject + Body]
C --> D{{"🤖 Local LLM\nTinyLlama via Ollama"}}
D -->|"Summarize in 2 lines"| E[✨ Generated Summary]
E --> F[(📊 Google Sheets)]
- Model:
tinyllama - Runs locally via:
http://127.0.0.1:11434/api/generate - Prompt:
Summarize this email in 2 lines only
Results land directly in Google Sheets:
| subject | summary |
|---|---|
| Email Title | AI-generated short summary |
1. Import the workflow
- Open n8n
- Click Import
- Upload
My workflow.jsonfrom this repo
2. Configure Gmail
- Connect your Gmail account
- Ensure read access is enabled
3. Set up Ollama (local AI)
Install Ollama and run:
ollama run tinyllamaMake sure the API is running at:
http://127.0.0.1:11434
4. Configure Google Sheets
- Connect your Google account
- Ensure the target sheet has columns:
subjectsummary
5. Run the workflow
- Click Execute Workflow
- Check results in Google Sheets
⚠️ Good to know: the workflow runs manually (can be automated later), only works while Ollama is running locally, and is subject to Gmail API rate limits.
Do NOT expose:
- Gmail credentials
- Google Sheets API keys
- Local Ollama endpoints
██░░░░░░░░ 0 / 5 complete
- Auto-trigger on new emails
- Use GPT / OpenAI as a swappable cloud model option
- Add spam filtering
- Store full email + summary (not just the summary)
- Build an analytics dashboard over summarized history
