Skip to content

Engines & orchestration

Maturity labels

  • Now: Stable and supported in current releases.
  • Preview: Usable today, but behavior and APIs may evolve.
  • Planned: Not yet implemented.

Note

Status: Preview

Local engine behavior is Now. Prefect orchestration is usable and evolving.

1) What it solves

You want one task/flow definition that can run locally today and move to orchestration later.

2) The idea

Runtime engine choice controls execution backend (local or prefect) without rewriting model or flow definitions.

3) Example

>>> import omnipy as om
>>> om.runtime.config.engine.choice
>>> om.runtime.config.engine.choice = 'prefect'
>>> @om.TaskTemplate()
... def double(x: int) -> int:
...     return x * 2
>>> double.run(21)
>>> om.runtime.config.engine.choice = 'local'

4) Output / display

Inspect values with _docs() / .json() the same way regardless of engine.

5) When to use / when not

Use local for inner-loop development and deterministic docs examples.

Use orchestration when scheduling/retry/caching/operational controls matter.

6) Gotchas

  • Keep docs runnable without external services by default.
  • Engine-specific operational semantics can differ.
  • For CLI-driven runs, use omnipy-examples --engine prefect ....