Update templates/workflow_template.py.j2
All checks were successful
CI Workflow / Testing the Flow (push) Successful in 10s
CI Workflow / Containerize the Flow (push) Successful in 16s

This commit is contained in:
admin user 2025-05-23 02:03:18 +00:00
parent 2e1d2795c8
commit 2c55ab4ad8

View File

@ -6,7 +6,7 @@ import json
import datetime import datetime
import re import re
import jmespath import jmespath
from temporalio import workflow from temporalio.workflow import sleep
# Configure logging # Configure logging
logging.basicConfig(level=logging.INFO, logging.basicConfig(level=logging.INFO,
@ -17,7 +17,7 @@ logger = logging.getLogger(__name__)
class {{ workflow_class_name }}: class {{ workflow_class_name }}:
@temporalio.workflow.run @temporalio.workflow.run
async def run(self, root_inputs: Dict[str, Any]) -> Dict[str, Any]: async def run(self, root_inputs: Dict[str, Any]) -> Dict[str, Any]:
await workflow.sleep(0) await sleep(0)
workflow_info = temporalio.workflow.info() workflow_info = temporalio.workflow.info()
workflow_output: Dict[str, Any] = { workflow_output: Dict[str, Any] = {
"workflow_id": workflow_info.workflow_id, "workflow_id": workflow_info.workflow_id,