n8n Tutorial: Build Your First Workflow
Ready to automate?
Browse 5,000+ copy-paste n8n workflow templates.
Most people install n8n, open the canvas, and freeze. There are hundreds of integrations, multiple trigger types, and no obvious first move. Reading documentation helps, but it doesn't replace the experience of watching data flow through nodes you built yourself.
The fastest way to learn n8n is to ship one real workflow. This tutorial walks through a complete automation from scratch: a contact form handler that receives submissions via webhook, checks for urgency signals, and routes them to the right email notification. You'll touch every core pattern in n8n — triggers, data transformation, conditional branching, and actions — in a single build session.
Expect about fifteen minutes from blank canvas to a working, testable workflow.
What You'll Build
A five-node webhook workflow that handles contact form submissions:
- A webhook URL you can paste into any HTML form, Webflow form, or no-code page builder
- Incoming submissions (name, email, message) get normalized into clean, consistent fields
- An IF condition checks whether the message contains urgency keywords
- High-priority submissions trigger an immediate email alert with a flagged subject line
- All other submissions go to a standard notification with no urgency framing
This pattern — receive data, transform it, branch on a condition, and take action — repeats across dozens of real n8n use cases. Learn it here and you'll recognize it immediately in every workflow you encounter after.
Prerequisites
- An n8n instance (cloud account at app.n8n.cloud, or self-hosted via Docker)
- SMTP credentials for an email account (Gmail, Outlook, or any provider works)
- No coding experience required
If you're new to what n8n is and how it fits into the automation landscape, What Is n8n? covers the basics before you start building.
Example n8n Workflow: Step by Step
Step 1: Webhook Trigger Node
Add a Webhook node to your canvas. This is found under the Trigger section when you search for nodes.
Set the HTTP method to POST and the path to something recognizable like contact-form. Set the response mode to Immediately — this tells n8n to acknowledge the request right away rather than waiting for the workflow to finish before replying.
Once you save the node, n8n generates two URLs: a test URL and a production URL. Copy the test URL. You'll use it during development; later you'll switch to the production URL when you activate the workflow.
Step 2: Set Node — Normalize the Incoming Data
Webhook payloads from different form tools arrive in different shapes. A contact form on Webflow sends different field names than one on Framer or a custom HTML form. The Set node solves this by mapping raw input fields onto clean, consistent output fields.
Add a Set node after the Webhook node. Create three output fields:
senderName— mapped from the expression{{ $json.name }}(or{{ $json.body.name }}depending on your form's payload structure)senderEmail— mapped from{{ $json.email }}messageBody— mapped from{{ $json.message }}
Enable the Keep Only Set toggle. This strips everything else from the item, so only your three clean fields pass downstream. Every node after this point works with predictable data.
Step 3: IF Node — Route by Priority
Not every form submission warrants an immediate alert. An IF node separates urgent submissions from standard ones so they can follow different paths.
Add an IF node after the Set node. Configure the condition:
- Field:
messageBody - Operation: Contains
- Value:
urgent
You can extend this later with an OR group to also catch terms like pricing, enterprise, or demo — whatever signals a high-value lead for your workflow. For now, one condition is enough to demonstrate branching.
The IF node produces two outputs: a true branch (message contains the keyword) and a false branch (everything else). Wire each to its own Send Email node.
Step 4: Send Email Node — Priority Alert
On the true output of the IF node, add a Send Email node. Connect your SMTP credentials under the Credentials section — n8n stores these encrypted and reuses them across nodes.
Configure the node:
- To: Your inbox or a team shared address
- Subject:
[URGENT] New contact from {{ $json.senderName }} - Body: A short template that surfaces
senderEmailandmessageBodyusing n8n's expression syntax
When a submission matches the urgency condition, this node fires within seconds. You receive the alert with context — name, email, and full message — before you'd even notice a new entry in a spreadsheet.
Step 5: Send Email Node — Standard Notification
On the false output of the IF node, add a second Send Email node using the same SMTP credentials.
Configure it with a lower-urgency subject:
- Subject:
New contact from {{ $json.senderName }} - Body: Same template as the priority node
This branch handles the majority of submissions — general questions, feedback, support requests that don't need an immediate response. If you prefer to log these to a database instead of emailing them, swap this node for a HTTP Request node pointing at your CRM's REST API, or use any of n8n's native database nodes. The branching structure stays the same; only the action changes.
Testing the Workflow
Click your Webhook node and copy the test URL. Open a terminal and run a POST request against it:
Send a JSON body with name, email, and message fields. Use the word "urgent" in the message to test the priority branch, then run a second test without it to verify the standard branch fires correctly.
n8n highlights each node in sequence as the execution runs. Click any node to open the data inspector and examine exactly what entered and left that node. If a field is missing or incorrectly named, the data inspector tells you immediately — it's your main debugging tool for every workflow you'll ever build.
Once both branches execute cleanly in test mode, open the Webhook node settings and toggle Active to switch from the test URL to the production URL. Your workflow is live.
The Four Patterns This Workflow Teaches
Every n8n workflow — regardless of complexity — combines these four patterns:
- Trigger nodes start execution when an event occurs. Here, an incoming HTTP POST. In other workflows, this might be a schedule, a new row in a spreadsheet, or a message in a Slack channel.
- Transformation nodes reshape data. The Set node here normalizes an inconsistent payload. More complex workflows use the Code node, Merge node, or Split In Batches node to reshape large datasets.
- Logic nodes branch execution based on data values. The IF node here creates two paths. A Switch node can create three or more paths when needed.
- Action nodes produce an output. The Send Email node here delivers the result. In production workflows, this might be creating a CRM record, posting a message, or calling an API.
Once you can identify these four patterns in any workflow diagram, reading and building automations in n8n becomes straightforward regardless of which integrations are involved.
What to Build Next
From here, extend this workflow in any direction:
- Add a fourth field —
company— and route B2B leads to a separate notification or a direct Slack message - Replace the false-branch email with a HTTP Request node that creates a task in your project management tool
- Add an n8n Form Trigger node instead of a generic webhook if you want n8n itself to host the form
The n8nresources.dev template library has over 5,000 workflows organized by integration and use case. Search by the tool you want to connect, copy a workflow directly into your n8n instance, and adapt it from there. The five-node structure you built today appears in templates across every category — once you've built one, the rest become much faster to understand and modify.
Enjoyed this article?
Share it with others who might find it useful