From afd0743178aa7fd170136366dbcd91a520fbbfe1 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Tue, 7 Apr 2026 14:50:52 +0800 Subject: [PATCH] fix: [Tool] After importing the workflow tool, it should be in an inactive state --- apps/tools/serializers/tool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/tools/serializers/tool.py b/apps/tools/serializers/tool.py index aca5bf05cdb..d7bd2592004 100644 --- a/apps/tools/serializers/tool.py +++ b/apps/tools/serializers/tool.py @@ -788,7 +788,8 @@ def to_tool(tool, workspace_id, user_id, folder_id): template_id=tool.get('template_id'), input_field_list=tool.get('input_field_list'), init_field_list=tool.get('init_field_list'), - is_active=False if len((tool.get('init_field_list') or [])) > 0 else tool.get('is_active'), + is_active=False if (len((tool.get('init_field_list') or [])) > 0 or tool.get( + 'tool_type') == ToolType.WORKFLOW) else tool.get('is_active'), tool_type=tool.get('tool_type', 'CUSTOM') or 'CUSTOM', scope=ToolScope.SHARED if workspace_id == 'None' else ToolScope.WORKSPACE, folder_id=folder_id if folder_id else 'default' if workspace_id == 'None' else workspace_id,