airflow_clear_task_instances
Clear task instances in Apache Airflow DAGs using native filters to remove execution history and reset states for troubleshooting or reruns.
Instructions
Clear task instances for a DAG across one or more runs using Airflow's native filter set (destructive).
Parameters
instance: Instance key (optional; mutually exclusive with ui_url)
ui_url: Airflow UI URL to resolve instance (optional; takes precedence)
dag_id: DAG identifier (required if ui_url not provided)
task_ids: List of task IDs to clear (optional)
start_date: ISO8601 start date filter (optional)
end_date: ISO8601 end date filter (optional)
include_subdags: Include subDAGs (optional)
include_parentdag: Include parent DAG (optional)
include_upstream: Include upstream tasks (optional)
include_downstream: Include downstream tasks (optional)
include_future: Include future runs (optional)
include_past: Include past runs (optional)
dry_run: If true, perform a dry-run only (optional)
reset_dag_runs: Reset DagRun state (optional)
Returns
Response dict: { "dag_id": str, "cleared": object, "request_id": str }
Raises: ToolError with compact JSON payload (
code,message,request_id, optionalcontext)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance | No | ||
| ui_url | No | ||
| dag_id | No | ||
| task_ids | No | ||
| start_date | No | ||
| end_date | No | ||
| include_subdags | No | ||
| include_parentdag | No | ||
| include_upstream | No | ||
| include_downstream | No | ||
| include_future | No | ||
| include_past | No | ||
| dry_run | No | ||
| reset_dag_runs | No |