Getting Started with n8n: Your First Automation in Minutes

n8n logo

If you’ve ever thought “I should automate this…” — congratulations, you’re already thinking like an n8n user.

n8n (pronounced “n-eight-n”) is a workflow automation tool that lets you connect APIs, services, and logic together visually. Think Zapier, but:

  • open‑source
  • self‑hostable
  • extremely flexible
  • developer‑friendly

In this post, we’ll:

  1. Install n8n using Docker
  2. Create a simple but genuinely useful first workflow
  3. Talk about ideas you can build next

No prior n8n experience required.


Why n8n?

Before we install anything, it’s worth understanding why people gravitate toward n8n.

n8n shines when you want:

  • Full control over your workflows
  • To self‑host (no per‑task pricing anxiety)
  • Logic that goes beyond simple triggers → actions
  • A visual tool that still respects developers

If you’re already comfortable with APIs, webhooks, or Docker, n8n will feel very natural.


Installing n8n with Docker

The easiest way to get started is with Docker. This keeps your setup clean and makes upgrades painless.

Prerequisites

Make sure you have:

  • Docker installed
  • Docker Compose (usually bundled with Docker Desktop)

You can verify with:

docker --version
docker compose version

Minimal Docker Compose Setup

Create a new directory and add a docker-compose.yml file:

YAML
services:
  n8n:
    image: n8nio/n8n:latest
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=admin
      - TZ=America/Chicago
    volumes:
      - n8n_data:/home/node/.n8n
      
  # Using mailpit for testing email sending    
  mailpit:
    image: axllent/mailpit:latest
    ports:
      - "8025:8025" # Mailpit UI
      - "1025:1025" # SMTP
    restart: unless-stopped

volumes:
  n8n_data:

⚠️ Note: This is perfect for local development. For production, you’ll want stronger auth, HTTPS, and proper secrets management.


Start n8n

From the same directory:

docker compose up -d

Once it’s running, open:

👉 http://localhost:5678

Log in with the credentials you set above.

n8n empty dashboard

You now have a fully working automation platform running locally.


Your First Workflow:
Webhook → Notification

For this beginner example, we will be accepting a json message to a webhook. We will then forward that message on to an email via mailpit. We are using mailpit because it’s free and easy to test locally, but in the real world you would use a real SMTP server or something like Sendgrid.

Simple n8n workflow

This pattern shows up everywhere:

  • form submissions
  • GitHub events
  • Stripe webhooks
  • app‑to‑app automation

Step 1: Create a New Workflow

  1. Click “New Workflow”
  2. Give it a name like Incoming Webhook Test

Step 2: Add a Webhook Trigger

  1. Click Add node
  2. Choose Webhook
  3. Set:
    • HTTP Method: POST
    • Path: hello
    • Respond: Using 'Respond to Webhook' node

The node should save automatically and you can close it.


Step 4: Send Email

  1. Add a Send Email node and ensure the action is Send Email
  2. Click the dropdown under Credentials to connect with
    • In the top left, name the credentials Mailpit
    • leave the username and password blank
    • Set:
      • Host: mailpit (this is the service name in your docker-compose.yml)
      • Port: 1025
      • SSL/TLS: off (don’t turn this off in production!)
    • Save your mailpit credentials
  3. Set the following in your Send Email node:
    • Credentials to connect with: mailpit (you just created this)
    • From Email: n8n@example.com
    • To Email: david@example.com
    • Subject: n8n webhook
    • Email Format: text
    • Text:
Name:  {{ $json.body.name }}
Message: {{ $json.body.message }}

Connect the Webhook node → Send Email node


Step 4: Add a Webhook Response

Let’s send a confirmation to the webhook that we have succeeded.

  1. Add a new node
  2. Choose Respond to Webhook
  3. Set:
    • Respond With: JSON
    • Response Body:
{
  "status": "ok",
  "message": "Webhook received"
}

Connect the Send Email node → Respond node.


Step 5: Test the Workflow

Click Execute Workflow, then run the following in a local terminal:

curl -X POST http://localhost:5678/webhook-test/hello \
  -H "Content-Type: application/json" \
  -d '{"name":"John Doe", "message":"Greetings, How are you?"}'

You should receive your JSON response immediately.

If you visit localhost:8025 you can see that mailpit captured the email that n8n sent. Feel free to tinker with the send email to see how the message is sent. If you know HTML, maybe try to send an HTML email message.

Congrats 🎉 — you’ve built your first working n8n workflow.


Making It Actually Useful

Let’s add one more node to show n8n’s real power.

Add a Notification (Email, Slack, Discord, etc.)

Instead of just responding, you can:

  • Send a Slack message
  • Post to Discord
  • Send yourself a real email
  • Write to a database

Now every incoming request becomes a notification.


Key Concepts You Just Learned

Without realizing it, you’ve already touched some core n8n ideas:

  • Triggers start workflows
  • Nodes process or act on data
  • JSON flows through everything
  • Expressions ({{$json.body}}) let you map data dynamically

This mental model scales all the way up to complex, multi‑step automations.


Ideas to Build Next

Here are some natural next projects:

Beginner

  • Form submission → Email + Google Sheet
  • RSS feed → Daily digest
  • Webhook → Database insert

Intermediate

  • GitHub webhook → Issue triage
  • Stripe event → Internal notification
  • API polling → Conditional logic → Alert

Advanced

  • Multi‑step scraping workflows
  • Retry + error handling pipelines
  • Queue‑based processing with rate limits
  • Acting as an automation backend for your own app

Final Thoughts

n8n is one of those tools that starts simple and quietly becomes indispensable.

If you can:

  • send an HTTP request
  • read JSON
  • think in steps

You can build powerful automations with n8n.

In future posts, I’ll dig into:

  • credentials and secrets
  • error handling
  • versioning workflows
  • using n8n as an internal automation service

But for now — you’re officially up and running.

Happy automating 🚀

Leave a Reply

I’m David

Welcome to my little corner of the internet that I dedicate to programming. I’m a principal software engineer at Fynix Consulting and strive to always be learning new things. I love to code and I love to write about coding!

Let’s connect

Discover more from David Boothe's Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading