From f965dcff90b2ab1c54ad4b6e3b0170add0444fd5 Mon Sep 17 00:00:00 2001 From: admin user Date: Fri, 23 May 2025 12:40:13 +0000 Subject: [PATCH] Update templates/workflow_template.py.j2 --- templates/workflow_template.py.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/workflow_template.py.j2 b/templates/workflow_template.py.j2 index 94f6345..3611eca 100644 --- a/templates/workflow_template.py.j2 +++ b/templates/workflow_template.py.j2 @@ -16,6 +16,7 @@ logger = logging.getLogger(__name__) class {{ workflow_class_name }}: @temporalio.workflow.run async def run(self, root_inputs: Dict[str, Any]) -> Dict[str, Any]: + await temporalio.workflow.sleep(0) workflow_info = temporalio.workflow.info() workflow_output: Dict[str, Any] = { "workflow_id": workflow_info.workflow_id, @@ -136,6 +137,7 @@ class {{ workflow_class_name }}: if isinstance(result, Exception): logger.error(f"Task failed with exception: {result}") workflow_output["status"] = "failed" + await temporalio.workflow.sleep(0) {%- endfor %} # Update workflow status to completed if not failed