clear_task_instances
Clear task instances for re-execution after a fix. Preview with dry run, or apply with dry_run=False.
Instructions
Clear task instances so they re-run — the fast way to re-test a task after a fix.
Defaults to a DRY RUN: it reports which task instances would be cleared without touching them. Pass dry_run=False to actually clear; with reset_dag_runs=True the affected run is put back into a running state so cleared tasks re-execute.
Args: dag_id: DAG identifier. dag_run_id: Restrict to a single run (recommended). If omitted, the API's other filters apply across runs. task_ids: Restrict to specific task_ids. If omitted, all matching tasks are cleared. only_failed: When True, only clear failed task instances. reset_dag_runs: When True (default), set affected runs back to running so cleared tasks are re-scheduled. dry_run: When True (default), preview only. Set False to actually clear.
Returns:
ClearResult with dry_run (echoed) and task_instances (the affected TIs).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dag_id | Yes | ||
| dry_run | No | ||
| task_ids | No | ||
| dag_run_id | No | ||
| only_failed | No | ||
| reset_dag_runs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | Yes | ||
| task_instances | Yes |