Fixed critical bug where AI Agent validator never executed, missing 179 configuration errors (30% of all telemetry-identified failures).
The Bug:
- Switch case checked for '@n8n/n8n-nodes-langchain.agent' (full package format)
- But nodeType was normalized to 'nodes-langchain.agent' before reaching switch
- Result: AI Agent validator never matched, never executed
The Fix:
- Changed case to 'nodes-langchain.agent' to match normalized format
- Now correctly catches prompt configuration, maxIterations, error handling issues
Files Changed:
- src/services/enhanced-config-validator.ts:322 - Fixed nodeType format
- tests/unit/services/enhanced-config-validator.test.ts - Added validateAIAgent to mock and verification test
- CHANGELOG.md - Added bug fix section to 2.22.13 (not separate version)
Testing:
- npm test -- tests/unit/services/enhanced-config-validator.test.ts
- ✓ All 51 tests pass including new AI Agent validation test
Discovery:
Discovered by n8n-mcp-tester agent during post-deployment verification of 2.22.13 improvements. The agent attempted to validate an AI Agent node configuration and discovered the validator was never being called.
Impact:
- Without fix: 179 AI Agent configuration errors (30%) go undetected
- With fix: All AI Agent validation rules now execute correctly
Version: 2.22.13 (kept under same version as original implementation)
Concieved by Romuald Członkowski - www.aiadvisors.pl/en
Added helpful suggestions for HTTP Request node best practices after thorough investigation of issue #361.
## What's New
1. **alwaysOutputData Suggestion**
- Suggests adding alwaysOutputData: true at node level
- Prevents silent workflow failures when HTTP requests error
- Ensures downstream error handling can process failed requests
2. **responseFormat Suggestion for API Endpoints**
- Suggests setting options.response.response.responseFormat
- Prevents JSON parsing confusion
- Triggered for URLs containing /api, /rest, supabase, firebase, googleapis, .com/v
3. **Enhanced URL Protocol Validation**
- Detects missing protocol in expression-based URLs
- Warns about patterns like =www.{{ $json.domain }}.com
- Warns about expressions without protocol
## Investigation Findings
**Key Discoveries:**
- Mixed expression syntax =literal{{ expression }} actually works in n8n (claim was incorrect)
- Real validation gaps: missing alwaysOutputData and responseFormat checks
- Compared broken vs fixed workflows to identify actual production issues
**Testing Evidence:**
- Analyzed workflow SwjKJsJhe8OsYfBk with mixed syntax - executions successful
- Compared broken workflow (mBmkyj460i5rYTG4) with fixed workflow (hQI9pby3nSFtk4TV)
- Identified that fixed workflow has alwaysOutputData: true and explicit responseFormat
## Impact
- Non-Breaking: All changes are suggestions/warnings, not errors
- Actionable: Clear guidance on how to implement best practices
- Production-Focused: Addresses real workflow reliability concerns
## Test Coverage
Added 8 new test cases covering:
- alwaysOutputData suggestion for all HTTP Request nodes
- responseFormat suggestion for API endpoint detection
- responseFormat NOT suggested when already configured
- URL protocol validation for expression-based URLs
- No false positives when protocol is correctly included
## Files Changed
- src/services/enhanced-config-validator.ts - Added enhanceHttpRequestValidation()
- tests/unit/services/enhanced-config-validator.test.ts - Added 8 test cases
- CHANGELOG.md - Documented enhancement with investigation findings
- package.json - Bump version to 2.22.2
Fixes#361
Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en