Lint your n8n JSON here.
Project description
n8n-lint
A simple Python CLI tool for validating n8n workflow JSON files.
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 found2- Warnings found3- 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 executionn8n-nodes-base.httpRequest- HTTP API callsn8n-nodes-base.set- Data manipulationn8n-nodes-base.if- Conditional logicn8n-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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- Documentation: Github Pages
- Issues: GitHub Issues
- Discussions: GitHub Discussions
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe726497357a3fe0571f68721e24df67d77b593eafee1bce1012f5951ec4d17c
|
|
| MD5 |
d5dea64a44e377bb6d62124d04bf296c
|
|
| BLAKE2b-256 |
422e6986306dc381f5f63e1da47a6dd94d648d4db30319b502d5ea3ee5125622
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dd94343bc3bf20944c1a14386e2a0eb658d5a08f30b142e0bd522eb8af8dbd7
|
|
| MD5 |
7631bba70e1a757e97ff2687d6b2f88e
|
|
| BLAKE2b-256 |
a663862143fafad2bae1949dedb2c3b88b870e52cf0cf2d3a783213547066e6b
|