From 3b8a806661159080509606bb471d6facce6b024c Mon Sep 17 00:00:00 2001 From: Eternity <1533512157@qq.com> Date: Tue, 17 Mar 2026 18:01:28 +0800 Subject: [PATCH] feat(workflow): expose workflow memory enable status in app share config API --- api/app/controllers/public_share_controller.py | 1 + api/app/services/workflow_service.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/api/app/controllers/public_share_controller.py b/api/app/controllers/public_share_controller.py index 19c82790..b8fec55d 100644 --- a/api/app/controllers/public_share_controller.py +++ b/api/app/controllers/public_share_controller.py @@ -661,6 +661,7 @@ async def config_query( content = { "app_type": release.app.type, "variables": workflow_service.get_start_node_variables(release.config), + "memory": workflow_service.is_memory_enable(release.config), "features": release.config.get("features") } elif release.app.type == AppType.AGENT: diff --git a/api/app/services/workflow_service.py b/api/app/services/workflow_service.py index 4e7268d3..7aca3c2f 100644 --- a/api/app/services/workflow_service.py +++ b/api/app/services/workflow_service.py @@ -868,6 +868,14 @@ class WorkflowService: return node.get("config", {}).get("variables", []) raise BusinessException("workflow config error - start node not found") + @staticmethod + def is_memory_enable(config: dict) -> bool: + nodes = config.get("nodes", []) + for node in nodes: + if node.get("type") in [NodeType.MEMORY_READ, NodeType.MEMORY_WRITE]: + return True + return False + # ==================== 依赖注入函数 ====================