Skip to main content

Lint your n8n JSON here.

Project description

n8n-lint

A simple Python CLI tool for validating n8n workflow JSON files.

Python 3.12+ License: MIT Tests Coverage

Quick Start

# Use with uvx (recommended)
uvx n8n-lint validate workflow.json

# Or install with pip
pip install n8n-lint
n8n-lint validate workflow.json

Features

  • Validate n8n workflows - Check JSON structure and node properties
  • Complete CLI interface - validate, import-schema, list-schemas, export-report
  • Multiple output formats - Console, JSON, HTML, and Markdown
  • Custom schemas - Import your own node schemas
  • Rich formatting - Beautiful console output with progress bars
  • Report generation - Export validation reports in HTML/Markdown
  • High performance - Validates 1000+ nodes in under a second
  • Production ready - 87 tests passing, 0 linting issues

Installation

Using uvx (Recommended)

uvx n8n-lint validate workflow.json

Using pip

pip install n8n-lint
n8n-lint validate workflow.json

From Source

git clone https://github.com/your-username/n8n-lint.git
cd n8n-lint
uv sync
uv run n8n-lint validate workflow.json

Usage

Basic Validation

# Validate a workflow file
n8n-lint validate workflow.json

# Validate with JSON output
n8n-lint validate workflow.json --output json

# Quiet mode (errors only)
n8n-lint validate workflow.json --quiet

Schema Management

# List available schemas
n8n-lint list-schemas

# Import a custom schema
n8n-lint import-schema custom-schema.json --node-type my-custom-node

Report Generation

# Export HTML report
n8n-lint export-report workflow.json --output report.html --format html

# Export Markdown report
n8n-lint export-report workflow.json --output report.md --format markdown

Command Reference

# Show help
n8n-lint --help

# Show version
n8n-lint --version

# Validate command help
n8n-lint validate --help

Exit Codes

  • 0 - Success (no errors)
  • 1 - Validation errors found
  • 2 - Warnings found
  • 3 - Info messages only

Performance

n8n-lint is optimized for speed and efficiency:

  • Fast validation - Validates 1000+ nodes in under a second
  • 🚀 Schema caching - Intelligent caching for repeated node types
  • 💾 Memory efficient - Minimal memory footprint for large workflows
  • 🔄 Progress tracking - Real-time progress updates for long validations

Performance Benchmarks

Workflow Size Validation Time Memory Usage
100 nodes ~0.1s ~5MB
500 nodes ~0.3s ~15MB
1000 nodes ~0.7s ~25MB

Supported Node Types

  • n8n-nodes-base.function - JavaScript execution
  • n8n-nodes-base.httpRequest - HTTP API calls
  • n8n-nodes-base.set - Data manipulation
  • n8n-nodes-base.if - Conditional logic
  • n8n-nodes-base.switch - Multi-condition logic

Examples

Valid Workflow

{
  "name": "My Workflow",
  "nodes": [
    {
      "id": "1",
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [100, 100]
    },
    {
      "id": "2",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [300, 100],
      "parameters": {
        "url": "https://api.example.com",
        "method": "GET"
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Validation Output

$ n8n-lint validate workflow.json
✅ Validation complete: No issues found

Error Output

$ n8n-lint validate invalid-workflow.json
❌ ERROR: Required property 'typeVersion' is missing (Node: n8n-nodes-base.function, Property: typeVersion, Line: 2, File: invalid-workflow.json)
  Expected: present
  Actual: missing

JSON Output

For automation and CI/CD integration:

n8n-lint validate workflow.json --output json
{
  "timestamp": "2025-09-08T10:30:00.000Z",
  "validation_result": {
    "errors": [
      {
        "message": "Required property 'typeVersion' is missing",
        "severity": "error",
        "node_type": "n8n-nodes-base.function",
        "property_path": "typeVersion",
        "expected": "present",
        "actual": "missing",
        "line_number": 2,
        "file_path": "workflow.json"
      }
    ],
    "summary": {
      "errors": 1,
      "warnings": 0,
      "info": 0,
      "total_messages": 1,
      "total_nodes": 2,
      "validation_time": 0.001,
      "file_path": "workflow.json",
      "has_errors": true,
      "has_warnings": false,
      "has_info": false,
      "is_success": false
    }
  }
}

Development

Setup

git clone https://github.com/your-username/n8n-lint.git
cd n8n-lint
uv sync

Testing

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=src/n8n_lint

# Run specific test file
uv run pytest tests/test_validator.py

Code Quality

# Format code
uv run ruff format

# Lint code
uv run ruff check

# Type checking
uv run mypy src/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite
  6. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Roadmap

  • VS Code extension for real-time validation
  • Additional node type support as needed
  • Configuration file support
  • Performance optimizations for large workflows

n8n-lint - Simple, fast, and reliable n8n workflow validation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

n8n_lint-1.1.1.tar.gz (90.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

n8n_lint-1.1.1-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file n8n_lint-1.1.1.tar.gz.

File metadata

  • Download URL: n8n_lint-1.1.1.tar.gz
  • Upload date:
  • Size: 90.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for n8n_lint-1.1.1.tar.gz
Algorithm Hash digest
SHA256 fe726497357a3fe0571f68721e24df67d77b593eafee1bce1012f5951ec4d17c
MD5 d5dea64a44e377bb6d62124d04bf296c
BLAKE2b-256 422e6986306dc381f5f63e1da47a6dd94d648d4db30319b502d5ea3ee5125622

See more details on using hashes here.

File details

Details for the file n8n_lint-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: n8n_lint-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for n8n_lint-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0dd94343bc3bf20944c1a14386e2a0eb658d5a08f30b142e0bd522eb8af8dbd7
MD5 7631bba70e1a757e97ff2687d6b2f88e
BLAKE2b-256 a663862143fafad2bae1949dedb2c3b88b870e52cf0cf2d3a783213547066e6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page