How to Create Your First n8n Workflow:
Step-by-Step Tutorial 2026

n8n is one of the most powerful automation tools available — and unlike other platforms, it gives you the full programming flexibility of JavaScript alongside a visual editor that actually makes sense. This tutorial walks you through creating your first real workflow from scratch: a scheduled job that fetches data from an API, processes it, and sends a Slack notification. No prior n8n experience needed.

What You'll Build

A workflow that runs every morning at 8 AM, fetches the current weather for your city from a public API, formats a summary message, and sends it to your Slack channel. By the end, you'll understand every core n8n concept: triggers, HTTP requests, data manipulation, outputs, testing, and activation.

Understanding the n8n Interface

Before adding any nodes, take a few minutes to understand the n8n editor layout. Open your n8n instance and click "New Workflow."

The Canvas

The canvas is your visual workspace. It's an infinite grid where you drag, connect, and configure nodes. Key interactions:

  • Pan: Click and drag on empty space, or hold Space and drag
  • Zoom: Scroll wheel, or Ctrl/Cmd + scroll
  • Fit to screen: Press Ctrl/Cmd + Shift + H
  • Add a node: Click the + button on any node's right side, or double-click empty space
  • Move a node: Click and drag the node itself
  • Select multiple: Click and drag to create a selection rectangle

The top toolbar

From left to right in the top bar:

  • Workflow name: Click to rename it. Use descriptive names like "Weather Alert — Daily Slack"
  • Save: Ctrl/Cmd + S. n8n does not auto-save — save often
  • Execute Workflow: Runs the entire workflow once manually (from the trigger)
  • Active toggle: The on/off switch that makes trigger-based workflows run automatically

Node anatomy

Every node has the same structure: an input connector on the left, an output connector on the right, a name at the top, and a status indicator. Click any node to open its configuration panel on the right side of the screen.

Step 1 — Add a Schedule Trigger

Every workflow starts with a trigger. For our morning weather alert, we use the Schedule Trigger.

1

Add the Schedule Trigger node

Click the large "+" button in the center of the empty canvas. In the node search panel, type "Schedule" and select Schedule Trigger. It appears on the canvas as your starting node.

2

Configure the schedule

Click the Schedule Trigger node to open its settings. Change "Trigger Interval" to Days. Set the trigger time to 08:00. This runs the workflow every day at 8 AM in the timezone configured on your n8n instance.

Schedule Trigger settings: Trigger Interval: Days Days Between Triggers: 1 Trigger at Hour: 8 Trigger at Minute: 0 # For more complex schedules, use the Cron expression option: # "0 8 * * 1-5" = 8 AM on weekdays only # "0 8,17 * * *" = 8 AM and 5 PM daily
Testing Tip

To test a Schedule Trigger without waiting, click the node and press "Execute Step". This runs only that node and shows you what data it produces — a timestamp and trigger metadata. You'll use "Execute Step" throughout this tutorial to test each node independently.

Step 2 — Fetch Weather Data with HTTP Request

We'll use the Open-Meteo API — it's free, requires no API key, and returns JSON weather data. Click the + icon on the right side of the Schedule Trigger node to add the next node.

3

Add an HTTP Request node

Search for "HTTP Request" in the node panel and add it. This is the most versatile node in n8n — it can call any REST API.

HTTP Request node configuration: Method: GET URL: https://api.open-meteo.com/v1/forecast # Query Parameters (click "Add Parameter" for each): latitude: 40.7128 # New York (change for your city) longitude: -74.0060 current: temperature_2m,weathercode,windspeed_10m timezone: America/New_York # Leave Authentication as "None" — this API is public

Click "Execute Step" on this node. The right panel shows the raw JSON response — expand it to explore. You should see a current object with temperature_2m, weathercode, and windspeed_10m. This is the data we'll format in the next step.

Understanding node output structure

n8n passes data between nodes as an array of items. Each item has a json property containing the actual data. The HTTP Request node wraps the API response in this structure automatically. This is why you'll reference data as $json.current.temperature_2m — you're accessing the json property of the current item.

Step 3 — Process Data with the Edit Fields (Set) Node

