Ginkgo¶
Overview¶
Ginkgo is a Python-native way to write scientific workflows. You write each step as a normal Python function, and Ginkgo runs them as a graph, handling parallelism, caching, and a record of what ran. Calling a task doesn’t run it — it returns a deferred expression, so Ginkgo can build and check the whole graph before anything executes. Because that graph is built from ordinary Python, it can change shape while it runs: a task can look at its inputs and add new steps, which is how Ginkgo handles dynamic DAGs. You get all of this without rewriting your code into a separate workflow language.
New to Ginkgo? Read Why Ginkgo for the motivation, or jump straight to the Quickstart.
Dynamic
Build workflows that can expand at runtime when task results determine what should happen next.
Pythonic
Author workflows in ordinary Python with @flow, @task(), and explicit typed task boundaries.
Reproducible
Reuse prior work through content-addressed caching and run shell steps in declared environments.
Agent-friendly
Inspect runs, logs, artifacts, and workflow structure through the CLI and run records.
A Minimal Workflow¶
from ginkgo import flow, task
@task()
def write_text(message: str, output_path: str) -> str:
with open(output_path, "w", encoding="utf-8") as f:
f.write(message)
return output_path
@flow
def main():
return write_text(message="hello from ginkgo", output_path="hello.txt")
Run it with:
ginkgo run workflow.py