---
title: "Optional Tasks"
description: "Subtasks can now be optional so their failure does not cancel the job."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

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

# Optional Tasks

import { Frame } from "@docs/components/ui/frame";
import { CardGrid } from "@docs/components/ui/card-grid";
import { LinkCard } from "@docs/components/ui/link-card";

![Optional Tasks](/docs/assets/changelog/2026-02-optional-tasks.png)

Subtasks can now be marked as **optional** when submitting them. Use `optional=True` for work such as preview generation or auxiliary data enrichment whose failure should not cancel the job. Required tasks keep their existing failure behavior.

Inside a task's `execute` method, submit an optional step and make a final step depend on it. Here, `CreatePreview` and `Finalize` represent your own task classes:

```python
preview = context.submit_subtask(
    CreatePreview(), optional=True, max_retries=3
)
context.submit_subtask(Finalize(), depends_on=[preview])
```

Tilebox retries the preview up to three times before marking it `FAILED_OPTIONAL`. `Finalize` still runs after that failure, so it must handle a missing preview rather than assume the optional step produced an output.

Optionality also applies to a task's nested subtasks. A failure inside that optional subtree skips its remaining queued work (`SKIPPED`) without canceling the rest of the job. This contains failures within the optional branch while keeping them visible for investigation.

    Combine optional work with retries, dependencies, and nested subtasks.

Source: https://tilebox.com/docs/changelog/2026-02-18-optional-tasks/index.mdx
