From b4801adfbd7af31702095eacdb64bdf7f5c57403 Mon Sep 17 00:00:00 2001 From: lyzno1 Date: Fri, 26 Sep 2025 21:09:48 +0800 Subject: [PATCH] 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 --- web/app/components/workflow/hooks/use-checklist.ts | 8 -------- web/app/components/workflow/nodes/start/default.ts | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/web/app/components/workflow/hooks/use-checklist.ts b/web/app/components/workflow/hooks/use-checklist.ts index 9d2ab4c3e3..8cfa980784 100644 --- a/web/app/components/workflow/hooks/use-checklist.ts +++ b/web/app/components/workflow/hooks/use-checklist.ts @@ -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 diff --git a/web/app/components/workflow/nodes/start/default.ts b/web/app/components/workflow/nodes/start/default.ts index d4f3557264..32244e3f0b 100644 --- a/web/app/components/workflow/nodes/start/default.ts +++ b/web/app/components/workflow/nodes/start/default.ts @@ -7,7 +7,7 @@ const metaData = genNodeMetaData({ sort: 0.1, type: BlockEnum.Start, isStart: true, - isRequired: true, + isRequired: false, isSingleton: true, isTypeFixed: true, })