From 0b9800cf696377baa4a81c29672c2cbf7ef50f18 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 30 May 2025 10:45:51 +0800 Subject: [PATCH] feat: update converstation vars after run nodes --- web/app/components/workflow/hooks/use-inspect-vars-crud.ts | 1 + .../components/workflow/nodes/_base/hooks/use-one-step-run.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow/hooks/use-inspect-vars-crud.ts b/web/app/components/workflow/hooks/use-inspect-vars-crud.ts index 8f347b9139..ef3224028a 100644 --- a/web/app/components/workflow/hooks/use-inspect-vars-crud.ts +++ b/web/app/components/workflow/hooks/use-inspect-vars-crud.ts @@ -229,6 +229,7 @@ const useInspectVarsCrud = () => { isInspectVarEdited, resetToLastRunVar, invalidateSysVarValues, + invalidateConversationVarValues, } } 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 dd3ef72f72..4360f1c8d4 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 @@ -168,6 +168,7 @@ const useOneStepRun = ({ const { appendNodeInspectVars, invalidateSysVarValues, + invalidateConversationVarValues, } = useInspectVarsCrud() const setRunResult = useCallback(async (data: NodeRunResult | null) => { doSetRunResult(data) @@ -179,8 +180,9 @@ const useOneStepRun = ({ appendNodeInspectVars(id, vars, nodes) if(isStartNode) invalidateSysVarValues() + invalidateConversationVarValues() // loop, iteration, variable assigner node can update the conversation variables, but to simple the logic(some nodes may also can update in the future), all nodes refresh. } - }, [invalidLastRun, appId, id, store, appendNodeInspectVars, isStartNode, invalidateSysVarValues]) + }, [invalidLastRun, appId, id, store, appendNodeInspectVars, isStartNode, invalidateSysVarValues, invalidateConversationVarValues]) const { handleNodeDataUpdate }: { handleNodeDataUpdate: (data: any) => void } = useNodeDataUpdate() const [canShowSingleRun, setCanShowSingleRun] = useState(false)