Skip to main content
Initialize a direct runner from task classes. For new Python workflow projects, define a reusable Runner object and call Runner.connect_to when you want direct execution. The Client.runner method remains available for existing code and simple direct runner scripts.

Parameters

str | None
The cluster slug for the cluster associated with this direct runner. If not provided, the default cluster is used.
list[type[Task]] | None
A list of task classes that this runner can execute. Pass either tasks, cache, and context, or pass a reusable runner object.
JobCache
An optional job cache for caching results from tasks and sharing data between tasks.
type[RunnerContext] | None
Optional runner context class to instantiate for task execution.
Runner | None
A reusable runner definition. If provided, do not also pass tasks, cache, or context.