feat: implement comprehensive workflow validation (v2.5.0)

Major Features:
- Add ExpressionValidator for n8n expression syntax validation
- Add WorkflowValidator for complete workflow structure validation
- Add three new MCP tools: validate_workflow, validate_workflow_connections, validate_workflow_expressions

Validation Capabilities:
-  Detects workflow cycles (infinite loops)
-  Validates n8n expressions with syntax checking
-  Checks node references in expressions
-  Identifies orphaned nodes and missing connections
-  Supports multiple node type formats (n8n-nodes-base, @n8n/n8n-nodes-langchain)
-  Provides actionable error messages and suggestions

Testing & Analysis:
- Add test scripts for workflow validation
- Add template validation testing
- Add validation summary analysis tool
- Fixed expression validation false positives
- Handle node type normalization correctly

Results from testing 50 real n8n templates:
- 70.9% of errors are from informal sticky notes
- Expression validation catches real syntax issues
- Cycle detection prevents runtime infinite loops
- Successfully validates both core and LangChain nodes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-06-24 14:45:36 +02:00
parent 42a24278db
commit 533b1acc20
13 changed files with 2140 additions and 2 deletions

View File

@@ -129,6 +129,17 @@ export class TemplateRepository {
return this.getTemplatesByNodes(nodes, 10);
}
/**
* Get all templates with limit
*/
getAllTemplates(limit: number = 10): StoredTemplate[] {
return this.db.prepare(`
SELECT * FROM templates
ORDER BY views DESC, created_at DESC
LIMIT ?
`).all(limit) as StoredTemplate[];
}
/**
* Get total template count
*/