Simple linter tool for n8n workflows JSON files.
n8n workflows can become complex and hard to maintain. n8n-lint helps you maintain high-quality workflows by identifying common issues and anti-patterns.
- Run lint on all n8n workflows within a directory.
- Configurable GLOB include / exclude patterns.
- Multiple built-in rules for workflow validation.
- Configurable reporting levels (error, warn, off).
You can build the CLI using task:
task buildThis will create a binary named n8n-lint-<os>-<arch>.
The check command is used to lint n8n workflow files.
./n8n-lint-darwin-arm64 check [flags]Flags:
--config,-c: Path to the configuration file (default:.n8n-lint.yaml).--verbose,-v: Enable verbose logging.--help,-h: Show help.
n8n-lint uses a YAML configuration file to define which rules to run and which files to include or ignore.
include:
- "**/*.json"
ignore:
- "node_modules/**"
- "backups/**"
rules:
no_infinite_loop:
report: error
no_dead_ends:
report: warn
allowed_names:
- "End Node"
- "Respond to Webhook"
no_dangling_ifs:
report: error
no_disabled_nodes:
report: warn
allowed_names:
- "Debug Node"
no_dead_nodes:
report: errorThe rules section allows you to configure individual rules:
| Rule Name | Description | Configuration Options |
|---|---|---|
no_infinite_loop |
Detects potential infinite loops in the workflow. | report |
no_dead_ends |
Detects nodes that do not lead to any subsequent action. | report, allowed_names (list of strings) |
no_dangling_ifs |
Detects IF nodes where one or both branches are not connected. | report |
no_disabled_nodes |
Detects disabled nodes in the workflow. | report, allowed_names (list of strings) |
no_dead_nodes |
Detects nodes with no incoming or outgoing connections. | report |
error: Fails the lint check (exit code 1).warn: Prints a warning but does not fail the check.off: Disables the rule.
Small guide on getting started with local dev.
task install-localtask installtask ciUse the template to add a new rule.
# Generate new rule scaffold
task gen-rule -- --name <rule_name>MIT License. See LICENSE for details.