Home
Softono

N8nTrace

Open source MIT TypeScript
12
Stars
2
Forks
2
Issues
1
Watchers
4 months
Last Commit

 About N8nTrace

Self-hosted analytics & observability dashboard for n8n. Execution tracking, Prometheus metrics explorer, RBAC, audit logging. Security-first. MIT License.

Platforms

Web Self-hosted Docker

Languages

TypeScript

Links

Need Help Installing N8nTrace?

We provide expert installation service for this software. Our team will install, configure, and secure N8nTrace on your server. plans start at just $30.

n8n-trace

n8n-trace

Self-hosted observability dashboard for n8n
Execution analytics β€’ Instance metrics β€’ RBAC β€’ Audit logging

This is an unofficial community project and not affiliated with n8n GmbH.

Release Docker Pulls License: MIT Node 22+ PostgreSQL 17+

n8n-trace Demo

Quick Start  Β·  Connect n8n  Β·  Features  Β·  Security  Β·  Deploy  Β·  Security Guide  Β·  Contribute


What is n8n-trace?

n8n-trace is a self-hosted observability and analytics platform for n8n. It gives you execution analytics, instance health monitoring, a Prometheus-style metrics explorer, and role-based access control β€” purpose-built for production environments.

n8n-trace runs as a single hardened Docker container alongside PostgreSQL. It never makes outbound calls to your n8n instances. Data flows one way: n8n pushes to n8n-trace, not the other way around.

n8n-trace β€” Execution Analytics

n8n-trace β€” Instance Metrics


Who is this for?

  • Teams self-hosting n8n who need centralized visibility into what their workflows are doing.
  • Platform engineers managing multiple n8n instances (prod, staging, dev) from a single unified dashboard.
  • Cross-functional Teams (e.g., Management, QA): Departments that need to track workflow successes and failures without being exposed to sensitive payload data or underlying configurations.
  • Security-conscious organizations that require audit logging, RBAC, and strict data privacy. n8n-trace intentionally excludes workflow payloads and raw error logs, ensuring GDPR compliance by design.
  • Anyone who wants execution analytics without depending on n8n's built-in UI or paying for Enterprise roles just to get a "Viewer" access.

Why n8n-trace alongside n8n?

n8n-trace complements n8n's built-in UI with enterprise observability features:

Feature n8n Built-in n8n-trace
Node-level metrics (P95) ❌ βœ…
Multi-instance dashboard ❌ βœ…
Advanced RBAC (workflow scoping) Limited βœ… Full
Audit logging ❌ βœ…
Prometheus explorer ❌ βœ… (optional)
Viewer Role Access ❌ Enterprise only (sees payload) βœ… Included (metadata only)
Payload Privacy Execution logs expose sensitive data βœ… 100% blind to payload & secrets

n8n-trace is your dedicated observability layer β€” it works alongside n8n without replacing the workflow editor.


Features

Core capabilities designed for production environments:

Feature Description
πŸ“Š Execution Analytics Success/failure rates, duration trends, node-level performance
πŸ“ˆ Instance Monitoring CPU, memory, event loop metrics via Prometheus endpoint
πŸ” Metrics Explorer Query and chart any Prometheus metric with label filtering
🧭 Multi-Instance Monitor prod, staging, dev from a single dashboard
πŸ‘₯ Role-Based Access Admin, Analyst, Viewer roles with instance/workflow scoping
πŸ”’ Audit Logging All security events logged with configurable IP privacy
πŸ—‘οΈ Data Retention Automatic cleanup of old execution data
⬇️ CSV Export Export execution data and metrics for analysis
πŸ“¦ Single Container Google Distroless image β€” minimal attack surface

Quick Start

Prerequisites: Docker + Docker Compose v2+

git clone https://github.com/Mohammedaljer/n8nTrace.git
cd n8n-trace
cp .env.example .env

[!IMPORTANT] Generate strong secrets:

openssl rand -base64 24  # POSTGRES_PASSWORD
openssl rand -base64 32  # JWT_SECRET

[!NOTE] Metrics optional: Set RETENTION_ENABLED: "false" if you only want workflow executions. n8n-trace works without Prometheus metrics.

docker compose -f docker-compose.prod.yml up -d

Open http://localhost:8899/setup β†’ create admin user.

[!NOTE] Metrics are optional. If you don’t enable metrics collection on your n8n side, you can disable metrics features in n8n-trace too and still use execution analytics and workflow views.

Set in .env:

METRICS_ENABLED="false"

Connect n8n to n8n-trace

Data flows from n8n to n8n-trace via two included n8n workflows that write directly to the database.

1. Import workflows

Import these from the /Workflows folder:

Workflow Purpose
n8n-trace-Execution-Collector.json Syncs executions and node data
metrics-snapshot.json Collects instance health metrics (optional)

2. Configure database connection

Add to .env:

TRACE_INGEST_USER=trace_ingest
TRACE_INGEST_PASSWORD=<your-strong-password>

Configure PostgreSQL node in each workflow with trace_ingest credentials.


Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   n8n       β”‚      β”‚           n8n-trace                β”‚
β”‚  Instance   β”‚ ───► β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚             β”‚      β”‚  β”‚PostgreSQL│◄─│ Express + SPA  β”‚  β”‚
β”‚  (writes    β”‚      β”‚  β”‚  :5432   β”‚  β”‚     :8899      β”‚  β”‚
β”‚   via       β”‚      β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚   ingest)   β”‚      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β–²
                                    β”‚ HTTPS
                               Your Browser
  • Single container β€” Express.js serves the React SPA and REST API (Google Distroless, Node.js 22)
  • Push-based ingestion β€” n8n workflows write directly to PostgreSQL; Trace never calls n8n

See the Architecture Guide for the full request flow, proxy trust model, and deployment topologies.


Security

n8n Trace is designed for production self-hosting with defense-in-depth:

Layer Implementation
🐳 Container Google Distroless (no shell, no package manager), non-root UID, read-only filesystem
πŸ›‘οΈ Headers Strict CSP via Helmet (default-src 'self', frame-ancestors 'none')
πŸ” Auth JWT in HttpOnly/Secure/SameSite cookies, bcrypt password hashing
🚫 Brute Force Account lockout (10 attempts / 15-min lock) + per-IP rate limiting
πŸ”‘ Passwords 12-char minimum, ~60-entry common-password denylist
♻️ Sessions Token versioning with "Log out all devices" + admin session revocation
🧱 CSRF Origin/Referer validation on all mutating /api/ endpoints
πŸ•΅οΈ Privacy GDPR-compliant audit logs with configurable IP handling (raw / hashed / none)
πŸ—„οΈ Database Least-privilege ingest user, parameterized SQL, no string concatenation
🚦 Startup Fail-fast checks reject insecure configs in production

[!WARNING] In production, always set COOKIE_SECURE=true, use HTTPS, and ensure CORS_ORIGIN is an exact URL (not *). Trace enforces this β€” it will refuse to start with insecure settings.

See the full Security Guide.


Docker Hub

Docker Hub

services:
  app:
    image: mohammedaljer/n8n_Trace:v2.0.0

[!NOTE] Upgrading from v1.x? The separate n8n_Trace_backend and n8n_Trace_frontend images are deprecated. Use the single unified image mohammedaljer/n8n_Trace:v2.0.0. See the Deployment Guide.


RBAC

Role Access
Admin Full access β€” users, groups, roles, audit logs, retention, all data and metrics
Analyst Read + export β€” dashboards, full metrics, CSV export
Viewer Read-only β€” dashboards and version info only

Non-admin users can be scoped to specific instances, workflows, or tags. Instance-level metrics (CPU, RAM) require explicit instance scope β€” tag or workflow scopes alone do not grant infrastructure visibility.

See RBAC Guide for groups, scopes, and the full permission matrix.


Environment Variables

Required

Variable Description
POSTGRES_PASSWORD Database password (openssl rand -base64 24)
JWT_SECRET JWT signing key, min 32 chars (openssl rand -base64 32)

Security

Variable Default Description
COOKIE_SECURE true Require HTTPS for auth cookies
CORS_ORIGIN β€” Exact frontend URL (no trailing slash, no wildcard)
PASSWORD_MIN_LENGTH 12 Minimum password length
ACCOUNT_LOCKOUT_THRESHOLD 10 Failed login attempts before lockout
ACCOUNT_LOCKOUT_DURATION_MINUTES 15 Lockout duration in minutes
AUDIT_LOG_IP_MODE raw IP storage mode: raw, hashed, none

See .env.example for all options, or the Environment Reference.


Documentation

Guide Description
πŸš€ Getting Started Local setup and first steps
πŸ—οΈ Architecture Request flow, trust model, deployment topologies
🐳 Deployment Production Docker, Portainer, reverse proxy
βš™οΈ Configuration All environment variables explained
🧠 Backend API reference, database schema, migrations
🎨 Frontend React components, routing, widget system
πŸ”’ Security CSP, lockout, passwords, audit logging, GDPR
πŸ‘₯ RBAC Roles, groups, scopes, permission matrix
🌍 Environment Docker environment variable reference
πŸ”„ Workflows n8n collector workflow setup and design
πŸ› οΈ Troubleshooting Common issues and solutions

Health Check

curl http://localhost:8899/health
# {"ok":true,"db":"connected"}

The /health and /ready endpoints require no authentication β€” use them for Docker health checks, Kubernetes probes, or uptime monitoring.


Contributing

Contributions are welcome. See CONTRIBUTING.md for guidelines.

Fork Open Issue PRs Welcome Stars


License

MIT Β© 2026 Mohammed Aljer


Built for n8n community β€’ Unofficial project, not affiliated with n8n GmbH
Brought to life with the assistance of modern AI coding tools.