[PR #24134] feat: implement Schedule Trigger validation with multi-start node topology support #30523

Closed
opened 2026-02-21 20:47:39 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/24134

State: closed
Merged: Yes


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

**Original Pull Request:** https://github.com/langgenius/dify/pull/24134 **State:** closed **Merged:** Yes --- ## 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
yindo added the pull-request label 2026-02-21 20:47:39 -05:00
yindo closed this issue 2026-02-21 20:47:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30523