Command line

CommandWhat it does
workflow-lint lint [paths...]Lint workflow JSON files. Defaults to .; - reads stdin
workflow-lint fmt [paths...]Format the canvas layout
workflow-lint initWrite a starter workflow-lint.config.yaml
workflow-lint rules [--json]List every rule
workflow-lint node-types list [--json]List bundled and installed n8n versions
workflow-lint node-types install <version>Install the node descriptions of another n8n version
workflow-lint node-types diff <a> <b>Compare two installed n8n versions
workflow-lint fleet <manifest> [--full]Build per-directory n8n version settings from a manifest
workflow-lint --versionPrint the version

A bare path is treated as lint, so workflow-lint workflows/ lints that folder. Every command has --help.

lint

workflow-lint lint                           # every workflow under the current directory
workflow-lint lint workflows/ orders.json
workflow-lint lint --fix                     # apply safe fixes in place
workflow-lint lint --format json
curl -s "$N8N/api/v1/workflows/42" | workflow-lint lint -

An n8n API response ({ "data": { … } }) is accepted wherever a workflow export is.

Options

OptionMeaning
--config <path>Use this config file instead of the discovered workflow-lint.config.yaml
--n8n-version <v>n8n version to lint against. Overrides settings.n8nVersion
--format <f>stylish (default), json, sarif, junit, github-actions, canvas-overlay
--fail-on <level>Lowest severity that fails the run: info, warn or error (default)
--max-warnings <n>Fail when warnings exceed this count
--quietReport errors only
--fixApply safe fixes
--fix-unsafeAlso apply fixes that may change behaviour
--fix-type <types>Limit fixes to params, layout or connections (comma-separated)
--require-fixable-cleanFail when a finding remains that --fix could resolve
--rule <id>Run only this rule. Repeatable
--class <class>Run only stylistic or quality rules
--fail-on-stylisticLet stylistic findings fail the run. By default they never do
--gen-baselineRecord current findings as the accepted baseline
--ignore-baselineReport every finding, baselined or not
--baseline <path>Baseline file. Defaults to .workflow-lint-baseline.yaml
-l, --list-differentPrint only the paths of files that fail
--no-ignoreAlso lint files ignored by the config or .gitignore
--no-error-on-unmatched-patternSkip paths that do not exist instead of failing
--log-level <level>silent, error, warn, log (default) or debug

Exit codes

CodeMeaning
0Clean
1Findings at or above --fail-on, or more warnings than --max-warnings
2Usage error, or a file that will not parse

What counts as a workflow

Fixing

FlagApplies
--fixSafe fixes: renaming a decision node to end in ? (connections and expressions follow), setting includeOtherFields on a pass-through Set, adding a retry block to an HTTP node
--fix-unsafeAlso fixes that may change behaviour. Today that is the typeVersion bump, applied only when the node validates before and after

Fixes re-run until the file stops changing.

Linting a workflow against a pinned n8n version, then the --fix-unsafe diff

fmt

workflow-lint fmt                  # lay out every workflow under here
workflow-lint fmt --check          # exit 1 if anything would change; writes nothing
workflow-lint fmt -l               # only the paths that would change
workflow-lint fmt --stickies       # also resize sticky notes around their nodes

What it does:

Formatting the same file twice changes nothing. The same diff is available as the lint rule layout/formatted, which is off by default.

fmt accepts --n8n-version, --log-level, --no-ignore and --no-error-on-unmatched-pattern, with the same meaning as in lint.

Reporters

--formatUse it for
stylishReading at a terminal. The default
jsonScripts. Each finding has ruleId, messageId, nodeId, loc and data
sarifGitHub code scanning. Suggested fixes are included
junitGitLab and most CI runners
github-actionsInline annotations on a pull request, with no upload step
canvas-overlayPer-node badges for a canvas renderer. Reserved; nothing renders it yet

Node-type bundles

The node descriptions for n8n 2.38.3 ship in the package. Install others on demand:

workflow-lint node-types list
workflow-lint node-types install 2.36.8

Compare two installed versions:

workflow-lint node-types diff 2.36.8 2.38.3
workflow-lint node-types diff 2.36.8 2.38.3 --format md --only n8n-nodes-base.httpRequest

The diff lists nodes added, removed or hidden, new typeVersions, and property changes.