| title | Context.submit_subtask |
|---|---|
| icon | folder-gear |
def ExecutionContext.submit_subtask(
task: Task,
depends_on: list[FutureTask] = None,
cluster: str | None = None,
max_retries: int = 0,
optional: bool = False
) -> FutureTaskSubmit a subtask from a currently executing task.
The task to submit as a subtask. An optional list of tasks already submitted within the same context that this subtask depends on. An optional [cluster slug](/workflows/concepts/clusters#managing-clusters) for running the subtask. If not provided, the subtask runs on the same cluster as the parent task. Specify the maximum number of [retries](/workflows/concepts/tasks#retry-handling) for the subtask in case of failure. The default is 0. Whether the subtask is [optional](/workflows/concepts/tasks#optional-tasks). If `True`, the subtask will not fail the job if it fails. Tasks that depend on this task will still execute even if this task failed. The default is `False`.A FutureTask object that represents the submitted subtask. Can be used to set up dependencies between tasks.