dify/web/app/components/workflow/nodes/trigger-plugin/default.ts
lyzno1 60c86dd8d1 fix(workflow): replace hardcoded trigger node logic with metadata-driven approach
- Add isStart: true to all trigger nodes (TriggerWebhook, TriggerSchedule, TriggerPlugin)
- Replace hardcoded BlockEnum checks in use-checklist.ts with metadata-driven logic
- Update trigger node tests to validate metadata instead of obsolete methods
- Add webhook URL validation to TriggerWebhook node
- Ensure backward compatibility with existing workflow configurations

This change migrates from hardcoded trigger node identification to a
centralized metadata-driven approach, improving maintainability and
consistency across the workflow system.
2025-09-26 22:35:21 +08:00

29 lines
616 B
TypeScript

import { BlockEnum } from '../../types'
import type { NodeDefault } from '../../types'
import { genNodeMetaData } from '../../utils'
import type { PluginTriggerNodeType } from './types'
const metaData = genNodeMetaData({
sort: 1,
type: BlockEnum.TriggerPlugin,
isStart: true,
})
const nodeDefault: NodeDefault<PluginTriggerNodeType> = {
metaData,
defaultValue: {
plugin_id: '',
trigger_name: '',
// event_type: '',
config: {},
},
checkValid(_payload: PluginTriggerNodeType, _t: any) {
return {
isValid: true,
errorMessage: '',
}
},
}
export default nodeDefault