from hyrex import get_hyrex_workflow_context@hy.taskdef workflow_monitor(): context = get_hyrex_workflow_context() if context: print(f"Workflow Run ID: {context.workflow_run_id}") # Check other task statuses for task_name, durable_run in context.durable_runs.items(): durable_run.refresh() for run in durable_run.task_runs: print(f"{task_name}: {run.status} (attempt {run.attempt_number})") if run.status == "failed": print(f" Error: {run.error}") elif run.status == "completed": print(f" Result: {run.result}")