Agentic AI Builder's Bootcamp · Week 3

Building Multi-Agent Systems in n8n & Hermes

From Single Agents to Orchestrated Teams — plus your always-on Hermes assistant

Dr. Aki Wijesundara

Dr. Aki Wijesundara

Instructor

Today's Lecture

Eight parts — agents in n8n, then Hermes as your front door

📚

Part 1: Foundations

What is n8n and why it matters for AI systems

🛠

Part 2: Node Taxonomy

The building blocks you need to understand

🤖

Part 3: Demo 1

Single agent with tools (AI calculator)

👥

Part 4: Multi-Agent Theory

Why one agent isn't enough

Part 5: Demo 2

Orchestrator pattern with lead enrichment

📱

Part 6: Hermes

Always-on assistant on WhatsApp / Telegram

Part 7: Skills & Cron

Packaged abilities and recurring jobs

📋

Part 8: Assignment

General submission + stretch goals

What is n8n?

Open-source workflow automation built on a directed graph architecture

🔗

Native LangChain Integration

AI agents, memory, tools, and output parsers are first-class citizens — not plugins

🔒

Self-Hostable

Your data, your infra, your models. Critical for production AI where data governance matters

👁

Inspectable Execution

Every node run is logged with full input/output. See exactly what happened and why

400+ integrations. Supports JavaScript and Python inside nodes. Free tier on n8n cloud, or self-host for free forever.

The Four Node Categories

Every n8n workflow is composed of nodes in four categories

1. Trigger Nodes

Entry points — a workflow does nothing until a trigger fires.

WebhookChat TriggerScheduleForm Trigger

2. Action Nodes

Perform operations on external systems. The "do" nodes.

Google SheetsSlackHTTP RequestGmail

3. Logic & Transform Nodes

Control flow and reshape data. Your control flow primitives.

IFSwitchCodeMergeSet

4. AI Nodes (LangChain Layer)

The layer we'll spend most of today on.

AI AgentChat ModelMemoryToolsOutput ParserAI Agent Tool

AI Agent Tool — the multi-agent primitive. Makes one agent available as a tool to another agent.

The AI Agent Execution Loop

The agent follows a ReAct (Reasoning + Acting) loop

1. Receive Input

User's message or data from previous node

2. Reason

LLM looks at input, system prompt, and available tools

3. Act

Agent calls a tool (calculator, web search, API, sub-agent)

4. Observe

Tool returns a result. Agent reads it.

5. Repeat or Return

Enough info? Return output. Otherwise, call another tool.

Key Insight

This is not a simple input → output pipeline. It's an autonomous loop where the LLM decides the control flow at runtime.

Default limit: The loop runs up to N iterations (configurable, default 10). If the agent can't resolve in N steps, it returns whatever it has.

Single Agent with Tools (AI Calculator)

A chat-based AI agent that does math using a calculator tool

Architecture

💬 Chat Trigger
🤖 AI Agent
GPT-4.1-miniCalculator
// User asks:
"What is 4,782 divided by 17?"

// Agent reasons:
"I need to compute this"
 calculator("4782 / 17")
 281.29...
 "4,782 / 17 = 281.29"
💡

Why This Matters

Without the calculator tool, the LLM would guess (and likely get it wrong for large numbers). With the tool, the agent delegates to a deterministic system.

Build Steps

  • Add Chat Trigger (public, with greeting)
  • Add AI Agent node, connect to trigger
  • Add OpenAI Chat Model (GPT-4.1-mini)
  • Add Calculator tool, attach to Agent
  • Test and inspect the execution log

The Problem with Single Agents

What happens when you add 10 tools to one agent?

❌ Single Agent + 10 Tools

  • Picks the wrong tool
  • Hallucinates parameters
  • Chains tools in wrong order
  • Ignores tools and answers from memory
  • Accuracy degrades as tool count grows

✅ Multiple Specialists (2-3 tools each)

  • Each agent has focused responsibility
  • Clean tool boundaries
  • Failures are isolated
  • Independently testable
  • Scales by adding agents

Same principle as microservices: Single responsibility. Loose coupling. Independent deployability. In n8n, this uses the AI Agent Tool node.

Multi-Agent Coordination Patterns

Three common patterns — we'll build Pattern 1 today

🎯

Pattern 1: Orchestrator

One parent agent receives all input. It decides which sub-agent to delegate to.

Best for: chat interfaces, multi-step tasks

Pattern 2: Sequential

Agent A → Agent B → Agent C. Fixed order. Each processes and passes to the next.

Best for: fixed data processing pipelines

🔀

Pattern 3: Router

Classifier categorises input, switch node routes to the appropriate agent. Deterministic.

Best for: high-volume, speed over flexibility

Today we implement Pattern 1: Orchestrator with sub-agents as tools.

Multi-Agent Lead Enrichment & Routing

Type a name → auto-research on web → structure data → save to Google Sheets

🤖

Orchestrator Agent

  • System prompt: "Infer lead name, auto research, save to Sheets"
  • LLM: GPT-4.1-mini | Memory: Window Buffer (10)
  • Never asks for confirmation
🔍

Deep Research Agent

  • GPT-4.1-mini + web search
  • Structured Output Parser
  • Returns: name, linkedin, description
📄

Google Sheet Agent

  • GPT-4.1-mini
  • Google Sheets "Append Row"
  • $fromAI() dynamic fields

Architecture Flow

💬 Chat Trigger
🤖 Orchestrator
🔍 Research
📄 Sheets
✅ Lead saved to Sheets

Key Implementation Details

The patterns that make multi-agent systems work

$fromAI() — Dynamic Parameter Injection

