Skip to content

Running flows

Maturity labels

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

Note

Status: Now

Run with local engine defaults

>>> import omnipy as om
>>> @om.TaskTemplate()
... def plus_one(number: int) -> int:
...     return number + 1
>>> @om.LinearFlowTemplate(plus_one, plus_one, plus_one)
... def plus_three(number: int) -> int:
...     ...
>>> plus_three.run(10)

Create a runnable job via .apply()

>>> import omnipy as om
>>> @om.TaskTemplate()
... def plus_one(number: int) -> int:
...     return number + 1
>>> @om.LinearFlowTemplate(plus_one, plus_one, plus_one)
... def plus_three(number: int) -> int:
...     ...
>>> flow_job = plus_three.apply()
>>> flow_job(10)

Async note

Note

Some task/flow contexts support async usage.

Try it in a notebook

For async exploration, run in Jupyter where await is convenient.