The raw API response has more data than we need and uses machine-readable field names. The Edit Fields node (previously called "Set") lets us reshape and rename data into a clean structure for the Slack message.

4

Add an Edit Fields node

Add an "Edit Fields" node after the HTTP Request. Choose Manual Mapping mode and set "Include Other Input Fields" to off (we want a clean output with only what we define).

Edit Fields node — add these fields (click "Add Field" for each): Field 1: Name: temperature Value: {{ $json.current.temperature_2m }} Field 2: Name: windspeed Value: {{ $json.current.windspeed_10m }} Field 3: Name: weatherCode Value: {{ $json.current.weathercode }} Field 4: Name: date Value: {{ $now.toFormat('EEEE, MMMM d') }} Field 5: Name: emoji Value: {{ $json.current.weathercode < 3 ? '☀️' : $json.current.weathercode < 50 ? '⛅' : '🌧️' }}

The last field uses a JavaScript ternary expression right inside the {{ }} expression syntax — this is one of n8n's most powerful features. Execute the node and verify you see a clean object with your 5 defined fields.

Step 4 — Send to Slack

Now the fun part — sending the formatted weather update to Slack.

5

Add a Slack node

Add a "Slack" node. You'll need to create a Slack credential. Click "Create new credential" → follow the OAuth flow to connect your Slack workspace. n8n stores the token encrypted.

Slack node configuration: Resource: Message Operation: Send Channel: #general # or use channel ID for private channels # Message Text (click "Add option" → "Blocks" for rich formatting, # or use plain text for simplicity): Text: {{ $json.emoji }} Good morning! Weather for {{ $json.date }} 🌡️ Temperature: {{ $json.temperature }}°C 💨 Wind Speed: {{ $json.windspeed }} km/h Have a great day! ☕

If you don't have a Slack workspace, substitute this node with a Gmail node (send yourself an email) or a Webhook node (post to any endpoint). The data flowing into the final node is identical regardless of destination.

Using Slack Block Kit for richer messages

For a more visually appealing Slack message, use Block Kit JSON instead of plain text. Click "Add option" → "Blocks" in the Slack node and paste this:

[ { "type": "header", "text": { "type": "plain_text", "text": "{{ $json.emoji }} Morning Weather — {{ $json.date }}" } }, { "type": "section", "fields": [ { "type": "mrkdwn", "text": "*Temperature*\n{{ $json.temperature }}°C" }, { "type": "mrkdwn", "text": "*Wind Speed*\n{{ $json.windspeed }} km/h" } ] } ]

Step 5 — Testing and Debugging

Before activating your workflow, test it thoroughly. n8n provides excellent debugging tools.

Run the full workflow manually

Click the "Execute Workflow" button in the top right toolbar. This runs all nodes from the trigger. Watch the green flow indicators move from left to right across the canvas as each node executes. Green = success, Red = error.

Inspect execution results

Click on any node after execution to see:

  • Input tab: What data arrived from the previous node
  • Output tab: What data this node produced and passed forward
  • Error tab: Error message and stack trace if the node failed

Pinning data for iterative development

This is the most underused n8n feature for beginners. When testing, the Schedule Trigger fires immediately — but what about the HTTP Request? What if the API is slow or rate-limited?

Pin the output of the HTTP Request node: click the node, go to Output tab, click the pin icon next to any execution result. Now n8n uses that pinned data instead of making a real API call every time you test. This makes development much faster and avoids hitting rate limits.

To pin data on a node: 1. Execute the node at least once 2. Click the node → Output tab 3. Click the pin icon (📌) next to the execution 4. The node now shows "Pinned" in orange 5. Subsequent test runs use this pinned data instead of re-executing 6. To unpin: click the pin icon again or the "Clear" button

Execution history

Go to the left sidebar → Executions. Every workflow run is saved here with timestamp, status, and full input/output data for every node. This is invaluable for debugging production issues — you can see exactly what data caused a failure hours or days later.

Debug Shortcut

If a node fails, click on it and look at the Error tab. The error message almost always tells you exactly what went wrong — wrong URL, missing field, credential issue. n8n error messages are generally excellent — read them carefully before googling.