Instead of hardcoding values, write $fromAI('field_name', '', 'string'). The LLM decides what value to pass at runtime.

n8n's implementation of LangChain's tool parameter specification.

Structured Output Parser

Forces agent to return valid JSON matching a schema. Without it, agents return prose. With it, you get predictable structure.

Critical for inter-agent communication.

Web Search (Built-in)

GPT-4.1-mini supports native web search. When enabled on the Chat Model node, the agent searches the web as part of its reasoning loop.

No separate API or node needed.

Window Buffer Memory

Stores the last N message pairs. Handles follow-ups: "Now look up their CTO" works because the agent remembers context.

Set to 10 messages for this demo.

Execution Trace

What happens at runtime when a user types "Look up Sarah Chen from Anthropic"

Chat Trigger → Orchestrator

Orchestrator reasons: "I need to research this person" → calls Deep Research Agent

Deep Research Agent

Activates web search → finds LinkedIn, role, background → returns structured JSON

{"name": "Sarah Chen", "linkedin": "linkedin.com/in/...", "description": "ML researcher at Anthropic..."}

Google Sheet Agent

Uses $fromAI() to populate fields → appends row to spreadsheet

Orchestrator Responds

"Done — Sarah Chen has been added to your leads sheet."

~4-6 agent iterations. ~10-15 seconds. The entire sequence was decided by the orchestrator at runtime — we didn't hardcode the order.

Comparing the Two Demos

The conceptual leap from tools-as-functions to tools-as-agents

🤖 Single Agent (Calculator)

  • 1 agent, 1 tool, 1 reasoning step
  • Agent decides to use calculator, gets result, responds
  • Tools are functions
  • Good for simple tasks with few tools

👥 Multi-Agent (Lead Router)

  • 1 orchestrator + 2 sub-agents, each with own LLMs
  • Orchestrator delegates research to one, data writing to another
  • Tools are autonomous agents
  • Good for complex multi-step tasks, separation of concerns

The orchestrator doesn't need to know how enrichment works. It just knows it can delegate to an agent that handles it.

Introduction to Hermes

An always-on AI assistant that lives in your messaging channels

📱

What it is

Open-source assistant (Nous Research Hermes Agent) that runs on your server with persistent memory, skills, and cron.

🔗

Why pair with n8n

n8n runs inspectable agent graphs. Hermes is the front door — chat, memory, skills — so users never see the canvas.

💬

Where it lives

WhatsApp, Telegram, Slack, Discord, CLI — one gateway. Your keys, your VPS, your data.

How it connects to today's build

  • Lead router workflow → exposed as a Hermes skill / webhook (stretch)
  • Orchestrator stays in n8n; Hermes can call it when steps are complex
  • Memory + channel context handled by Hermes so n8n stays focused on the graph

Mental model

Think of n8n as the hands (it executes) and Hermes as the face (it talks to you, remembers, and decides what to hand off).

Not a model provider. An assistant you operate — same posture as Week 2 Claude Code, but always-on in your channels.

Front door · brain · hands

The stack you leave with today

Front door

WhatsApp / Telegram

Where you already live. The channel is not the intelligence.

Brain

Hermes

Personality, memory, skills, cron, and the decision to act.

Hands

n8n (when needed)

Known steps and multi-agent graphs. Wire via webhook/skill as a stretch — not assumed built-in.

Stand up Hermes in four moves

Real product flow — not OpenClaw Hostinger pairing

1. Install Hermes

VPS recommended (or local). Follow the cohort setup sheet, or run hermes setup.

2. Choose your model

hermes model — Claude, OpenAI, OpenRouter, or Nous Portal. Add your API key.

3. Connect a channel

hermes gateway setup — Telegram is fastest; WhatsApp via the built-in bridge.

4. Message it for real

Start the gateway, send a test, confirm replies with memory and tools live. Lock down allowed users before going wide.

Skills and always-on work

Packaged abilities + scheduled jobs in natural language

Skills (agentskills.io)

A skill is a described ability: name, when to use it, what it does. Same craft as Week 2 Claude skills.

  • Author 1–2 skills for real work (not toys)
  • Prefer skills you wrote or reviewed
  • Test: fires when it should, skips when it shouldn't

Cron / recurring jobs

Hermes has a built-in scheduler. Ask in plain language for daily briefs, lead research, backups.

Every weekday at 9:00, research 5 high-fit leads for my AI product. Send results to this chat.

Stretch: expose today's n8n lead router as a Hermes skill via webhook — Hermes face, n8n hands.

Assignment

Part 1 required — Part 2 stretch. Full brief + build guide on the syllabus.

Part 1 — General submission (required)

Ship one: fixed n8n workflow, single n8n AI agent, or live Hermes with a skill — on a real trigger, useful for your product.

  • Runs on trigger or schedule (not only manual Execute)
  • One line: workflow / single agent / multi-agent / Hermes — and why
  • Clip + n8n JSON export and/or Hermes screenshot

Stretch — Qualification

Score Hot / Warm / Cold with a short reason; write score + reasoning somewhere durable.

Stretch — Notifications

When Hot / high priority: Slack, email, or Hermes on WhatsApp.

Stretch — Live Hermes

Channel + 2 skills + one real task. Optional: call n8n via webhook.

Stretch — Handle failures

Empty results, bad tool calls, unauthorized senders — degrade gracefully.

Bonus

  • Connect to your Lovable / Pennywise / capstone product
  • Post on LinkedIn (#BUILDINPUBLIC)
  • Build guide on syllabus: week-3-automation-agent-build-guide

This is not a UI exercise. It is a systems design exercise. Your architecture determines robustness.