capabilities.work

Force a Task Instance State

A 5-step recipe with Apache Airflow. We can help you get access.

Recipe · 5 steps

Force a Task Instance State

Override a task instance's state after previewing the affected instances.

  1. Read the task instance so the caller can see and record the state being overridden before anything changes.
  2. Dry-run the state change. Airflow returns the task instances the real call would modify without touching any of them, which matters because downstream propagation can reach further than expected.
  3. Apply the state change for real against the same selection that was previewed.
  4. Re-read the task instance and require that its state now matches the requested override.
  5. Read the DAG run to report whether overriding the task released the rest of the pipeline.
What you'll need to have ready
  • dagId: The DAG identifier the task belongs to.
  • dagRunId: The run identifier containing the task instance to override.
  • taskId: The task id whose state should be forced.
  • newState: The state to set. The endpoint accepts "success", "failed", and "skipped"; "success" is the common unblock-the-pipeline choice.
  • includeDownstream: Whether to propagate the new state to downstream tasks. Defaults to false, which changes only the named task and lets the scheduler decide what runs next.
For your developer

Arazzo workflow apache-airflow:force-task-instance-state, 5 operations: get_task_instance → post_set_task_instances_state → post_set_task_instances_state → get_task_instance → getApiV2DagsByDagIdDagRunsByDagRunId. Specs on APIs.io.