---
title: "n8n AI Nodes Explained: A Beginner's Walkthrough"
description: "Plain-language guide to n8n's AI/LLM nodes — what each one does, how prompts and chaining work, and how to build your first AI step without API keys."
canonical: https://agentroost.app/en/blog/n8n-ai-nodes-beginners-walkthrough
date: 2026-06-08T04:00:00Z
---

[Canonical URL](https://agentroost.app/en/blog/n8n-ai-nodes-beginners-walkthrough)

Most people open n8n's node panel, type "AI", see six different nodes, and immediately wonder which one they're supposed to use. This post answers that question with plain language and real examples — no assumed background, no hand-waving.

## The Mental Model: n8n as a Pipeline

Before the nodes make sense, you need to understand what n8n is doing. Every workflow is a pipeline: data enters on the left, gets transformed at each node, and exits on the right. An AI node is just one more transformer — it receives text (or structured data you convert to text), sends it to an LLM, and returns the model's reply as a new item in the pipeline.

That's it. The mystery dissolves once you see AI as a step, not a magic black box.

## The Core AI Nodes (and What They Actually Do)

### 1. Basic LLM Chain

**The right starting node for almost every beginner task.**

It takes a prompt you write, resolves any n8n expressions in it, sends it to an LLM, and outputs the text reply. No tools, no memory, no loops — just one prompt, one response.

When to use it: summarizing content, classifying text, rewriting copy, extracting fields from unstructured text, generating a draft message.

### 2. Chat Model (sub-node)

This is not a standalone node — it lives *inside* the Basic LLM Chain or AI Agent node and defines which LLM you're talking to. You'll see options like **OpenAI Chat Model**, **Anthropic Chat Model**, or **Ollama Chat Model**.

Swapping models is as simple as opening this sub-node and changing the dropdown. Your prompts and the rest of the workflow don't change.

### 3. AI Agent

The AI Agent node goes beyond a single prompt. It has access to **tools** — things like web search, a calculator, code execution, or HTTP requests — and the model decides at runtime which tools to invoke before composing its final answer.

Use it when the task requires reasoning across multiple steps: "Research this company, check whether they have a careers page, and write a cold outreach." A Basic LLM Chain can't do that autonomously; the AI Agent can.

> Note: AI Agent workflows are inherently less predictable than Basic LLM Chain. Get comfortable with single-step prompts before adding tools.

### 4. Chat Trigger

This is a trigger node (the first node in a workflow) that opens a simple chat interface in your n8n instance. It lets you test conversational workflows directly in the editor without needing an external channel.

It's useful for prototyping, but for a real chatbot you'd replace it with a **Webhook** trigger (so a messaging app can hit the URL) or a **Telegram Trigger**.

### 5. Memory Nodes (Window Buffer Memory, etc.)

By default, the Basic LLM Chain treats every run independently — no memory of what you asked before. Memory nodes inject conversation history into the prompt context, turning a stateless Q&A into a proper conversation thread.

Attach a **Window Buffer Memory** node to an AI Agent if you want multi-turn dialogue. The buffer keeps the last N messages in context.

### 6. Output Parser Nodes

LLMs return free-form text. If you need structured output — say, a JSON object with specific fields — the **Structured Output Parser** node lets you define a schema, and n8n will instruct the LLM to format its response accordingly, then parse it back into usable JSON items.

Incredibly useful before a **Set** or **HTTP Request** node that needs specific keys.

---

## Building Your First AI Step (Step by Step)

Here's a concrete example: a workflow that reads a support email subject line and suggests a one-sentence reply draft.

### Step 1 — Trigger

Add a **Schedule Trigger** (or for testing, a **Manual Trigger**). This starts the workflow.

### Step 2 — Mock some input data

Add a **Set** node with a field:
```
subject = "My order hasn't arrived after 10 days"
```

In a real workflow this field would come from an email integration (Gmail, IMAP) or a webhook payload.

### Step 3 — Add the Basic LLM Chain node

Connect it after the Set node. Inside you'll see:
- **Chat Model** sub-node: set it to OpenAI Chat Model (or whichever provider you have credentials for).
- **Prompt** field: this is where expressions matter.

Write this in the prompt field:
```
You are a helpful customer support assistant.

A customer sent us this message:
"{{ $json.subject }}"

Write a single polite sentence acknowledging their concern and letting them know we are investigating.
```

The `{{ $json.subject }}` expression pulls the value from the previous Set node. n8n resolves it before the text is sent to the LLM.

### Step 4 — See the output

Run the workflow. The Basic LLM Chain node will output something like:
```json
{
  "text": "We're sorry to hear your order hasn't arrived yet and are actively looking into this for you right now."
}
```

The reply lives in `$json.text`. Pipe it into a **Send Email** node or a **Slack** node and you have a working draft-assist automation.

---

## Common Chaining Patterns

**Summarize → Classify → Route**
Summarize an incoming document with Basic LLM Chain, then use an IF node to branch on keywords in the summary. Route complex cases to a human, simple ones to an auto-reply.

**Extract → Transform → Write**
Use a Structured Output Parser to pull structured fields (name, company, budget) from a freeform form submission, then write a row to Airtable or a Google Sheet.

**Trigger → Research → Draft**
Use a Schedule Trigger to wake up daily, an HTTP Request node to fetch RSS headlines, and a Basic LLM Chain to produce a briefing email. Send it with Gmail.

---

## Tips and Pitfalls for Beginners

- **Always pin test data.** Before you add an AI node, run the upstream nodes and pin their output. This gives you stable data to test prompts against without burning credits on repeated live runs.
- **Temperature controls creativity vs. predictability.** For classification tasks, set temperature to `0`. For copywriting, try `0.7`. It's under the Chat Model sub-node's "Additional Fields".
- **Watch your token count.** If you're feeding a long document into the prompt, the model may truncate it. Split large documents with a **Code** node or a **Text Splitter** (under the AI category) before sending to the LLM.
- **The model name matters.** GPT-4o mini is fast and cheap for routing/classification. Claude Sonnet or GPT-4o makes more sense for nuanced drafting. You can change the model per-node.
- **Use the output parser early.** Parsing unstructured LLM text with a Code node is fragile. If you know you need JSON, use the Structured Output Parser from the start.

---

## Running This on AgentRoost

When you self-host n8n, getting AI nodes to work requires: an account with OpenAI (or another provider), an API key, a billing method, and wiring that credential into n8n's Credentials manager. None of that is hard, but it's friction — especially when you just want to test an idea at 11 PM.

On AgentRoost, you get **your own n8n instance** — your login, your workflows, your data — running at `https://<your-id>.agentroost.app`. The AI nodes come pre-wired to included credits. You open the node, pick from 350+ models, and run the workflow. No API key, no separate billing tab, no surprise charges.

**How to get started:**
1. Go to [agentroost.app/en/agents/n8n](/en/agents/n8n) and sign up (email/password, Google, Microsoft, or Discord).
2. Pick the n8n framework, name your instance.
3. Your private n8n editor opens in about two minutes.
4. Add a Basic LLM Chain node — the Chat Model credential is already there.

Plans start at $19.99/month, all-in. Monthly billing, 14-day money-back guarantee, cancel anytime.

[See what's included in each plan](/en/pricing) or [get your own n8n instance now](/en/agents/n8n).
