Skip to main content

Triage emails and build a morning digest with a local Ollama LLM

Workflow preview

Workflow preview
100%
Triage emails and build a morning digest with a local Ollama LLM preview
Open on n8n.io

1. Workflow Overview

Quick overview This workflow triages emails with a local Ollama LLM (gemma4:e4b), flags urgent messages for immediate alerting, and compiles a morning digest grouped by urgency categories. How it w...

Best for

  • Ticket Management automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.manualtrigger, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatollama, n8n-nodes-base.if, n8n-nodes-base.noop, n8n-nodes-base.errortrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Salahuddin Uqaili.

Original n8n.io source

1.1 Workflow description

Title
Triage emails and build a morning digest with a local Ollama LLM
Workflow name
Triage emails and build a morning digest with a local Ollama LLM

Quick overview

This workflow triages emails with a local Ollama LLM (gemma4:e4b), flags urgent messages for immediate alerting, and compiles a morning digest grouped by urgency categories.

How it works

  1. Runs manually and generates a sample set of incoming emails.
  2. Sends each email to Ollama (gemma4:e4b) with a prompt that classifies it as URGENT, REPLY_TODAY, FYI, or JUNK and returns structured JSON.
  3. Parses the LLM output into JSON and falls back to a safe default classification if the response is malformed.
  4. Separates emails marked URGENT and formats an urgent alert message for each one.
  5. Aggregates all classified emails into a single morning digest text grouped by category with suggested actions and totals.
  6. If the workflow errors, captures the failure details and outputs a structured error record.

Setup

  1. Set up an Ollama API credential in n8n that points to your Ollama server (for example, http://host.docker.internal:11434).
  2. Ensure the specified Ollama model (gemma4:e4b) is available locally, or update the model name in the Ollama Chat Model configuration.
  3. Replace the sample email generator with your real email source (for example, Gmail or Microsoft Outlook) and add a delivery step for urgent alerts and the digest (for example, Slack or email).

Requirements

  • n8n 1.19.4 or later (LangChain nodes required)
  • Ollama running locally with a chat model (tested with gemma4:e4b)

Customization

  • Edit the classification prompt in the Classify Email node to add or change urgency categories
  • Swap the Ollama Chat Model for OpenAI or Anthropic by replacing the LLM sub-node
  • Connect Slack, Telegram, or email after the Format Urgent Alert node for instant notifications

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Manual Execution Trigger

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 7 - Simulate Email Input

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - AI Email Classifier

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.5

Block 9 - Ollama AI Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOllama - lmChatOllama
Config choices
Version 1

Block 10 - Parse Email Categories

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Check If Urgent Email

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 12 - Create Urgent Email Alert

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Skip Urgent Processing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 14 - Compile Morning Email Digest

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Workflow Error Trigger

Type / Role
n8n-nodes-base.errorTrigger - errorTrigger
Config choices
Version 1

Block 16 - Record Error Information

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

3. Summary Table

Workflow Triage emails and build a morning digest with a local Ollama LLM
Complexity advanced
Nodes 16
Categories Ticket Management, AI Summarization
Author Salahuddin Uqaili
Published 21 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15913/15913.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Triage emails and build a morning digest with a local Ollama LLM do?

Quick overview This workflow triages emails with a local Ollama LLM (gemma4:e4b), flags urgent messages for immediate alerting, and compiles a morning digest grouped by urgency categories. How it w...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management, AI Summarization use case.