Lesson 27 of 36 · Track 4: Automate and code with AI

n8n for beginners: build your first AI automation

Beginner14 min5 steps2 videosFree · no login
The short answer

n8n is a workflow automation tool: you join apps together as boxes on a canvas, and the workflow runs by itself when something happens. You can add an AI step that reads, summarises or sorts text with a model like GPT, Claude or Gemini. In this lesson you build one real workflow: a form is submitted, an AI summarises it, and the summary lands in your email or Slack.

  1. 1

    What is n8n, in plain words?

    n8n (say "n-eight-n") lets you automate boring, repeated work without writing a full program. You drag boxes onto a canvas, connect them with lines, and each box does one job: read a form, call an AI model, send an email. n8n describes itself as a "fair-code workflow automation platform with native AI capabilities".

    Fair-code means the source code is public on GitHub, but it uses n8n’s own Sustainable Use License rather than a classic open-source licence. You can use n8n in two ways. n8n Cloud is hosted for you, so there is nothing to install. Self-hosting means you run it on your own computer or server, which needs some technical setup (npm, Docker or a server).

    Key idea

    n8n is a visual way to say: "when this happens, do these steps", with AI as one of the steps.

  2. 2

    Triggers, nodes and executions: the only three words you need

    A workflow is "a collection of nodes that automate a process". A node is one box on the canvas. The first box is always a trigger node, which starts the workflow when something happens: a form is submitted, a new row is added to a Google Sheet, or it is 8 AM.

    Each time the workflow runs from start to finish, that is one execution. This matters because n8n Cloud plans are priced by executions per month, not by how many steps a workflow has.

    • Credentials: saved logins that let n8n talk to Gmail, Slack or an AI provider.
    • Expressions: small snippets like {{ $json.feedback }} that pull data from an earlier node.
    • Test vs publish: you test while building, then publish so it runs on its own.
    1. Trigger (something happens)
    2. Node: do a step
    3. Node: AI step
    4. Node: send the result
  3. 3

    How does the AI part work?

    n8n’s AI nodes come as "cluster nodes": a main (root) node with smaller sub-nodes plugged into it. For a first workflow, use the Basic LLM Chain node. It sends one prompt to a model and passes the answer to the next node. You plug a chat model sub-node into it, such as OpenAI, Anthropic or Google Gemini.

    The AI Agent node is the bigger cousin. n8n’s docs describe an agent as "a chain that knows how to make decisions": it can choose tools, use memory and take several steps. Start with a chain. Move to an agent when the task needs choices, like you saw in the AI agents lesson.

    To call a model you need access to it. On n8n Cloud Starter and Pro, "Gateway credits" let you run supported models without your own API key, and new Cloud users get a small amount of free credit. When self-hosting, you add your own API key from the model provider as a credential.

    Key idea

    Basic LLM Chain = one prompt in, one answer out. AI Agent = a model that decides what to do next.

  4. 4

    Build it: form, AI summary, email

    Here is a real first workflow. A student club collects feedback with a form. Instead of reading every response, an AI writes a two-line summary with a mood label and emails it to the organiser.

    Add an n8n Form Trigger node and create two fields: Name and Feedback (a Textarea). n8n builds the form page for you. Then add a Basic LLM Chain, set Prompt to "Define below", and paste the prompt below. Plug in a chat model sub-node. Finally add a Gmail node with the "Send a message" operation, or a Slack node with "Send a message", and drag the chain’s output into the message body.

    Using Google Forms instead? Its responses go into a Google Sheet. Swap the first node for the Google Sheets Trigger with the "Row added" event, and the rest stays the same.

    1. n8n Form Trigger
    2. Basic LLM Chain + chat model
    3. Gmail or Slack: send a message
    Prompt for the Basic LLM Chain (the {{ }} parts pull in the form answers)
    Summarise this event feedback in at most 2 short sentences.
    Then add one label on a new line: Positive, Neutral or Negative.
    
    Name: {{ $json.Name }}
    Feedback: {{ $json.Feedback }}
  5. 5

    Test it, publish it, and what it costs

    Click Execute workflow and open the form’s test URL. Submit a sample answer and watch each node turn green. Click a node to see exactly what data went in and out. That is how you debug in n8n. When it works, publish the workflow and share the production URL. Production runs no longer show in the editor, but you can see them in the Executions tab.

    Prices, as of Nov 2026, from n8n’s official pages. The self-hosted Community edition is listed as free, "with almost the complete feature set". n8n Cloud starts with a free trial (1,000 executions on the trial). Starter is €20 a month billed annually with 2,500 executions a month, and Pro is €50 a month billed annually with 10,000. The self-hosted Business plan is €667 a month billed annually. AI model usage is billed separately, by Gateway credits or by your own provider.

    Key idea

    Always test with fake data first. A published workflow runs every time the trigger fires, including AI calls that cost money.

From the people who built it

Straight from the source

The original idea, then the same idea taken apart, then how you use it today.

Erik Schluntz and Barry Zhang (Anthropic)
Anthropic engineers whose "Building effective agents" post set out the common patterns for putting AI models into workflows.
Building effective agents (Anthropic engineering post, December 2024)
1 · Understand
They split AI systems into two kinds. Workflows run models and tools along "predefined code paths" that you design, while agents choose their own steps. Many useful jobs only need a workflow.
2 · Break it down
  • Prompt chaining: one step’s output feeds the next, like form answer, then AI summary, then email. That is the workflow you build in this lesson.
  • Routing: a first step sorts the input, then sends it down the right path, such as complaints to one team and praise to another.
  • Parallelization: several model calls run at once on parts of the job, or on the same job to compare answers.
  • Orchestrator-workers and evaluator-optimizer: one model splits a task for helper models, or one model writes while another checks and asks for fixes.
3 · Use it
In n8n, start with a fixed chain of nodes. Add a sorting step when inputs need different handling, and reach for the AI Agent node only when you truly cannot list the steps in advance.
1 · Understand
Oberhauser wants n8n to be the layer that ties AI models, tools and services together, so "you can actually connect everything to anything." Because nobody knows which model will win, n8n lets you plug in whichever one suits your job.
2 · Break it down
  • The name: n8n is short for "nodemation", a blend of node (the boxes on the canvas, and Node.js) and automation. He explains in the README that he could not find a good, free short name.
  • Any model: the chat model is a swappable part, so you can move from OpenAI to Claude or Gemini without rebuilding the workflow.
  • Fair-code: the source is public and free to self-host, but it is not classic open source. He says the licence is there so other companies cannot sell n8n’s code commercially.
3 · Use it
Build your workflow so the AI model is one plug-in part. Try the same prompt with two different chat models and keep the one that gives better summaries for the cost.
6 terms

Words to know

Workflow
A set of connected nodes that automate one process from start to finish.
Trigger node
The first node, which starts the workflow when something happens, like a form submission or a schedule.
Execution
One complete run of a workflow. Cloud plans are priced by executions per month.
Basic LLM Chain
An n8n AI node that sends a prompt to a chat model and returns the answer, with no tools or memory.
Credential
Saved login details that let n8n connect to an app or AI provider on your behalf.
Fair-code
Source code you can read and self-host, shared under n8n’s own Sustainable Use License instead of a standard open-source licence.
2 videos · plays here

Watch

Hand-picked from the people who explain this best. The video loads only when you press play.

n8n Quick Start Tutorial: Build Your First AI Agent [2026]
n8n · 21 min

The official 2026 quick start. Watch how the form trigger, Basic LLM Chain and test data work, then how the agent part adds memory and tools.

n8n Beginner Course (1/9) - Introduction to Automation
n8n · 13 min

If triggers, nodes and data still feel fuzzy, this first episode of n8n’s own course explains them slowly. The interface has changed a little since 2024.

Hands-on · 10 minutes or less

Try it

Build a 3-node AI feedback summariser

  1. 1Sign up for the n8n Cloud free trial (no credit card needed for Starter or Pro trials) and create a new workflow.
  2. 2Add an n8n Form Trigger with two fields: Name (Text) and Feedback (Textarea).
  3. 3Add a Basic LLM Chain, choose "Define below", paste the prompt from step 4 of this lesson, and plug in a chat model sub-node.
  4. 4Add a Gmail node, choose "Send a message", send it to yourself, and drag the chain’s output text into the message body.
  5. 5Click Execute workflow, open the test form URL, and submit "The talk was great but the hall was too hot". Check your inbox for the summary and label.
n8n docs: Build your first workflow
3 questions · instant feedback

Check yourself

Pick an answer to see if you are right, and why.

Question 1

Question 1 of 3

Which node starts an n8n workflow?

Question 2

Question 2 of 3

You only need to summarise each form response with one prompt. Which AI node is the simplest fit?

Question 3

Question 3 of 3

Your workflow has 5 nodes and runs once. How many executions does n8n count?

Lesson 27 of 36

Done? Keep going

Mark this lesson complete to keep your place. Progress is saved on this device, no login.

Up next · Lesson 28 · 12 minVibe coding: apps without codeVibe coding means building software by describing what you want to an AI and accepting the code it writes without reading it. Andrej Karpathy coined the term in February 2025, and Collins Dictionary made it its 2025 Word of the Year. App builders like Lovable, Bolt, Replit Agent, v0 and Google AI Studio’s Build mode let a non-coder ship a working prototype in an afternoon, but code nobody has read can hide security holes, so learn the basics before real users or money are involved.← Previous: Open models: run an LLM on your laptop
People also ask

Questions people ask

Is n8n free?

The self-hosted Community edition is listed as free, and you can stay on it indefinitely. n8n Cloud, where n8n hosts it for you, has a free trial and then paid plans. As of Nov 2026, Starter is €20 a month and Pro is €50 a month, both billed annually. AI model usage is paid separately.

Do I need to know coding to use n8n?

No. n8n’s own quickstart says that apart from n8n you don’t need any coding experience. Knowing a little JavaScript helps later, because expressions like {{ $json.Name }} use it, but your first workflows only need drag, drop and copy-paste.

What is the difference between the AI Agent node and the Basic LLM Chain in n8n?

The Basic LLM Chain sends one prompt to a model and returns the answer. The AI Agent node lets the model decide which tools to use and in what order, and it can use memory. n8n’s docs note that agents can use memory but chains cannot.

19 sources · checked Nov 2026

Sources and further reading

Free · No signup to start

Going for an AI role? Practise the interview.

Talk to an AI interviewer about what you just learned and get feedback on every answer.

Start a free mock interview