refactor(workflow): Remove Start node from isRequired mechanism

- Set Start node isRequired: false since entry node validation is handled by unified logic
- Remove conditional skip logic in checklist since Start is no longer in isRequiredNodesType
- Cleaner separation of concerns: unified entry node check vs individual required nodes
- Eliminates architectural inconsistency where Start was both individually required and part of group validation
This commit is contained in:
lyzno1 2025-09-26 21:09:48 +08:00
parent 08e8f8676e
commit b4801adfbd
2 changed files with 1 additions and 9 deletions

View File

@ -173,10 +173,6 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => {
const isRequiredNodesType = Object.keys(nodesExtraData!).filter((key: any) => (nodesExtraData as any)[key].metaData.isRequired)
isRequiredNodesType.forEach((type: string) => {
// Skip Start node requirement since we already check for any start/trigger nodes above
if (type === BlockEnum.Start)
return
if (!filteredNodes.find(node => node.data.type === type)) {
list.push({
id: `${type}-need-added`,
@ -340,10 +336,6 @@ export const useChecklistBeforePublish = () => {
for (let i = 0; i < isRequiredNodesType.length; i++) {
const type = isRequiredNodesType[i]
// Skip Start node requirement since we already check for any start/trigger nodes above
if (type === BlockEnum.Start)
continue
if (!filteredNodes.find(node => node.data.type === type)) {
notify({ type: 'error', message: t('workflow.common.needAdd', { node: t(`workflow.blocks.${type}`) }) })
return false

View File

@ -7,7 +7,7 @@ const metaData = genNodeMetaData({
sort: 0.1,
type: BlockEnum.Start,
isStart: true,
isRequired: true,
isRequired: false,
isSingleton: true,
isTypeFixed: true,
})