Description
@iamfj/n8n-nodes-schema-validation
JSON Schema validation node for n8n workflows. Validate your data against JSON Schema standards with error output routing.
n8n is a fair-code licensed workflow automation platform.
โ n8n Cloud Compatible
This package has all dependencies bundled and is fully compatible with n8n Cloud.
Installation
Follow the installation guide in the n8n community nodes documentation.
Community Nodes Installation
- Go to Settings > Community Nodes in your n8n instance
- Select Install
- Enter
@iamfj/n8n-nodes-schema-validationin the search field - Click Install
Manual Installation
For self-hosted n8n instances, you can install via npm:
npm install @iamfj/n8n-nodes-schema-validation
Then restart your n8n instance.
Features
Validates JSON data against a JSON Schema using n8n's "Continue on Fail" error handling pattern.
Features:
- โ Validate incoming data against JSON Schema standards
- โ ๏ธ Error output routing with "Continue on Fail" mode
- ๐ฏ Support for custom JSON input via expressions
- ๐ Detailed validation error messages with field paths
- โก Built on AJV – fast and reliable JSON Schema validator
- ๐งช 100% test coverage with comprehensive unit tests
- ๐ฆ All dependencies bundled for n8n Cloud compatibility
Use Cases:
- Data quality checks before processing
- API response validation
- Form data validation
- ETL pipeline data verification
- Contract testing between workflows
Configuration:
- JSON Schema: Define your validation schema (JSON Schema Draft 7 format)
- Data Source: Choose between "Input Data" or "Custom JSON"
- Custom JSON: Optional field for n8n expressions (e.g.,
{{ $json.data }})
Example:
{
"type": "object",
"properties": {
"name": { "type": "string" },
"age": { "type": "number", "minimum": 0 },
"email": { "type": "string", "format": "email" }
},
"required": ["name", "email"]
}
Output:
- Default Output: Items that pass validation
- Error Output: Items that fail validation (when "Continue on Fail" is enabled)
Enable "On Error -> Continue (using error output)" in node settings to route failed validations to the error branch instead of stopping execution.
Architecture
The node is built following clean code principles with testable units:
SchemaValidator/
โโโ SchemaValidator.node.ts # Main node implementation
โโโ types.ts # TypeScript interfaces
โโโ helpers/
โโโ schemaParser.ts # Schema parsing logic
โโโ dataExtractor.ts # Data extraction logic
โโโ validator.ts # Validation logic with AJV
โโโ __tests__/ # Comprehensive unit tests
See helpers/README.md for detailed documentation.
Credentials
None of the current nodes require credentials. All operations are performed locally within your n8n instance.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
# Install dependencies
bun install
# Build the project
bun run build
# Run in development mode
bun run dev
# Run linting
bun run lint
# Format code
bun run format
# Run unit tests
bun test
# Run tests in watch mode
bun test --watch
# Run tests with coverage
bun test --coverage
Resources
License
MIT ยฉ Fabian Jocks
Issues & Support
If you encounter any issues or have questions:
Changelog
See CHANGELOG.md for version history and release notes.
Made with โค๏ธ in Ruhrgebiet for the n8n community