Skip to main content

Command Palette

Search for a command to run...

🟢 Beginner’s Guide to n8n Automation

Updated
•5 min read

Build a ā€œWeather Data Every Minuteā€ Workflow (with & without Docker)

Automation can save hours of manual work—but coding full-blown services is daunting if you’re new to development.
n8n changes that by letting you drag, drop, and connect nodes to create workflows visually.

In this guide you’ll learn:

  • What n8n is and why it’s useful

  • How to install n8n two ways: with Docker and without Docker

  • How to import and run a sample workflow that generates random weather data every minute

  • How each node in the workflow works

  • Extra ideas to help you create your own automations

Let’s get started!


1ļøāƒ£ What Is n8n?

n8n (pronounced ā€œn-eight-nā€) is an open-source automation platform.
Think of it like a programmable version of tools such as Zapier or IFTTT:

  • Visual builder – create flows by connecting nodes instead of writing boilerplate code.

  • Over 350 ready-made nodes – HTTP requests, Slack, Google Sheets, Databases, GitHub, and many more.

  • Self-hosted or cloud – run on your own server for full control.


2ļøāƒ£ Install n8n

You can run n8n either inside a Docker container (simple and portable) or directly on your system (no Docker needed).
Pick the method you prefer.

  1. Create a folder for n8n:

     mkdir n8n && cd n8n
    
  2. docker-compose.yml:

     version: "3.9"
     services:
       n8n:
         image: n8nio/n8n
         ports:
           - "5678:5678"
         environment:
           - N8N_BASIC_AUTH_ACTIVE=true
           - N8N_BASIC_AUTH_USER=admin
           - N8N_BASIC_AUTH_PASSWORD=strongpassword
           - TZ=Asia/Kolkata
         volumes:
           - ./n8n_data:/home/node/.n8n
    
  3. Start it:

     docker compose up -d
    
  4. Visit http://<your-server-ip>:5678 and log in with admin / strongpassword.


B. Install without Docker (Native Node.js)

If you’d rather skip Docker:

# Update packages
sudo apt update && sudo apt upgrade -y

# Install Node.js 18 or newer
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs build-essential

# Install n8n globally
sudo npm install -g n8n

Optional but recommended security:

export N8N_BASIC_AUTH_ACTIVE=true
export N8N_BASIC_AUTH_USER=admin
export N8N_BASIC_AUTH_PASSWORD=strongpassword

Run:

n8n

Open http://<your-server-ip>:5678 in a browser.

āœ… Tip: For production, create a systemd service so n8n starts automatically on reboot.


3ļøāƒ£ Import the Weather Workflow

Download or copy the following JSON into a file called weather-workflow.json:

{
  "name": "Weather Data Every Minute (Enhanced)",
  "nodes": [
    {
      "parameters": {
        "triggerTimes": [
          {
            "mode": "everyMinute"
          }
        ]
      },
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [150, 300]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "city",
              "value": "London"
            }
          ]
        },
        "options": {}
      },
      "name": "Set City",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [350, 300]
    },
    {
      "parameters": {
        "functionCode": "const conditions = ['Sunny', 'Cloudy', 'Rainy', 'Windy', 'Snowy'];\nreturn [{\n  json: {\n    city: $json.city,\n    temperature: Math.floor(Math.random() * 16) + 15, // 15-30\n    condition: conditions[Math.floor(Math.random() * conditions.length)],\n    humidity: Math.floor(Math.random() * 41) + 40, // 40-80\n    wind: Math.floor(Math.random() * 21) + 5 // 5-25\n  }\n}];"
      },
      "name": "Random Weather",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [550, 300]
    },
    {
      "parameters": {
        "value": "={{$now}}",
        "custom": true,
        "toFormat": "yyyy-MM-dd HH:mm:ss",
        "options": {}
      },
      "name": "Date & Time",
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 1,
      "position": [750, 300]
    },
    {
      "parameters": {
        "responseMode": "lastNode",
        "options": {}
      },
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [950, 300]
    }
  ],
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "Set City",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set City": {
      "main": [
        [
          {
            "node": "Random Weather",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Random Weather": {
      "main": [
        [
          {
            "node": "Date & Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date & Time": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}
  1. Go to the n8n web interface.

  2. Click Workflows → Import from File.

  3. Select the file and save.


4ļøāƒ£ Understand the Nodes

Here’s what each node in Weather Data Every Minute (Enhanced) does:

NodeWhat It DoesWhy It Matters
CronTriggers the workflow every minute.Acts as a scheduler—no manual clicks needed.
Set CityAdds a static city: "London" field.Lets you define default data for downstream nodes.
Random Weather (Function)Runs a small JavaScript snippet to create random temperature, condition, humidity, and wind.Shows how to add custom logic beyond built-in nodes.
Date & TimeAdds the current timestamp formatted as YYYY-MM-DD HH:mm:ss.Useful for logs or time-stamped records.
Respond to WebhookOutputs the final JSON.Lets other apps or people call the endpoint and get the data.

When active, every minute this workflow generates output similar to:

{
  "city": "London",
  "temperature": 24,
  "condition": "Sunny",
  "humidity": 65,
  "wind": 14,
  "date": "2025-09-17 22:30:00"
}

5ļøāƒ£ Test It

  1. Activate the workflow (toggle in the top right).

  2. Use curl or a browser to hit the test URL shown in the ā€œRespond to Webhookā€ node:

     curl http://<your-ip>:5678/webhook/<your-path>
    
  3. You’ll see fresh weather data each time you call it.


6ļøāƒ£ Fun Extensions

This simple example is just the start.
Here are some beginner-friendly ideas:

  • Log to a Database – Add a PostgreSQL or MySQL node to store each weather record.

  • Send Alerts – Add an Email or Slack node to notify if the temperature crosses a threshold.

  • Google Sheets Dashboard – Append each new data point to a sheet for easy charts.

  • Real API Calls – Replace the Random Weather function with an HTTP Request node calling a real API such as OpenWeatherMap.


7ļøāƒ£ Key Takeaways for Beginners

  • Visual First – You don’t need to be a developer to start; drag-and-drop gets you far.

  • Two Easy Installs – Docker for convenience, Node.js if you prefer native.

  • Reusable – The same workflow can run locally, in the cloud, or on a Raspberry Pi.

More from this blog

NishikantaRay

40 posts