Sparround

AI components in n8n: chains and agents

AI in n8n is built on cluster nodes: a root node in the middle with sub-nodes attached beneath it that extend what it can do.

The main sub-node types:

  • Chat Model — which language model to use (OpenAI, Anthropic, Google, local models via Ollama and others)
  • Memory — conversation history
  • Tool — what the agent can call
  • Embeddings, Vector Store, Document Loader — for RAG

Root nodes fall into two families: chains and the agent.

AspectChainAgent
How it worksCalls components in a predetermined sequenceThe language model decides which action to take
ToolsNoneYes — at least one tool must be connected
MemoryNot supported — it cannot remember previous queriesSupported
Number of runsOnceSeveral times — it calls a tool, evaluates the response and continues
PredictabilityHigh — you know what will happenLower — the model decides
CostOne model callSeveral calls — more expensive

n8n provides three chain nodes:

  • Basic LLM Chain — talks to the model directly, with no extra components
  • Question and Answer Chain — connects to a vector store through a retriever, or to a workflow; for asking questions about documents
  • Summarization Chain — takes an input and returns a summary

On the agent side there is one node: the AI Agent. It used to have an agent-type setting, but that parameter is deprecated from n8n 1.82.0 — every AI Agent node now works as a Tools Agent. That older version will be removed in n8n 3.0, so old workflows need updating.

The selection rule: when you know exactly what should happen, use a chain. When the model must decide for itself what information it needs, use an agent.

The most common mistake is reaching for an agent for everything. An agent runs several times, calling the model each time, which raises cost — and the result is less predictable. When the task is "summarise this text" or "classify this email", a chain is enough — cheaper and more consistent.

📚 Sources and documentation