Workflows in Hyrex allow you to orchestrate multiple tasks into complex directed acyclic graphs (DAGs). Tasks can run in sequence or parallel, with automatic dependency management.
Tasks within a workflow can access the workflow context and other task results:
Copy
Ask AI
from hyrex import get_hyrex_workflow_context@hy.taskdef validate_extraction(): context = get_hyrex_workflow_context() if context: # Access workflow arguments if context.workflow_args: config = ETLConfig(**context.workflow_args) print(f"Validating extraction for {config.source_table}") # Access other task results by task name extract_run = context.durable_runs.get("extract_with_config") if extract_run: # Refresh to get latest status extract_run.refresh() # Check task runs for run in extract_run.task_runs: if run.status == "completed": print(f"Extract result: {run.result}") return {"validation": "passed"}