diff --git a/gcloud/taskflow3/models.py b/gcloud/taskflow3/models.py index 34e08570be..a4bbbcf99f 100644 --- a/gcloud/taskflow3/models.py +++ b/gcloud/taskflow3/models.py @@ -978,6 +978,10 @@ def get_node_detail( detail = node_detail_result["data"] detail.update(node_data) + if not detail.get("id"): + # 没有 ID 说明流程尚未创建完成,直接返回,无需补充额外的配置信息 + return {"result": True, "data": detail, "message": "", "code": err_code.SUCCESS.code} + # 补充重试信息 detail["auto_retry_info"] = ( fetch_node_id__auto_retry_info_map(detail["parent_id"], [detail["id"]]).get(detail["id"]) or {} diff --git a/gcloud/tests/taskflow3/models/taskflow/test_get_node_detail.py b/gcloud/tests/taskflow3/models/taskflow/test_get_node_detail.py index 9ef3e3d82b..ac49ce9c3f 100644 --- a/gcloud/tests/taskflow3/models/taskflow/test_get_node_detail.py +++ b/gcloud/tests/taskflow3/models/taskflow/test_get_node_detail.py @@ -66,7 +66,7 @@ def test_include_data_is_false(self): taskflow.has_node = MagicMock(return_value=True) dispatcher = MagicMock() get_node_data_return = {"result": True, "data": {}} - get_node_detail_return = {"result": True, "data": {"id": "id", "parent_id": "parent_id"}} + get_node_detail_return = {"result": True, "data": {}} dispatcher.get_node_data = MagicMock(return_value=get_node_data_return) dispatcher.get_node_detail = MagicMock(return_value=get_node_detail_return) dispatcher_init = MagicMock(return_value=dispatcher) @@ -102,7 +102,7 @@ def test_include_data_is_false(self): detail, { "code": 0, - "data": {"auto_retry_info": {}, "id": "id", "parent_id": "parent_id"}, + "data": {}, "message": "", "result": True, },