mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-03-20 01:13:07 +00:00
feat(validator): detect broken/malformed workflow connections (#620)
Add comprehensive connection validation: unknown output keys with fix suggestions, invalid type field detection, output/input index bounds checking, and BFS-based trigger reachability analysis replacing simple orphan detection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1067,7 +1067,7 @@ describe('WorkflowValidator - Comprehensive Tests', () => {
|
||||
|
||||
const result = await validator.validateWorkflow(workflow as any);
|
||||
|
||||
expect(result.warnings.some(w => w.message.includes('Node is not connected to any other nodes') && w.nodeName === 'Orphaned')).toBe(true);
|
||||
expect(result.warnings.some(w => w.message.includes('not reachable from any trigger node') && w.nodeName === 'Orphaned')).toBe(true);
|
||||
});
|
||||
|
||||
it('should detect cycles in workflow', async () => {
|
||||
@@ -1987,7 +1987,7 @@ describe('WorkflowValidator - Comprehensive Tests', () => {
|
||||
|
||||
// Warnings
|
||||
expect(result.warnings.some(w => w.message.includes('Connection to disabled node'))).toBe(true);
|
||||
expect(result.warnings.some(w => w.message.includes('Node is not connected') && w.nodeName === 'Orphaned')).toBe(true);
|
||||
expect(result.warnings.some(w => w.message.includes('not reachable from any trigger node') && w.nodeName === 'Orphaned')).toBe(true);
|
||||
expect(result.warnings.some(w => w.message.includes('AI Agent has no tools connected'))).toBe(true);
|
||||
|
||||
// Statistics
|
||||
|
||||
Reference in New Issue
Block a user