Step 6 — Adding Error Handling

Production workflows need error handling. Without it, a failed API call silently kills your workflow. Add a fallback path:

6

Add an Error Trigger

In the left panel, click "Add workflow" → look at the "Settings" tab of your workflow. Enable "Error Workflow" and select or create a separate error-handling workflow. That workflow receives error details and can send you an alert.

For simple error handling on a single node, right-click any node and select "Add Error Output". This adds a red error connector you can route to a different node (like a Slack alert or email):

Error handling pattern: HTTP Request → [success output] → Edit Fields → Slack ↓ [error output] → Slack (send error alert to #alerts channel) # In the error Slack node, use these expressions: Text: ⚠️ Weather workflow failed! Error: {{ $json.error.message }} Node: {{ $json.error.node.name }} Time: {{ $now.toISO() }}

Step 7 — Saving and Activating

Your workflow is complete. Two final steps:

7

Save the workflow

Press Ctrl/Cmd + S or click the Save button. Name it something meaningful: "🌤️ Morning Weather Slack Alert". Good names help when you have dozens of workflows.

8

Activate the workflow

Toggle the Active switch in the top-right corner from grey to green. The workflow is now live. It will run automatically at 8 AM every day. The toggle must remain green — if you edit and save, it stays active.

Activation vs. Execution

"Execute Workflow" runs the workflow once manually right now. "Active" means the trigger fires automatically on its own schedule. You need both — test manually, then activate for scheduled runs. A workflow can be tested without being activated.

Workflow Best Practices for Beginners

Naming conventions

  • Use descriptive names: "Send Slack Alert on New HubSpot Lead" not "Workflow 4"
  • Add emoji prefixes to group related workflows: 📧 for email, 📊 for reports, 🤖 for AI
  • Rename individual nodes too — "Fetch Weather API" is clearer than "HTTP Request1"

Keep nodes small and focused

Each node should do one thing. Instead of one giant JavaScript Code node doing everything, use multiple Edit Fields, IF, and Set nodes. This makes debugging much easier — you can pinpoint exactly which step failed.

Use sticky notes for documentation

Right-click the canvas → "Add Sticky Note". Write a brief explanation of what the workflow does, any gotchas, and the last time it was updated. Your future self will thank you.

Test with edge cases

After your happy path works, test:

  • What happens when the API returns an empty array?
  • What if a required field is null or undefined?
  • What if the API is down?

Add IF nodes and error paths to handle these gracefully.

Skip the manual setup?

Use Scriflow to describe your automation in plain English and get a complete n8n workflow JSON — ready to import into your n8n instance with one click. Perfect for complex workflows you don't want to build node by node.

Frequently Asked Questions

How do I import a workflow from JSON?
In the n8n editor, press Ctrl/Cmd + Shift + V or go to the top-right menu (⋯) → "Import from file" or "Import from URL". Paste or load a JSON file and the workflow appears on the canvas ready to configure credentials.
Can a workflow have multiple triggers?
Each workflow has one primary trigger, but you can use the "Merge" node to combine outputs from multiple trigger branches. Alternatively, create separate workflows that call each other using the "Execute Workflow" node.
How do I process multiple items from an API response?
n8n automatically loops over items in arrays. If your HTTP Request returns an array, n8n creates one item per array element. All subsequent nodes receive and process each element individually. No explicit loop needed — this is n8n's item-based processing model.
What's the difference between Schedule Trigger and Cron Trigger?
They're the same node. The Schedule Trigger in n8n supports both a user-friendly interval picker and a raw cron expression. Use the expression option for complex schedules like "every weekday at 9 AM except the 1st of the month."
My workflow ran but I didn't get a Slack message — what happened?
Check the Executions history for the exact run. Click on it and inspect the Slack node's input and output. Common causes: wrong channel name (use #channel-name or the channel ID), the Slack app lacks permission to post, or the message text expression evaluated to empty.
How do I share a workflow with my team?
Export the workflow as JSON (⋯ → "Export") and share the file. Your team imports it in their n8n instance. Credentials are not exported — each person must connect their own API keys. For team collaboration on the same instance, use n8n's built-in credential sharing and workflow sharing features.