Hera Workflows is a Python library that simplifies the orchestration of Python code on Argo Workflows. It allows users to define, construct, and submit complex workflows entirely in Python, abstracting away much of the underlying YAML complexity. The current version is 6.0.0, and the project maintains an active release cadence with frequent updates.
pip install hera-workflowsVerified import paths — ran on the pinned version, not inferred.
This example demonstrates a basic Hera workflow with a single task that prints a greeting. It shows how to define a Python function as a task, configure it with parameters, and submit the workflow to an Argo Workflows instance. Ensure `ARGO_SERVER` and `ARGO_TOKEN` environment variables are set for a remote Argo server, or configure `global_config.host` appropriately for local development.
Migrate from `@task` to `Task(func=my_func, ...)` and from `@workflow` to `with Workflow(...) as w:`.
Ensure Pydantic V2 is installed (`pip install pydantic>=2`). Review any custom Pydantic models interacting with Hera components for Pydantic V1-specific API usage. Hera's internal models are now `dataclasses`.
Upgrade your Python environment to 3.10 or higher. The minimum supported version is 3.10.
Set `ARGO_SERVER` and `ARGO_TOKEN` environment variables, or explicitly configure `hera.shared.global_config.host` and `token`. Ensure network connectivity to the Argo server.
Update imports from `from hera.workflows import script` to `from hera.shared import script`.
Ensure Pydantic v2 is installed (`pip install 'pydantic>=2'`) and check for other dependencies that might be pinning Pydantic v1.
Remove the decorators and instantiate `Workflow` and `Task` classes directly. For example, replace `@task` with `Task(func=your_function, ...)`, and `@workflow` with `with Workflow(...) as w:`.
This error means Pydantic V1 is being used where Pydantic V2 is expected or vice-versa. Ensure all Pydantic-related code (including third-party libraries) is compatible with the version Hera (V2) expects. Hera's core models are now dataclasses, so this is usually in user-defined I/O models.
Upgrade your Python environment to 3.10 or higher. Hera Workflows v5.27.0+ requires Python >=3.10.