---
title: n8n IMAP Triage Pipeline
area: infrastructure
tags: [n8n, imap, llm, automation, email]
created: 2026-03-27
updated: 2026-03-27
status: active
related: [[Infrastructure/Automation/n8n Workflows]], [[Infrastructure/Architecture]]
---

# n8n IMAP Triage Pipeline

## Overview

- **Workflow:** `IMAP Inbox Triage + Obsidian Notes`
- **Workflow ID:** `9sFwRyUDz51csAp7`
- **Schedule:** every 15 minutes
- **Account:** `wills_portal` IMAP (`will@wills-portal.com`)

## Pipeline flow

Read Unseen Emails
→ Stage 1 - Static Filter
→ Any Left?
→ Needs LLM Judgement?
→ Judge with Local LLM (only for ambiguous mail)
→ Parse LLM Result / Tag Definite Signal
→ Merge All Signal
→ Format & Send → Send to Telegram
→ Format Email Notes → Write Email to Vault

## Local LLM

- **Model:** `gemma-3-12b-it-q4_0.gguf`
- **Endpoint:** `http://192.168.153.113:18806/v1/chat/completions`
- **Used for:** ambiguous emails only
- **Reply shape:** JSON like `{"signal": true|false, "priority": 1|2|3, "reason": "..."}`
- **Priority scale:**
  - `1` = act now 🔴
  - `2` = read today 🟡
  - `3` = FYI 🔵

## Static filter behavior

### Definite noise
Examples include newsletters, no-reply mail, marketing, Discord/Plex/Spotify/YouTube-style noise, and known recurring low-value sender/subject patterns.

### Definite signal
Examples include login attempts, unusual access, invoices, payment due, receipts, urgent/action-required mail, password resets, GitHub/Gitea, and similar operational/security mail.

### Everything else
Sent to the local LLM for judgement.

## Outputs

### Telegram
- digest sent via OpenClaw Telegram bot
- grouped by priority with concise reason text

### Obsidian
- writes per-email notes to `Notes/YYYY-MM-DD Subject.md`
- uses the Obsidian Local REST API at `http://192.168.153.113:27123`

## Important operational notes

- The Obsidian Local REST API must be reachable when the workflow runs.
- A major 2026-03-27 failure mode was **not** the LLM or the workflow logic — it was shared-vault cross-user permissions on the `virtiofs` mount. The API was up, but writes to some folders hung until permissions were fixed.
- First checks if this breaks again:
  1. Obsidian Local REST API reachable?
  2. shared vault path writable from host Obsidian user (`claw`) and VM assistant user (`openclaw`)?
  3. local LLM endpoint still serving `gemma-3-12b-it-q4_0.gguf`?

## Validation summary

Validated live on 2026-03-27:
- n8n healthy
- local Gemma endpoint healthy
- live local inference succeeded
- Telegram notifications previously verified
- Obsidian REST writes repaired and re-verified after permission fix
