From 6026bd873b376f9ec2cc6c8c269f5a24f120754a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Wed, 12 Nov 2025 19:27:36 +0800 Subject: [PATCH] fix: variable assigner can't assign float number (#28068) --- api/services/workflow_draft_variable_service.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/services/workflow_draft_variable_service.py b/api/services/workflow_draft_variable_service.py index 2690b55dbc..c5d1f6ab13 100644 --- a/api/services/workflow_draft_variable_service.py +++ b/api/services/workflow_draft_variable_service.py @@ -808,7 +808,11 @@ class DraftVariableSaver: # We only save conversation variable here. if selector[0] != CONVERSATION_VARIABLE_NODE_ID: continue - segment = WorkflowDraftVariable.build_segment_with_type(segment_type=item.value_type, value=item.new_value) + # Conversation variables are exposed as NUMBER in the UI even if their + # persisted type is INTEGER. Allow float updates by loosening the type + # to NUMBER here so downstream storage infers the precise subtype. + segment_type = SegmentType.NUMBER if item.value_type == SegmentType.INTEGER else item.value_type + segment = WorkflowDraftVariable.build_segment_with_type(segment_type=segment_type, value=item.new_value) draft_vars.append( WorkflowDraftVariable.new_conversation_variable( app_id=self._app_id,