May 20, 2026

Building Agentic Workflows with n8n

I've been experimenting with agentic workflows as a way to automate small repetitive tasks — things like triaging messages, summarizing updates, and routing data between tools without writing a full backend service for each one.

Why n8n

n8n sits in a nice middle ground: it's visual enough to iterate quickly, but still lets you drop into custom JavaScript nodes when the built-in integrations aren't enough. For agent-style workflows, the pattern I keep coming back to is:

A simple example

A workflow that watches an inbox, classifies incoming messages, and routes them accordingly might look like:

// Pseudocode for the routing node
const category = llmResponse.category;

if (category === "support") {
  return forwardTo("support-queue");
}

if (category === "spam") {
  return archive();
}

return forwardTo("general-inbox");

What I'd do differently next time

The biggest lesson so far is to keep the LLM's output format strict from the start — JSON with a fixed schema, validated before anything downstream touches it. Loosely-typed responses are fine for a demo, but they make debugging painful once the workflow has more than two or three branches.

Next up: wrapping this in a small dashboard so I can see which branch each run took without digging through n8n's execution logs.