Skip to main content
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.

Basic Workflow

Define workflows using the @hy.workflow decorator and the >> operator:

Parallel Execution

Run multiple tasks in parallel using list notation:

Triggering Workflows

Use the .send() method to trigger workflow execution:
For workflows with arguments, pass the context object to .send():

Workflow Arguments

Pass typed arguments to workflows using Pydantic models:

Access Workflow Context

Tasks within a workflow can access the workflow context and other task results:

Task Configuration in Workflows

Override task configuration within workflows:

Complex Workflow Patterns

Build sophisticated DAGs with multiple parallel and sequential stages:

Next Steps

Queues

Route workflow tasks to specific workers

Monitoring

Monitor workflow execution