
n8n is a workflow automation tool where you connect nodes on a canvas. Each workflow starts with a trigger node, passes data through action and logic nodes, and can include AI nodes that classify or write text. A good first project is a form that sends submissions to an AI node for classification and routes them to different spreadsheets or emails.
Key concepts
- Workflow: the whole automation, shown as connected nodes.
- Node: a single step, such as "Webhook", "Google Sheets", "IF" or "AI Agent".
- Trigger node: the node that starts the workflow, such as a form submission, schedule or webhook.
- Items: n8n passes data between nodes as items, each a JSON object.
- Expressions: small snippets, written in double curly braces, that reference data from earlier nodes.
- Credentials: saved, secure connections to services like Gmail or an AI provider.
- Execution: one run of the workflow, which you can inspect node by node.
Your first workflow: smart enquiry router
Goal: when someone submits an enquiry form, AI decides whether it is about courses, pricing or something else, and the workflow routes it accordingly.
Step 1: Add a trigger
Use n8n's built-in Form Trigger node. Add fields: name, email and message. n8n gives you a test URL for the form.
Step 2: Add an AI classification step
Add an AI node connected to your model provider. Use a clear prompt:
"Classify this enquiry into exactly one category: COURSES, PRICING or OTHER. Reply with the category word only. Enquiry: {{ $json.message }}"
Asking for a single word makes the output easy to use in the next step.
Step 3: Branch with a Switch node
Add a Switch node that checks the AI output:
- COURSES goes to one branch,
- PRICING goes to another,
- anything else goes to a default branch.
Step 4: Take action on each branch
- Courses: append a row to a "Course enquiries" Google Sheet.
- Pricing: send an email to the admissions team with the details.
- Other: post a message to a team channel for review.
Step 5: Test and inspect
Submit test enquiries of each type. Open the execution log and check the data at every node. Try tricky inputs, such as a message mixing both topics, and improve the prompt if needed.
Step 6: Activate
When it works reliably, switch the workflow to active and use the production form URL.
Good habits from day one
- Name your nodes clearly, such as "Classify enquiry" rather than "AI 1".
- Constrain AI outputs to fixed formats.
- Add error handling: an error workflow that alerts you if something fails.
- Never hard-code secrets; use credentials.
- Test with realistic messy data, not just perfect examples.
Next steps
Once comfortable, explore webhooks, HTTP Request nodes to call any API, and the AI Agent node, which lets a model choose between tools. Our AI automation course builds these skills through client-style projects.
Frequently asked questions
Should I use n8n cloud or self-host?
Cloud is easiest for beginners. Self-hosting gives more control and can be cheaper at scale, but requires server skills.
Do I need JavaScript for n8n?
Not for most workflows. Basic JavaScript helps for expressions and Code nodes.
Can n8n run AI agents?
Yes. n8n includes agent nodes that use language models with tools and memory.


