dify/web/app/components/workflow/nodes/start/default.ts
lyzno1 2a1c5ff57b feat(workflow): Enable entry node deletion and fix draft sync
Complete workflow liberalization following PR #24627:

1. Remove Start node deletion restriction by removing isUndeletable property
2. Fix draft sync blocking when no Start node exists
3. Restore isWorkflowDataLoaded protection to prevent race conditions
4. Ensure all entry nodes (Start + 3 trigger types) have equal deletion rights

This allows workflows with only trigger nodes and fixes the issue where
added nodes would disappear after page refresh due to sync API blocking.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 13:54:52 +08:00

27 lines
570 B
TypeScript

import type { NodeDefault } from '../../types'
import type { StartNodeType } from './types'
import { genNodeMetaData } from '@/app/components/workflow/utils'
import { BlockEnum } from '@/app/components/workflow/types'
const metaData = genNodeMetaData({
sort: 0.1,
type: BlockEnum.Start,
isStart: true,
isRequired: true,
isSingleton: true,
isTypeFixed: true,
})
const nodeDefault: NodeDefault<StartNodeType> = {
metaData,
defaultValue: {
variables: [],
},
checkValid() {
return {
isValid: true,
}
},
}
export default nodeDefault