[PR #24886] refactor: unify trigger node architecture and clean up technical debt #30837

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

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

State: closed
Merged: Yes


Summary

Following PR #24874 webhook trigger implementation, this PR addresses architectural inconsistencies across trigger nodes and removes accumulated technical debt.

Key Changes:

  1. Standardize Chat Mode Behavior
  • Fix inconsistent behavior where Schedule and Plugin triggers returned ALL_CHAT_AVAILABLE_BLOCKS in chat mode
  • All trigger nodes now return empty array in chat mode for architectural consistency
  • Trigger nodes (external event-driven) are properly separated from chat flows (user message-driven)
  1. Remove Unused Enabled Field from Schedule Trigger
  • Remove enabled: boolean field that existed since initial implementation but was never used by backend
  • Clean up all test files and configuration references
  • Application-level enable/disable is managed by AppTrigger.status, maintaining proper architectural separation
  1. Standardize Webhook Trigger Field Naming
  • Convert string keys ('content-type', 'webhook_url') to standard dot notation (content_type, webhook_url)
  • Align with Schedule and Plugin trigger naming conventions
  • Improve TypeScript development experience with dot access and IDE completion
  • Remove Pydantic Field alias as no backward compatibility needed (feature not yet merged)

Architecture Impact:

  • Unified naming conventions across all three trigger types
  • Consistent chat mode behavior for all trigger nodes
  • Eliminated technical debt accumulated during development
  • Improved type safety and developer experience

Testing:

  • All frontend tests pass (6/6 webhook trigger tests)
  • Backend integration tests validated
  • No breaking changes as features not yet in production

This refactoring establishes a clean, consistent foundation for the trigger node system before production release.

**Original Pull Request:** https://github.com/langgenius/dify/pull/24886 **State:** closed **Merged:** Yes --- ## Summary Following PR #24874 webhook trigger implementation, this PR addresses architectural inconsistencies across trigger nodes and removes accumulated technical debt. **Key Changes:** 1. **Standardize Chat Mode Behavior** - Fix inconsistent behavior where Schedule and Plugin triggers returned ALL_CHAT_AVAILABLE_BLOCKS in chat mode - All trigger nodes now return empty array in chat mode for architectural consistency - Trigger nodes (external event-driven) are properly separated from chat flows (user message-driven) 2. **Remove Unused Enabled Field from Schedule Trigger** - Remove enabled: boolean field that existed since initial implementation but was never used by backend - Clean up all test files and configuration references - Application-level enable/disable is managed by AppTrigger.status, maintaining proper architectural separation 3. **Standardize Webhook Trigger Field Naming** - Convert string keys ('content-type', 'webhook_url') to standard dot notation (content_type, webhook_url) - Align with Schedule and Plugin trigger naming conventions - Improve TypeScript development experience with dot access and IDE completion - Remove Pydantic Field alias as no backward compatibility needed (feature not yet merged) **Architecture Impact:** - Unified naming conventions across all three trigger types - Consistent chat mode behavior for all trigger nodes - Eliminated technical debt accumulated during development - Improved type safety and developer experience **Testing:** - All frontend tests pass (6/6 webhook trigger tests) - Backend integration tests validated - No breaking changes as features not yet in production This refactoring establishes a clean, consistent foundation for the trigger node system before production release.
yindo added the pull-request label 2026-02-21 20:48:19 -05:00
yindo closed this issue 2026-02-21 20:48:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30837