> ## Documentation Index
> Fetch the complete documentation index at: https://docs-old.tilebox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Context.submit_subtasks

```python theme={"system"}
def ExecutionContext.submit_subtasks(
  tasks: Sequence[Task],
  depends_on: FutureTask | list[FutureTask] | None = None,
  cluster: str | None = None,
  max_retries: int = 0,
  optional: bool = False
) -> list[FutureTask]
```

Submit multiple [subtasks](https://docs-old.tilebox.com/workflows/concepts/tasks.md#subtasks-and-task-composition) from a currently executing task. Same as [submit\_subtask](https://docs-old.tilebox.com/api-reference/python/tilebox.workflows/ExecutionContext.submit_subtask.md), but accepts a sequence of tasks.

## Parameters

**tasks** `Sequence[Task]`

The tasks to submit as subtasks.

**depends\_on** `FutureTask | list[FutureTask] | None`

An optional task or list of tasks already submitted within the same context that the subtasks depend on.

**cluster** `str`

An optional [cluster slug](https://docs-old.tilebox.com/workflows/concepts/clusters.md#managing-clusters) for running the subtasks. If not provided, the subtasks run on the same cluster as the parent task.

**max\_retries** `int`

Specify the maximum number of [retries](https://docs-old.tilebox.com/workflows/concepts/tasks.md#retry-handling) for the subtasks in case of failure. The default is 0.

**optional** `bool`

Whether the subtasks are [optional](https://docs-old.tilebox.com/workflows/concepts/tasks.md#optional-tasks). If `True`, the subtasks will not fail the job if they fail. Tasks that depend on them will still execute even if they failed. The default is `False`.

## Returns

A list of `FutureTask` objects representing the submitted subtasks. Can be used to set up dependencies between tasks.

```python Python theme={"system"}
# within the execute method of a Task:
subtasks = context.submit_subtasks([
    MySubtask(i) for i in range(10)
])
dependent_subtask = context.submit_subtask(
    MyOtherSubtask(), depends_on=subtasks
)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.