clear-task-instances
Reset Airflow DAG task instances to enable re-runs, previewing by default and filtering by failure, run, or task.
Instructions
Clear task instances for a DAG, allowing them to be re-run.
Resets task instances to a cleared state so they can be retried. By default
only clears failed tasks and runs in dry-run mode for safety.
Requires the --allow-write flag.
Args:
ctx: The MCP context.
environment_name: Name of the MWAA environment.
dag_id: The DAG identifier.
dag_run_id: Optional DAG run ID to scope the clear.
task_ids: Optional list of task IDs to clear.
only_failed: Only clear failed tasks (default: true).
dry_run: Preview without clearing (default: true).
reset_dag_runs: Set DAG runs to RUNNING (default: false).
include_downstream: Also clear downstream tasks.
include_upstream: Also clear upstream tasks.
region: AWS region override.
profile_name: AWS CLI profile name override.
Returns:
CallToolResult with the cleared (or previewed) task instances.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dag_id | Yes | The DAG ID. | |
| region | No | AWS region override. | |
| dry_run | No | If true, return the list of task instances that would be cleared without actually clearing them. Defaults to true if omitted. | |
| task_ids | No | List of task IDs to clear. If omitted, all tasks are cleared. | |
| dag_run_id | No | Clear task instances only for this DAG run ID. | |
| only_failed | No | Only clear failed task instances. Defaults to true if omitted. | |
| profile_name | No | AWS CLI profile name override. | |
| reset_dag_runs | No | Set state of affected DAG runs to RUNNING. Defaults to false if omitted. | |
| environment_name | No | Name of the MWAA environment. If omitted and only one environment exists, it is used automatically. | |
| include_upstream | No | Also clear upstream tasks. Defaults to false if omitted. | |
| include_downstream | No | Also clear downstream tasks. Defaults to false if omitted. |