diff --git a/src/backend/base/langflow/api/v1/endpoints.py b/src/backend/base/langflow/api/v1/endpoints.py index 0bae49041cfb..46a7460085ad 100644 --- a/src/backend/base/langflow/api/v1/endpoints.py +++ b/src/backend/base/langflow/api/v1/endpoints.py @@ -720,6 +720,7 @@ async def custom_component_update( user_id=user.id, ) + template_data = code_request.model_dump().get("template", {}).copy() component_node["tool_mode"] = code_request.tool_mode if hasattr(cc_instance, "set_attributes"): @@ -751,7 +752,6 @@ async def custom_component_update( # Preserve previous field values by merging filtered template data into # the component node's template. Only include entries where the value # is a dictionary containing the key "value". - template_data = code_request.model_dump().get("template", {}) filtered_data = {k: v for k, v in template_data.items() if isinstance(v, dict) and "value" in v} component_node["template"] |= filtered_data