def ExecutionContext.submit_subtask(
  task: Task,
  depends_on: list[FutureTask] = None,
  cluster: str | None = None,
  max_retries: int = 0
) -> FutureTask

Submit a subtask from a currently executing task.

Parameters

task
Task

The task to submit as a subtask.

depends_on
list[FutureTask]

An optional list of tasks already submitted within the same context that this subtask depends on.

cluster
str

An optional cluster slug for running the subtask. If not provided, the subtask runs on the same cluster as the parent task.

max_retries
int

Specify the maximum number of retries for the subtask in case of failure. The default is 0.

Returns

A FutureTask object that represents the submitted subtask. Can be used to set up dependencies between tasks.