From 08e8f8676ef5665617f6f5b3b4b04973a5d6b926 Mon Sep 17 00:00:00 2001 From: lyzno1 Date: Fri, 26 Sep 2025 21:08:21 +0800 Subject: [PATCH] fix(workflow): Remove duplicate Start node validation - Skip Start node requirement in isRequiredNodesType loop since it's already covered by unified entry node validation - Eliminates duplicate 'User Input must be added' error when trigger nodes are present - Both useChecklist and useChecklistBeforePublish now consistently handle entry node validation - Resolves UI showing redundant validation errors for Start vs Trigger nodes --- web/app/components/workflow/hooks/use-checklist.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/app/components/workflow/hooks/use-checklist.ts b/web/app/components/workflow/hooks/use-checklist.ts index ad3cf7a6b5..9d2ab4c3e3 100644 --- a/web/app/components/workflow/hooks/use-checklist.ts +++ b/web/app/components/workflow/hooks/use-checklist.ts @@ -173,6 +173,10 @@ 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`, @@ -335,6 +339,11 @@ 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