Skip to content

feat: implement Schedule Trigger validation with multi-start node topology support#24134

Merged
crazywoola merged 7 commits intolanggenius:feat/triggerfrom
lyzno1:feat/schedule-trigger-validation
Aug 19, 2025
Merged

feat: implement Schedule Trigger validation with multi-start node topology support#24134
crazywoola merged 7 commits intolanggenius:feat/triggerfrom
lyzno1:feat/schedule-trigger-validation

Conversation

@lyzno1
Copy link
Copy Markdown
Member

@lyzno1 lyzno1 commented Aug 18, 2025

Summary

This PR implements comprehensive validation for the Schedule Trigger node and fixes critical workflow topology validation to support multiple start nodes (Start + all Trigger types) working in parallel.

🎯 Key Features

  • 4-Layer Progressive Validation: Basic fields → Timezone → Mode-specific → Execution time calculation
  • Multi-Start Node Support: Start and Trigger nodes can coexist as equivalent entry points
  • Complete I18n Coverage: 21 validation messages in English, Chinese, and Japanese
  • System-Level Topology Fix: Enhanced getValidTreeNodes and checklist validation

🔧 Technical Improvements

  • Timezone Validation: Using Intl.DateTimeFormat for standard validation
  • Cron Expression Support: Full cron syntax validation with execution time verification
  • Visual Configuration: Comprehensive validation for all frequency types (hourly/daily/weekly/monthly/once)
  • Cycle Prevention: Added duplicate node detection in topology traversal

🧪 Quality Assurance

  • Test Coverage: 88.55% statement coverage with 10 comprehensive test cases
  • Backward Compatibility: Zero breaking changes to existing Start node behavior
  • Project Compliance: Follows existing node validation patterns without additional complexity

🌐 Multi-Language Support

Complete localization with parameter-based error messages for better user experience.

📦 Files Changed

  • Validation Logic: trigger-schedule/default.ts - Comprehensive validation implementation
  • Topology Fix: utils/workflow.ts - Multi-start node support in getValidTreeNodes
  • Checklist Update: hooks/use-checklist.ts - Trigger node equivalence handling
  • Internationalization: Added 21 validation messages across 3 languages
  • Test Coverage: Basic validation test suite

Related: #24001

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 🌊 feat:workflow Workflow related stuff. labels Aug 18, 2025
@lyzno1 lyzno1 marked this pull request as draft August 18, 2025 14:28
lyzno1 added 2 commits August 18, 2025 22:33
- Update getValidTreeNodes to handle multiple start nodes (Start + Trigger)
- Ensure all start node types are treated as equivalent entry points
- Fix traversal logic to avoid duplicate node processing
- Support parallel workflows with different start node types
@lyzno1 lyzno1 changed the title feat: implement Schedule Trigger node validation with topology fixes feat: implement Schedule Trigger validation with multi-start node topology support Aug 18, 2025
@lyzno1 lyzno1 marked this pull request as ready for review August 19, 2025 01:07
@crazywoola crazywoola merged commit f7bb3b8 into langgenius:feat/trigger Aug 19, 2025
1 check passed
@lyzno1 lyzno1 deleted the feat/schedule-trigger-validation branch August 19, 2025 04:07
lyzno1 added a commit to lyzno1/dify that referenced this pull request Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌊 feat:workflow Workflow related stuff. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants