From a264a609dbd9a3df4ad2a6152947b43912d5a865 Mon Sep 17 00:00:00 2001 From: zhsama Date: Wed, 29 Oct 2025 00:36:48 +0800 Subject: [PATCH] feat(workflow): integrate workflow run validation before execution --- .../components/workflow-panel/last-run/use-last-run.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/use-last-run.ts b/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/use-last-run.ts index 665d203098..e5f2081509 100644 --- a/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/use-last-run.ts +++ b/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/use-last-run.ts @@ -30,6 +30,7 @@ import { BlockEnum } from '@/app/components/workflow/types' import { useNodesSyncDraft, } from '@/app/components/workflow/hooks' +import { useWorkflowRunValidation } from '@/app/components/workflow/hooks/use-checklist' import useInspectVarsCrud from '@/app/components/workflow/hooks/use-inspect-vars-crud' import { useInvalidLastRun } from '@/service/use-workflow' import { useStore, useWorkflowStore } from '@/app/components/workflow/store' @@ -145,6 +146,8 @@ const useLastRun = ({ isRunAfterSingleRun, }) + const { validateBeforeRun } = useWorkflowRunValidation() + const { hideSingleRun, handleRun: doCallRunApi, @@ -217,6 +220,8 @@ const useLastRun = ({ const invalidLastRun = useInvalidLastRun(flowType, flowId, id) const handleRunWithParams = async (data: Record) => { + if (!validateBeforeRun()) + return const { isValid } = checkValid() if (!isValid) return @@ -315,6 +320,8 @@ const useLastRun = ({ } const handleSingleRun = () => { + if (!validateBeforeRun()) + return const { isValid } = checkValid() if (!isValid) return