[PR #24016] feat: implement trigger node frontend foundation #30474

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

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

State: closed
Merged: No


Related Issue

Relates to #23981

Changes

This PR implements the frontend foundation for the Dify Trigger system, providing a complete framework for trigger-based workflows.

Node Type System

  • Added TriggerSchedule, TriggerWebhook, and TriggerPlugin node types to BlockEnum
  • Created isTriggerNode() utility function for type checking
  • Updated workflow type definitions to support trigger nodes

Workflow Entry Point Abstraction

  • Created getWorkflowEntryNode() function to abstract workflow entry points
  • Added isTriggerWorkflow() and isWorkflowEntryNode() utility functions
  • Updated workflow traversal logic in use-workflow.ts to support trigger nodes as entry points
  • Maintains backward compatibility with existing start node workflows

Trigger Node Components

  • Implemented complete node architecture following existing patterns:
    • node.tsx components for workflow canvas display
    • panel.tsx components for configuration panels
    • types.ts for TypeScript definitions
    • default.ts for default values and validation logic
  • Created three distinct trigger node implementations:
    • Schedule Trigger: Time-based workflow triggers
    • Webhook Trigger: HTTP callback triggers
    • Plugin Trigger: Third-party platform integration triggers

System Integration

  • Added trigger nodes to NODES_EXTRA_DATA and NODES_INITIAL_DATA configurations
  • Registered node components in NodeComponentMap and PanelComponentMap
  • Integrated trigger nodes into block selector for node creation
  • Updated workflow constants and type definitions

Internationalization

  • Added comprehensive translation support for trigger nodes
  • Created translations for workflow.blocks, workflow.blocksAbout, and workflow.nodes sections
  • Implemented proper i18n patterns using i18nPrefix following existing conventions
  • Supports dynamic translation loading for node titles and descriptions

Architecture Highlights

  • Follows existing Dify node patterns and conventions
  • Maintains type safety with comprehensive TypeScript definitions
  • Supports extensible trigger node system for future trigger types
  • Provides foundation for backend trigger functionality integration

Testing

  • All existing workflows continue to function normally
  • Trigger nodes can be added to workflow canvas
  • Node configuration panels open and display correctly
  • Translation system works across all supported languages
  • Type definitions compile without errors
**Original Pull Request:** https://github.com/langgenius/dify/pull/24016 **State:** closed **Merged:** No --- ## Related Issue Relates to #23981 ## Changes This PR implements the frontend foundation for the Dify Trigger system, providing a complete framework for trigger-based workflows. ### Node Type System - Added `TriggerSchedule`, `TriggerWebhook`, and `TriggerPlugin` node types to BlockEnum - Created `isTriggerNode()` utility function for type checking - Updated workflow type definitions to support trigger nodes ### Workflow Entry Point Abstraction - Created `getWorkflowEntryNode()` function to abstract workflow entry points - Added `isTriggerWorkflow()` and `isWorkflowEntryNode()` utility functions - Updated workflow traversal logic in `use-workflow.ts` to support trigger nodes as entry points - Maintains backward compatibility with existing start node workflows ### Trigger Node Components - Implemented complete node architecture following existing patterns: - `node.tsx` components for workflow canvas display - `panel.tsx` components for configuration panels - `types.ts` for TypeScript definitions - `default.ts` for default values and validation logic - Created three distinct trigger node implementations: - Schedule Trigger: Time-based workflow triggers - Webhook Trigger: HTTP callback triggers - Plugin Trigger: Third-party platform integration triggers ### System Integration - Added trigger nodes to `NODES_EXTRA_DATA` and `NODES_INITIAL_DATA` configurations - Registered node components in `NodeComponentMap` and `PanelComponentMap` - Integrated trigger nodes into block selector for node creation - Updated workflow constants and type definitions ### Internationalization - Added comprehensive translation support for trigger nodes - Created translations for `workflow.blocks`, `workflow.blocksAbout`, and `workflow.nodes` sections - Implemented proper i18n patterns using `i18nPrefix` following existing conventions - Supports dynamic translation loading for node titles and descriptions ### Architecture Highlights - Follows existing Dify node patterns and conventions - Maintains type safety with comprehensive TypeScript definitions - Supports extensible trigger node system for future trigger types - Provides foundation for backend trigger functionality integration ## Testing - All existing workflows continue to function normally - Trigger nodes can be added to workflow canvas - Node configuration panels open and display correctly - Translation system works across all supported languages - Type definitions compile without errors
yindo added the pull-request label 2026-02-21 20:47:34 -05:00
yindo closed this issue 2026-02-21 20:47:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30474