Interview Prep
Interview questions, roadmaps and practice sets
Tutorials
Free tutorials on 30+ topics
Blog
Career guides, skills and interview tips
Free PDFs
Notes, cheat sheets and question banks
Certificates
Free skill tests and course certificates
Tools & Whiteboard
Free tools you can use right in the browser
Practice Tests
Mock tests, MCQs and quick Q&A
Free LMS
Learn on the Uncodemy LMS
Choose the best training program according to your career.
Improve the performance of your business with our innovative Industrial Training Program.
Read More →
Our instructor-led training classes are designed to make you an expert.
Read More →
Real-life case studies are a great way to demonstrate your practical knowledge.
Read More →
Explore blogs, latest technologies and industry updates with practical examples.
Read More →Browse all available training programs and choose the right one for your career.
Read More →Know more about who we are and what we stand for.
Discover our mission to equip individuals with essential IT skills and industry expertise.
Read More →
Free tutorials, interview questions, tools and calculators to help you learn.
Explore →Learn, practice and plan your career — bilkul free.
Book a free video counselling session and pick the right course for you.
Read More →n8n helps with AI workflows by putting a language model inside an ordinary automation: a trigger brings in data, an AI node decides or writes something, and normal nodes act on the result. You get the model's flexibility with the logging, retries and approvals of a workflow tool.
This guide answers the common questions about n8n's AI nodes and builds an inbox-triage agent step by step.
An "AI workflow" is any automated process in which at least one step is done by a language model: reading an email and deciding what it is about, answering a question from company documents, or drafting a reply. The hard part is rarely the model call itself. It is everything around it: getting the right data in, checking what comes out, keeping a record, and stopping the model from doing something it should not. That surrounding work is what n8n is good at.
If you are new to n8n, the introduction to AI automation in n8n covers installation and basic nodes. For a data-pipeline use of the same tool, see automating data pipelines with n8n. This page is about agents, tools and retrieval.
n8n's AI features are built on LangChain and appear as "cluster nodes": a main (root) node with smaller sub-nodes plugged into it.
| Building block | Examples of nodes | What it is for |
|---|---|---|
| Root AI nodes | AI Agent, Basic LLM Chain, Question and Answer Chain, Summarization Chain, Text Classifier, Information Extractor | The step that does the AI work |
| Chat models | OpenAI, Anthropic, Google Gemini, Mistral, Groq, Ollama (local) and others | The model behind the root node |
| Memory | Simple Memory, Postgres Chat Memory, Redis Chat Memory | Lets a chat agent remember earlier turns |
| Tools | HTTP Request tool, Code tool, Call n8n Workflow tool, app tools such as Google Sheets or Gmail | Actions the agent may choose to take |
| Retrieval | Embeddings nodes; vector stores such as Pinecone, Qdrant, Supabase, PGVector, In-Memory | Search over your own documents (RAG) |
| Output parsers | Structured Output Parser | Force the model to return JSON in a fixed shape |
Because these sit inside a normal workflow, the model's output can go straight into an IF node, a database, an email, or an approval step.
A chain does one fixed thing: take this input, send it to the model with this prompt, return the result. Use it when the task is always the same, such as "summarise this ticket".
An agent is given a goal and a set of tools, and the model decides which tools to call and in what order. Use it when the steps depend on the input: one email needs a lookup in a sheet, another needs a calendar check, a third needs nothing. Agents are more flexible and also harder to predict, so they need tighter limits. From chatbot to AI agent explains the idea in more detail.
Imagine a training institute in Noida whose admissions inbox gets fee questions, batch-timing questions, demo-class requests and the occasional complaint. (The institute and its data here are invented for the example.) The goal: every new email is labelled, routine questions get a draft reply, and complaints go to a person at once.
category, draft_reply and needs_human.category: complaints go to a Slack message for the admissions head; everything else continues.The agent's system message does most of the steering:
You triage emails for an admissions team.
Categories: fees, batch_timing, demo_request, complaint, other.
Use the Batches tool for any question about dates or timings. Never guess a date.
Do not state fees; for fee questions, say a counsellor will share the current fee details.
If the email is a complaint, set needs_human to true and leave draft_reply empty.
Return only JSON matching the schema.
And the output schema for the parser:
{
"type": "object",
"properties": {
"category": { "type": "string", "enum": ["fees", "batch_timing", "demo_request", "complaint", "other"] },
"draft_reply": { "type": "string" },
"needs_human": { "type": "boolean" }
},
"required": ["category", "draft_reply", "needs_human"]
}
For an email like "When does the next weekend Python batch start?", the agent should call the Batches tool, find the weekend row, and return {"category": "batch_timing", "draft_reply": "...starts on the date in the sheet...", "needs_human": false}. Notice two design choices: the reply is a draft, not sent, and the prompt forbids the model from inventing fees or dates. Both keep a model mistake from reaching a student.
Drafts are one way. Another is the "send and wait for response" operation available in nodes such as Gmail and Slack: the workflow sends a message with Approve / Decline buttons and pauses until someone clicks. Use it whenever the AI's decision has consequences, such as issuing a refund, changing a booking or emailing many people.
Retrieval-augmented generation lets the model answer from your documents instead of from memory. In n8n it is usually two workflows:
Start with the In-Memory vector store to test, then move to Qdrant, Pinecone, Supabase or Postgres with pgvector for real use, since in-memory data is lost when n8n restarts. The theory is covered in RAG explained.
$fromAI() expression for fields the model should supply and fix the rest yourself (for example, the sheet ID).n8n suits AI features that live inside business processes: inboxes, forms, CRMs, sheets and chat tools. If you are building a product whose core is a complex agent, with custom planning logic, many cooperating agents or fine control over state, a code framework is usually a better fit. LangGraph and CrewAI are two common choices; many teams combine them, calling a code-based agent from n8n through an HTTP Request node.
A good first project is the triage workflow above on your own inbox or a test Gmail account: one trigger, one agent with one tool, a structured output, and a draft instead of a send.