T The Testing Academy · n8n tutorial
n8n · WORKFLOW AUTOMATION FOR TESTERS

n8n Complete Tutorial — install, build workflows, plug in AI

A no-fluff guide from The Testing Academy: spin n8n up locally, learn the node model, build your first end-to-end workflow, then automate the boring QA chores with AI nodes and MCP.

Time: 25–40 min Level: Beginner → SDET Stack: Node 20 · Docker · n8n Cloud · Ollama / OpenAI nodes

① What n8n is

A node-based workflow tool. Drag a trigger, drag actions, draw arrows, hit run. Self-hosted, source-available, free for personal use, with paid Cloud + Enterprise tiers.

🧩

The shortest possible mental model

n8n = Zapier you can run on your laptop. Each rectangle on the canvas is a node — an HTTP call, a database query, a Slack post, a Playwright run. Connect them, pass JSON between them, and you have a workflow. That's it.

workflow at a glance

Trigger
Fetch / Transform
AI / Logic
Action
💡
Why testers care. n8n eats the “move data + glue APIs” tasks that fill an SDET's day — kicking Playwright nightly, posting flaky-test reports to Slack, syncing Jira with TestRail, summarising bug logs with an LLM. Less Bash, more arrows.

② Core concepts

Five words. Learn them once, the rest of n8n is just discovering more nodes.

TermWhat it meansExample
WorkflowOne canvas with one or more triggers + nodes wired together."Nightly Playwright run"
NodeA single step. Has inputs, options, and produces JSON items.HTTP Request, Slack, Postgres, OpenAI Chat
TriggerThe first node — what kicks the workflow off.Cron, Webhook, Manual, Schedule
ItemOne JSON object flowing through. Many items = the next node runs once per item.{ "test": "login.spec.ts", "status": "fail" }
ExpressionInline JS using {{ $json.field }} to reach prior data.{{ $json.url }}
Mantra. One node in — many items out. Every node is a function over an array of items, even when there's just one.

③ Install locally (Node.js)

Fastest path on a dev laptop. Needs Node 20+ and a free tcp port.

1

Confirm Node 20 or newer

n8n needs a recent Node. Run node --version. If you're below 20, install via nvm.

2

Install with npx — zero global state

Spawn n8n into your terminal directly. First boot creates ~/.n8n with sqlite + encryption key.

3

Open the editor

It serves at http://localhost:5678. First run prompts you to create an owner account.

~/dev — bash
# 1. check node
node --version            # v20.x or v22.x

# 2. spawn n8n (no install needed)
npx n8n

# or install globally — then run as `n8n` anywhere
npm install -g n8n
n8n start

# 3. open editor
open http://localhost:5678
⚠️
Persistence. The default sqlite db lives in ~/.n8n/database.sqlite. Back it up before nuking your home folder.

Use a custom port + tunnel

bash
# run on a custom port
N8N_PORT=5680 n8n start

# expose webhooks to the internet for OAuth callbacks
n8n start --tunnel

④ Install via Docker

Best for teams + servers. One docker-compose.yml, persistent volume, auto-restart.

docker-compose.yml
version: "3.8"

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n:latest
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=localhost
      - N8N_PORT=5678
      - N8N_PROTOCOL=http
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=change-me
      - GENERIC_TIMEZONE=Asia/Kolkata
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data: {}
bash
docker compose up -d
docker compose logs -f n8n
📦
Volumes matter. Without the named volume your workflows + credentials vanish on every docker compose down. Always mount /home/node/.n8n.

⑤ n8n Cloud (zero install)

If you don't want to babysit a server, n8n Cloud gives you a hosted instance with HTTPS, auto-updates, and managed credentials. Free tier available; paid tiers scale executions + concurrent workflows.

MethodSetup timeCostBest for
Local npx n8n1 minFreeSolo devs, demos, learning
Docker (self-host)5 minFreeTeams, persistent workflows
n8n Cloud0 minPaid (free trial)Don't-want-to-ops, reliable webhooks
Kubernetes / Helm30 minInfra costEnterprise, multi-tenant

⑥ Build your first workflow

Goal: every morning at 9 AM, hit a public flaky-test report API, summarise the failures with a model, post to Slack. End-to-end in eight clicks.

1

Add a Schedule trigger

Click + Add first step → search Schedule. Set cron = 0 9 * * * (9 AM every day).

2

Add HTTP Request

Method GET, URL https://app.thetestingacademy.com/api/flaky-tests. Set Response → JSON.

3

Add a Code node (optional)

Filter to only failures: return items.filter(i => i.json.status === 'fail');

4

Add an OpenAI / Ollama Chat node

Prompt: "Summarise these flaky tests as 3 bullet points for a stand-up: {{ $json.tests }}".

5

Add Slack node

Channel #qa-standup, Text {{ $json.summary }}. Authenticate once, reuse forever.

6

Activate

Toggle the workflow to Active. Done — n8n now wakes up daily, fetches, summarises, posts.

code-node example
// runs once per workflow execution; receives all incoming items
const failures = items.filter((i) => i.json.status === 'fail');

return failures.map((f) => ({
  json: {
    name: f.json.name,
    file: f.json.spec,
    duration: f.json.duration_ms
  }
}));

⑦ AI & MCP nodes

n8n ships first-class LLM nodes — OpenAI, Anthropic, Ollama (local), HuggingFace, plus a generic LangChain agent and a Model Context Protocol (MCP) client.

💬

Chat / Completion

Pick a model, paste a system prompt, pipe items in. Output lands as $json.message.content.

🧠

LangChain Agent

Wire a memory + tools + an LLM. Ask the agent to investigate; it loops calls until it answers.

🦙

Ollama (local)

Hit your local http://localhost:11434 Ollama with Llama 3, Mistral, or Phi. No data leaves the laptop.

🔌

MCP client

Add a Model Context Protocol server (e.g. our Playwright MCP) — the LLM can drive a real browser inside the workflow.

📚

Retrieval (RAG)

Combine Vector Store (Postgres + pgvector / Pinecone) with a Q&A chain — answers grounded in your test docs.

🛠️

Tool calling

Expose any HTTP endpoint as a tool. Model decides when to invoke; n8n logs every call for replay.

🔗
Pair with our MCP cheat sheet. Read /mcp-cheat-sheet + /playwright-mcp-masterclass to wire Playwright into an n8n agent.

⑧ QA / SDET automations worth stealing

Six workflows that pay for themselves the same week.

⑨ Debug + observability

When a workflow misbehaves, four things rescue you.

🔍

Pin data on a node

Right-click a node → Pin data. Subsequent runs use the pinned JSON instead of re-calling the upstream API. Cuts iteration time from 30s to 30ms.

🧪

Test single node

Hit Execute node. Runs that one node with the data it would have received from upstream pinned data. No need to run the whole workflow.

🪵

Executions list

Settings → Executions. See every run, its status, and the exact JSON that flowed between nodes. Replay any failed run with one click.

🛑

Error workflow

Set a workflow as the global error workflow in settings. When any other workflow throws, this one fires — perfect for “page on-call when ETL breaks”.

⑩ Next steps

A 30-minute path from "installed n8n" to "n8n is part of my stack".

The best automation tool is the one you actually wire up by Friday. n8n's not magic — it's a node graph with great defaults. Open it, drag a Cron, drag an HTTP Request, ship.

— The Testing Academy

Where to go from here