How to Use n8n to Build Your First AI Automation

Short answer: Sign up for n8n Cloud (or self-host), create a workflow, add a trigger, then add an AI Agent node connected to a language model and the tools it may use. Test with sample data, then activate the workflow so it runs on its own.
n8n is an open-source automation platform that connects apps and services into workflows, and it has become a favorite for AI work because its AI capabilities are built in, not bolted on. This tutorial walks you from an empty canvas to a working AI automation, checked against n8n's official documentation in December 2026.
Two ways to build with AI in n8n
n8n now offers two complementary approaches:
- Workflows with AI steps. The classic n8n model: a fixed sequence of nodes where one or more steps call an AI model, for example to summarize, classify or draft. The AI Agent node adds reasoning inside a workflow: the model decides which connected tools to call to answer a request.
- Agents as first-class artifacts. A newer feature (currently in Preview): an autonomous assistant you configure in the Agent Builder with a model, instructions, tools, web search, skills and a knowledge base. Agents live alongside your workflows, can run on schedules, and can even trigger workflows. n8n's own guidance: use an agent when the work is too open-ended for a fixed workflow.
Agents are available on all n8n Cloud plans and on self-hosted instances from version 2.32.3. This tutorial focuses on the workflow route, because it teaches the concepts everything else builds on.
Step 1: Set up n8n
- n8n Cloud is the fastest start: sign up and you are in the editor.
- Self-hosting is free and keeps data on your own infrastructure, at the cost of maintaining it.
Either way, you will also need an API key from a language model provider (OpenAI, Anthropic, Google or others) to power the AI steps.
Step 2: Understand the building blocks
Every n8n workflow is a chain of nodes on a canvas:
- Trigger nodes start the workflow: a schedule, a webhook, a new email, a new row in a sheet.
- Action nodes do work: read or write data in connected apps, transform it, call APIs.
- AI nodes add language model steps, from simple "summarize this text" to the full AI Agent node with tools and memory.
Data flows from node to node as structured items, and each node's output becomes the next node's input.
Step 3: Build a first AI workflow
A classic starter: an automation that reads new form responses and drafts a personalized reply.
- 1Create a workflow and add your trigger, for example a form submission or a new spreadsheet row.
- 2Add an AI step. Drop in a language model node and write the instruction: "Summarize this request in one sentence and classify it as sales, support or other."
- 3Add an action that uses the result, such as drafting a reply, filing the row into the right list, or posting to Slack.
- 4Wire the data between nodes using n8n's expression editor, which lets you reference any earlier field by name.
Step 4: Add an AI Agent when the task needs judgment
When a fixed sequence is too rigid, replace the single AI step with the AI Agent node. Connect it to:
- A chat model (the brain).
- Tools: other n8n nodes the agent may call, such as a calendar lookup, a CRM search or a web request.
- Memory when conversations span multiple messages.
Now the model reasons about the request and picks the right tools, instead of following a hard-coded path. n8n's docs describe this as the difference between chains (fixed) and agents (adaptive), and recommend starting fixed, then adding agency only where judgment is genuinely needed.

Step 5: Test, then activate
- 1Run the workflow manually with sample data and inspect every node's output.
- 2Fix the common failure: a field name that does not match what the next node expects.
- 3When the outputs look right, activate the workflow so the trigger fires on its own.
- 4Check the execution history for a few days to catch edge cases.
For agents in Preview, n8n itself warns they can make mistakes and their behavior may change, so keep a human review step anywhere the output reaches customers.
Good first automations
- Inbox triage: classify incoming emails and route them with drafted replies.
- Meeting prep: on a calendar event, pull recent notes about the attendee and post a brief to Slack.
- Content repurposing: turn a published blog post into social drafts on a schedule.
- Lead enrichment: on a new signup, look up company data and write it into your CRM.

If you are designing the prompts inside these nodes, our practical prompt guide and prompt template library will save you trial and error.
FAQ
Is n8n free?
Self-hosted n8n is free and open source. n8n Cloud is the hosted option with paid plans; AI agents are included on all plans, cloud and self-hosted (2.32.3+).
Do I need to code to use n8n?
No. Workflows are visual. Optional Code nodes exist for custom logic, and AI can even help write that code, but most automations need none.
What is the difference between the AI Agent node and the agents feature?
The AI Agent node adds reasoning inside a workflow you design. The agents feature (in Preview) creates a standalone assistant with its own instructions, tools, knowledge base and schedule, living alongside your workflows.
Which AI models does n8n support?
The major providers, including OpenAI, Anthropic and Google, connected with your own API keys.
Is my data safe with self-hosted n8n?
Self-hosting keeps execution data on your own infrastructure, which is why many teams choose it. You still send prompts to your chosen model provider, so check their data terms.
Sources
- n8n Docs, Build and manage agents: https://docs.n8n.io/build/build-and-manage-agents
- n8n Docs, AI Agent node: https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent
- n8n Docs, What agents do: https://docs.n8n.io/build/integrate-ai/understand-ai-components/what-agents-do
Key takeaways
- Start with a fixed workflow: trigger, AI step, action. Add the AI Agent node only where judgment is needed.
- Agents (Preview) are standalone assistants with tools and schedules, available on all plans.
- Test with sample data, activate, then watch the execution history.
- Keep human review on anything customer-facing while agent features are in Preview.
Want AI automations built for your business without the learning curve? Book a free 30 minute call with Tech AI Labs and we will design them with you.
FAQ
Quick answers
Is n8n free?
Self-hosted n8n is free and open source. n8n Cloud is the hosted option with paid plans; AI agents are included on all plans, cloud and self-hosted (2.32.3+).
Do I need to code to use n8n?
No. Workflows are visual. Optional Code nodes exist for custom logic, and AI can even help write that code, but most automations need none.
What is the difference between the AI Agent node and the agents feature?
The AI Agent node adds reasoning inside a workflow you design. The agents feature (in Preview) creates a standalone assistant with its own instructions, tools, knowledge base and schedule, living alongside your workflows.
Which AI models does n8n support?
The major providers, including OpenAI, Anthropic and Google, connected with your own API keys.
Is my data safe with self-hosted n8n?
Self-hosting keeps execution data on your own infrastructure, which is why many teams choose it. You still send prompts to your chosen model provider, so check their data terms.
IN THE DIRECTORY
See how this tool compares, what it costs and what it is best for.
Open the tool page →

