Update templates/workflow_template.py.j2
Some checks failed
CI Workflow / Containerize the Flow (push) Has been cancelled
CI Workflow / Testing the Flow (push) Has been cancelled

This commit is contained in:
admin user 2025-05-23 12:40:13 +00:00
parent d406551d81
commit f965dcff90

View File

@ -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