npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vinicius-leveron/n8n-validator

v1.0.4

Published

Validate, auto-fix, and deploy n8n workflow JSON files - CLI and programmatic API

Readme

@vinicius-leveron/n8n-validator

Validate, auto-fix, and deploy n8n workflow JSON files.

Two modes: CLI for manual use, programmatic API for integration.

Zero external dependencies. Requires Node.js 18+.

Programmatic API

import { validateWorkflow, fixWorkflow, deployWorkflow } from '@vinicius-leveron/n8n-validator'

// Validate a workflow
const result = validateWorkflow(workflow)
console.log(result.summary) // { errors: 2, warnings: 1, verdict: 'FAIL' }

// Auto-fix issues
if (result.summary.errors > 0) {
  const { workflow: fixed, changelog } = fixWorkflow(workflow, result)
  console.log(`Fixed ${changelog.length} issues`)

  // Deploy to n8n
  const deployResult = await deployWorkflow(
    'https://n8n.example.com',
    'YOUR_API_KEY',
    fixed
  )
}

API Reference

| Function | Description | |----------|-------------| | validateWorkflow(workflow) | Returns { issues, summary, workflow, credentialSummary } | | fixWorkflow(workflow, result) | Returns { workflow, changelog } | | deployWorkflow(url, apiKey, workflow) | Returns { success, message } | | SEVERITY | Enum: ERROR, WARNING, INFO |

CLI Installation

# Run directly with npx (no install needed)
npx @vinicius-leveron/n8n-validator --help

# Or install globally
npm install -g @vinicius-leveron/n8n-validator
n8n-validator --help

Usage

Validate workflows from n8n instance

npx @vinicius-leveron/n8n-validator --url https://n8n.example.com --api-key YOUR_KEY

Validate + auto-fix

npx @vinicius-leveron/n8n-validator --url https://n8n.example.com --api-key KEY --fix --output-dir ./fixed/

Validate + auto-fix + deploy back to n8n

npx @vinicius-leveron/n8n-validator --url https://n8n.example.com --api-key KEY --fix --deploy

Validate local files

# Single file
npx @vinicius-leveron/n8n-validator --file workflow.json

# Directory
npx @vinicius-leveron/n8n-validator --dir ./workflows/

Options

| Option | Short | Description | |--------|-------|-------------| | --url | -u | n8n instance URL | | --api-key | -k | n8n API key | | --file | -f | Path to workflow JSON file | | --dir | -d | Directory with workflow JSON files | | --fix | | Auto-fix safe issues | | --deploy | | Deploy fixed workflows back to n8n | | --dry-run | | Preview deploy without executing | | --output-dir | | Save fixed workflows to directory | | --json | -j | Output as JSON | | --severity | -s | Filter: all, error, warning | | --output | -o | Write report to file | | --help | -h | Show help |

Validation Rules

Structure (STRUCT)

  • Required fields validation
  • Node types and positions
  • Duplicate node names
  • Trigger configuration

Expressions (EXPR)

  • ={{ }} syntax validation
  • Node references
  • Code node anti-patterns
  • Dot notation for names with spaces

Connections (CONN)

  • Orphan nodes detection
  • Circular references
  • Webhook/RespondToWebhook pairing

Credentials (CRED)

  • Missing credentials
  • Hardcoded secrets detection
  • Webhook authentication
  • API keys in URLs

Best Practices (BEST)

  • Error handling
  • Deprecated nodes
  • Workflow size limits
  • SplitInBatches loops

Auto-Fix Rules

| Rule | Description | |------|-------------| | FIX-EXPR-001 | Remove ={{ }} inside Code nodes | | FIX-EXPR-003 | Fix trailing dots in expressions | | FIX-EXPR-020 | Fix $node.Name for names with spaces | | FIX-EXPR-030 | Fix single braces ={}={{}} | | FIX-STRUCT-030 | Add settings.executionOrder = "v1" | | FIX-STRUCT-031 | Add missing meta object | | FIX-BEST-010 | Upgrade deprecated nodes | | FIX-CONN-001 | Remove ghost connections | | FIX-CONN-011 | Remove connections to non-existent targets | | FIX-CONN-040 | Fix webhook responseMode |

Exit Codes

| Code | Meaning | |------|---------| | 0 | Success (no errors or all fixed) | | 1 | Validation errors remain | | 2 | Fatal error |

License

MIT