Skip to main content

Hera

Hera mascot Hera is the go-to Python SDK to make Argo Workflows simple and intuitive. Easily turn Python functions into containerised templates that run on Kubernetes, with full access to its capabilities.

See the Quick Start guide to start using Hera to orchestrate your Argo Workflows!

The Argo was constructed by the shipwright Argus,
and its crew were specially protected by the goddess Hera.

PyPI stats

PyPI Versions

Downloads Downloads/month Downloads/week

Repo information

License: Apache-2.0 CICD Docs codecov

Hera at a glance

from hera.workflows import DAG, Workflow, script


# Turn a function into a reusable "Script template"
# using the script decorator
@script()
def echo(message: str):
    print(message)


# Orchestration logic lives *outside* of business logic
with Workflow(
    generate_name="dag-diamond-",
    entrypoint="diamond",
) as w:
    with DAG(name="diamond"):
        A = echo(name="A", arguments={"message": "A"})
        B = echo(name="B", arguments={"message": "B"})
        C = echo(name="C", arguments={"message": "C"})
        D = echo(name="D", arguments={"message": "D"})
        A >> [B, C] >> D  # Define execution order

# Create the workflow directly on your Argo Workflows cluster!
w.create()

Check out the Walkthrough to learn how to construct and submit Argo Workflows with Hera!

Requirements

Hera requires an Argo Workflows server to be deployed to a Kubernetes cluster. To learn how to deploy Argo to your own Kubernetes cluster you can follow the Argo Workflows guide!

Authenticating in Hera

Hera assumes that the Argo server sits behind an authentication layer, so workflow submission requests are authenticated using a Bearer token on the request. Another option for workflow submission without the authentication layer is using port forwarding to your Argo server deployment and submitting workflows to localhost:2746.

There are a few ways to authenticate in Hera - read more in the authentication walkthrough - for now, with the argo cli tool installed, and the server port-forwarded to localhost:2746, this example will get you up and running:

from hera.workflows import Workflow, Container
from hera.shared import global_config
from hera.auth import ArgoCLITokenGenerator

global_config.host = "http://localhost:2746"
global_config.token = ArgoCLITokenGenerator

with Workflow(generate_name="local-test-", entrypoint="c") as w:
    Container(name="c", image="docker/whalesay", command=["cowsay", "hello"])

w.create()

Installation

Source Command
PyPI pip install hera
GitHub repo python -m pip install git+https://github.com/argoproj-labs/hera --ignore-installed

Optional dependencies

yaml

  • Install via hera[yaml]
  • PyYAML is required for the yaml output format, which is accessible via hera.workflows.Workflow.to_yaml(*args, **kwargs). This enables GitOps practices and easier debugging.

cli

  • Install via hera[cli]. The [cli] option installs the extra dependencies including Cappa which is required for the CLI
  • The CLI aims to enable GitOps practices, easier onboarding to Hera, and a more seamless experience with Argo Workflows.
  • It currently supports converting workflows between YAML and Python source codes. See hera generate yaml --help, and hera generate python --help for more information.
  • The CLI is an experimental feature and subject to change!

async-client

  • Install via hera[async-client]. The [async-client] option installs httpx to allow the use of the async_* Workflow functions through the AsyncWorkflowsService.

Presentations

More presentations

Blogs

More blogs

Contributing

Use one of the following to open the repo in a cloud dev box:

Open in GitHub Codespaces Open in Gitpod

Read more in the contributing guide!

Hera Emeritus Maintainers

These emeritus maintainers dedicated a part of their career to Hera and reviewed code, triaged bugs and pushed the project forward over a substantial period of time. Their contribution is greatly appreciated:

License

Hera is licensed under Apache 2.0. See License for details.

Metadata

Release files for hera 7.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hera 7.2.0
File Size Uploaded Provenance Actions
hera-7.2.0.tar.gz 308.1 kB Without provenance Details for hera-7.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hera 7.2.0
File Interpreter ABI Platform Actions
hera-7.2.0-py3-none-any.whl Python 3 none any Details for hera-7.2.0-py3-none-any.whl

Total release size: 666.1 kB

Release files / hera-7.2.0.tar.gz

Download URL hera-7.2.0.tar.gz
Size 308.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3a25d57911afd17776061595d5c7e14ae9a6e3779f69f728649ec846ae86d739
BLAKE2b-256 checksum
How to use checksums
93a6dfc9152440deb6416f6136e809040c3b275abcfac3f86ebecb746746c694
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / hera-7.2.0-py3-none-any.whl

Download URL hera-7.2.0-py3-none-any.whl
Size 358.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bd64252f2295938b230c28d2cc26e6ba04f49eb9a67b6d3d075667cde24ee91
BLAKE2b-256 checksum
How to use checksums
d00044e7fd32125ce46c792a97492e8e6e180eb0eca4cbe9a1aff175b2f4b259
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for hera 7.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

7.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page