From df0fe49fcc1f0c98d3b52984d03944ae5c6bf4cc Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 3 Sep 2025 14:27:44 +0800 Subject: [PATCH] fix: one step run schema type file not support --- .../nodes/_base/hooks/use-one-step-run.ts | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts b/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts index 4970d99c40..46a5a82839 100644 --- a/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts +++ b/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts @@ -52,6 +52,7 @@ import { import { useInvalidLastRun } from '@/service/use-workflow' import useInspectVarsCrud from '../../../hooks/use-inspect-vars-crud' import type { FlowType } from '@/types/common' +import useMatchSchemaType from '../components/variable/use-match-schema-type' // eslint-disable-next-line ts/no-unsafe-function-type const checkValidFns: Record = { [BlockEnum.LLM]: checkLLMValid, @@ -130,21 +131,26 @@ const useOneStepRun = ({ const availableNodes = getBeforeNodesInSameBranch(id) const availableNodesIncludeParent = getBeforeNodesInSameBranchIncludeParent(id) - const buildInTools = useStore(s => s.buildInTools) - const customTools = useStore(s => s.customTools) - const workflowTools = useStore(s => s.workflowTools) - const mcpTools = useStore(s => s.mcpTools) - const dataSourceList = useStore(s => s.dataSourceList) - const allPluginInfoList = { - buildInTools, - customTools, - workflowTools, - mcpTools, - dataSourceList: dataSourceList ?? [], - } - const allOutputVars = toNodeOutputVars(availableNodes, isChatMode, undefined, undefined, conversationVariables, [], allPluginInfoList) + const workflowStore = useWorkflowStore() + const { schemaTypeDefinitions } = useMatchSchemaType() const getVar = (valueSelector: ValueSelector): Var | undefined => { const isSystem = valueSelector[0] === 'sys' + const { + buildInTools, + customTools, + workflowTools, + mcpTools, + dataSourceList, + } = workflowStore.getState() + const allPluginInfoList = { + buildInTools, + customTools, + workflowTools, + mcpTools, + dataSourceList: dataSourceList ?? [], + } + + const allOutputVars = toNodeOutputVars(availableNodes, isChatMode, undefined, undefined, conversationVariables, [], allPluginInfoList, schemaTypeDefinitions) const targetVar = allOutputVars.find(item => isSystem ? !!item.isStartNode : item.nodeId === valueSelector[0]) if (!targetVar) return undefined @@ -181,7 +187,6 @@ const useOneStepRun = ({ const loopTimes = loopInputKey ? runInputData[loopInputKey]?.length : 0 const store = useStoreApi() - const workflowStore = useWorkflowStore() const { setShowSingleRunPanel, } = workflowStore.getState()