envitron · grigoriadis — AI-Training

n8n Fundamentals: Visual Workflow Automation with AI

What n8n is, how its node-based workflows actually work, how to wire in LLMs and AI agents, and why teams self-host it.

Difficulty
beginner
Duration
30 min
Language
EN
Updated
2026-06-23
License
cc-by-sa-4.0
Authors
t.grigoriadis

What is n8n?

n8n (pronounced “n-eight-n”) is a workflow automation tool: you wire together apps, APIs and logic on a visual canvas instead of writing glue code by hand. Think Zapier or Make — but source-available and self-hostable, so your data and credentials stay on your own infrastructure.

It is fair-code licensed: free to self-host, the full source is open, and it ships 400+ ready-made integrations plus an escape hatch to raw code whenever the visual nodes aren’t enough.

The mental model: nodes, items, connections

A workflow is a graph of nodes. Each node receives data, does one thing, and passes data on. Data travels between nodes as a list of items — plain JSON objects — so the output of one node is the input of the next.

true

false

Trigger

Set / Edit Fields

IF

HTTP Request

Code

Merge

Master three words and n8n clicks: node (a step), item (one JSON record flowing through), connection (the wire that carries items).

Triggers: how a workflow starts

Every workflow begins with a trigger node. The common ones:

Everything after the trigger is action and logic nodes that run in order for each incoming item.

The node landscape

Three families cover almost everything you’ll build:

Data & expressions

You map data between nodes with expressions — JavaScript inside {{ }}:

{{ $json.email }}                          // a field on the current item
{{ $json.items.map(i => i.name).join(", ") }} // transform inline
{{ $node["Webhook"].json.body.query }}     // pull from another node
{{ $now.minus({ days: 7 }).toISODate() }}  // built-in date helpers

$json is the current item, $node[...] reaches any earlier node, and helpers like $now save you from date math. This is where “no-code” quietly becomes “a little code”.

n8n + LLMs

n8n ships first-class AI nodes (built on LangChain). The base building block is a Chat Model node feeding an LLM Chain:

Chat Model (claude-opus-4-8)  →  LLM Chain  →  parsed output  →  next node

So any workflow can summarise, classify, extract or rewrite — mid-pipeline, right next to your Slack and database nodes.

AI Agents & tools

The AI Agent node is where it gets powerful: give a model tools and memory, and it decides which tools to call to finish a task.

Chat / Webhook input

AI Agent

Chat Model: Claude / GPT / Gemini / Ollama

Memory

Tools: HTTP · Vector store · Code · Sub-workflow

Action: reply, write to DB, call an API

A “tool” is just another n8n node the agent is allowed to use. That turns n8n into an agent runtime with real-world side effects, not just a chat box.

RAG in n8n

Retrieval-Augmented Generation drops straight into a workflow. (New to RAG? See RAG Fundamentals.)

retriever tool

Documents

Embeddings

Vector store: Qdrant / pgvector

User question

AI Agent

Chat Model

Grounded answer

Ingest docs once (embed → vector store), then give the agent a retriever tool. n8n supports Qdrant, Pinecone, Supabase and Postgres/pgvector out of the box — so a private, self-hosted RAG bot is a weekend, not a quarter.

Build your first workflow

A “summarise my inbox” bot, end to end:

  1. Trigger — a Gmail/IMAP trigger (or a Schedule node that reads new mail).
  2. AI Agent / LLM Chain — Chat Model = Claude; prompt: “Summarise this email in two sentences and tag it urgent/normal.”
  3. Map data{{ $json.subject }} and {{ $json.body }} into the prompt.
  4. Action — post the summary to Slack with an IF on the urgency tag.
  5. Test — click Execute, pin a sample email, iterate on the prompt.
  6. Activate — flip the workflow on; the trigger now runs it automatically.

Why teams choose n8n

The trade-off: you run the infrastructure. For anyone who values control and privacy over a fully managed SaaS, that’s the point — not the price.

Check your understanding

What makes the n8n AI Agent node more than a chatbot?

Takeaways