diff --git a/web/app/components/workflow/nodes/variable-assigner/components/node-variable-item.tsx b/web/app/components/workflow/nodes/variable-assigner/components/node-variable-item.tsx index 81286e21f8..b4fc76d548 100644 --- a/web/app/components/workflow/nodes/variable-assigner/components/node-variable-item.tsx +++ b/web/app/components/workflow/nodes/variable-assigner/components/node-variable-item.tsx @@ -38,7 +38,13 @@ const NodeVariableItem = ({ const isEnv = isENV(variable) const isChatVar = isConversationVar(variable) const isRagVar = isRagVariableVar(variable) - const varName = isSystem ? `sys.${variable[variable.length - 1]}` : variable.slice(1).join('.') + const varName = useMemo(() => { + if(isSystem) + return `sys.${variable[variable.length - 1]}` + if(isRagVar) + return variable[variable.length - 1] + return variable.slice(1).join('.') + }, [isRagVar, isSystem, variable]) const VariableIcon = useMemo(() => { if (isEnv) {