Registry / workflow / hera-workflows

hera-workflows

JSON →
library6.0.0pypypi✓ verified 84d ago

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-workflows
INSTALL
IMPORT
SIG · HERA-WORKFLOWS
H
hera-workflows
workflowpythonv6.0.0
Install
4.1s avg
Import
2741ms
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v6.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 2.872s · 35.4MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 4.1s · import 2.609s · 35MB
34MB installed
● package 34MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Workflow
from hera.workflows import Workflow
Task
from hera.workflows import Task
Parameter
from hera.workflows import Parameter
Artifact
from hera.workflows import Artifact
script
from hera.shared import script
from hera.workflows import script
The `script` utility moved to `hera.shared` in v5.x, often confused with `hera.workflows`.

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.

import os from hera.workflows import Workflow, Task, Parameter from hera.shared import global_config # Configure Hera to connect to Argo Workflows (adjust as needed) # For local testing, ensure ARGO_SERVER and ARGO_TOKEN are set, # or modify client configuration directly. global_config.host = os.environ.get('ARGO_SERVER', 'http://localhost:2746') global_config.token = os.environ.get('ARGO_TOKEN', '') global_config.verify_ssl = False # Set to True in production def my_task_func(name: str): print(f"Hello, {name} from Hera!") with Workflow(generate_name="my-first-hera-workflow-", entrypoint="my-entrypoint") as w: my_task = Task( name="my-entrypoint", inputs=[Parameter(name="message", default="World")], func=my_task_func, arguments=["{{inputs.parameters.message}}"] ) w.submit()
Debug
Known issues
breakingHera Workflows v6.0.0 has removed the decorator feature (e.g., `@workflow`, `@task`). Workflows and tasks must now be defined by directly instantiating the `Workflow` and `Task` classes.
fix
Migrate from `@task` to `Task(func=my_func, ...)` and from `@workflow` to `with Workflow(...) as w:`.
affects: >=6.0.0
breakingHera Workflows v6.0.0 has migrated its core models away from Pydantic V1 to Python dataclasses, and now requires Pydantic V2 for any remaining Pydantic integrations. Code relying on Pydantic V1 behavior or direct manipulation of Hera models as Pydantic V1 objects will break.
fix
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`.
affects: >=6.0.0
breakingSupport for Python 3.9 was removed in Hera Workflows v5.27.0.
fix
Upgrade your Python environment to 3.10 or higher. The minimum supported version is 3.10.
affects: >=5.27.0
gotchaSubmitting a workflow requires access to an Argo Workflows API server. Configuration is typically handled via `hera.shared.global_config` or by passing a `hera.workflows.service.Services` instance to the `Workflow` constructor. Incorrect configuration leads to connection errors.
fix
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.
affects: all
gotchaThe `script` helper function, used for wrapping Python functions to run as Argo script templates, moved from `hera.workflows` to `hera.shared` in Hera Workflows v5.x.
fix
Update imports from `from hera.workflows import script` to `from hera.shared import script`.
affects: >=5.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pydantic.v1'
Upgrading to Hera Workflows v6.0.0+ without updating Pydantic or having other libraries that still implicitly require Pydantic v1. Hera v6+ requires Pydantic v2.
fix
Ensure Pydantic v2 is installed (`pip install 'pydantic>=2'`) and check for other dependencies that might be pinning Pydantic v1.
TypeError: 'function' object is not callable
Attempting to use `@workflow` or `@task` decorators after upgrading to Hera Workflows v6.0.0, where they have been removed.
fix
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:`.
AttributeError: type object 'Field' has no attribute 'Required'
This typically indicates a mismatch between Pydantic v1 and v2 usage, often when Hera v6+ is used with existing code expecting Pydantic v1 Field behavior.
fix
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.
ERROR: Package 'hera-workflows' requires a different Python version: <4, >=3.10 but your Python version is X.Y
Attempting to install or run Hera Workflows v5.27.0+ on an unsupported Python version (e.g., Python 3.9).
fix
Upgrade your Python environment to 3.10 or higher. Hera Workflows v5.27.0+ requires Python >=3.10.
Upgrade
Version history
6.0.0latest on PyPI · released Mar 19, 2026
Audit
Dependencies
pydanticrequiredHera Workflows v6.0.0+ requires Pydantic v2. Previous versions used Pydantic v1.
argo-workflows-clientrequiredUsed for interacting with the Argo Workflows API to submit and manage workflows.
Agent activity
18 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
hera-workflows — pip install hera-workflows · libregistry