From 45e741822f3b67e400297e851202216136a5604b Mon Sep 17 00:00:00 2001 From: zhang_lu Date: Fri, 22 Nov 2024 17:47:30 +0800 Subject: [PATCH] fix start_workflow_by_name function in OrkesWorkflowClient --- .../engine/orkes/orkes_workflow_client.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/omagent-core/src/omagent_core/engine/orkes/orkes_workflow_client.py b/omagent-core/src/omagent_core/engine/orkes/orkes_workflow_client.py index a5bb33c..b89c9c0 100644 --- a/omagent-core/src/omagent_core/engine/orkes/orkes_workflow_client.py +++ b/omagent-core/src/omagent_core/engine/orkes/orkes_workflow_client.py @@ -27,18 +27,14 @@ def start_workflow_by_name( name: str, input: dict[str, object], version: Optional[int] = None, - correlationId: Optional[str] = None, - priority: Optional[int] = None, + **kwargs ) -> str: - kwargs = {} - if version: - kwargs.update({"version": version}) - if correlationId: - kwargs.update({"correlation_id": correlationId}) - if priority: - kwargs.update({"priority": priority}) - - return self.workflowResourceApi.start_workflow1(input, name, **kwargs) + start_workflow_request = StartWorkflowRequest(name=name, + version=version, + input=input, + **kwargs) + + return self.start_workflow(start_workflow_request) def start_workflow(self, start_workflow_request: StartWorkflowRequest) -> str: return self.workflowResourceApi.start_workflow(start_workflow_request)