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

# Apache Airflow® trigger rules

Trigger rules are used to determine when a task should run in relation to the previous task. By default, [Apache Airflow®](https://airflow.apache.org/) runs a task when all directly upstream tasks are successful. However, you can change this behavior using the `trigger_rule` parameter in the task definition.

<Info>
  Trigger rules define whether a task runs based on its direct upstream dependencies. To learn how to set task dependencies, see the [Manage task and task group dependencies in Airflow](/docs/learn/managing-dependencies) guide.
</Info>

## Define a trigger rule

You can override the default trigger rule by setting the `trigger_rule` parameter in the task definition.

```python {7} wrap theme={null}
# from airflow.sdk import chain, task

@task 
def upstream_task():
    return "Hello..."

@task(trigger_rule="all_success")
def downstream_task():
    return " World!"

chain(upstream_task(), downstream_task())
```

```python {7} wrap theme={null}
# from airflow.providers.standard.operators.empty import EmptyOperator
# from airflow.sdk import chain

upstream_task = EmptyOperator(task_id="upstream_task")
downstream_task = EmptyOperator(
    task_id="downstream_task",
    trigger_rule="all_success"
)
chain(upstream_task, downstream_task)
```

## Trigger rules in Airflow

The following trigger rules are available:

* `all_success`: (default) The task runs only when all upstream tasks have succeeded.
* `all_done`: The task runs once all upstream tasks are done with their execution.
* `all_done_min_one_success`: The task runs once all upstream tasks are done with their execution and at least one upstream task has succeeded. Note that `skipped` doesn't count as done for this rule and will cause the downstream task to be skipped as well.
* `all_failed`: The task runs only when all upstream tasks are in a `failed` or `upstream_failed` state.
* `all_skipped`: The task runs only when all upstream tasks have been skipped.
* `always`: The task runs as soon as the Dag run starts, independently of the status of any upstream tasks.
* `none_failed`: The task runs only when all upstream tasks have succeeded or been skipped.
* `none_failed_min_one_success`: The task runs only when all upstream tasks aren't in the state `failed` or `upstream_failed`, and at least one upstream task has succeeded.
* `none_skipped`: The task runs only when no upstream task is in a `skipped` state.
* `one_done`: The task runs as soon as at least one upstream task has either succeeded or failed.
* `one_failed`: The task runs as soon as at least one upstream task is in `failed` or `upstream_failed` state.
* `one_success`: The task runs as soon as at least one upstream task has succeeded.
* `all_done_setup_success`: Special trigger rule used in teardown tasks. The task runs when all upstream tasks have finished and at least one directly connected setup task has been successful. See the [Use setup and teardown tasks in Airflow](/docs/learn/airflow-setup-teardown) guide for more information.

<Info>
  You can define a Dag in which any task failure stops the Dag execution by setting the [Dag parameter](/docs/learn/airflow-dag-parameters) `fail_fast` to `True`. This will set all tasks that are still running to `failed` and mark any tasks that haven't run yet as `skipped`, as soon as any task in the Dag fails. Note that you can't have any trigger rule other than `all_success` (and `all_done_setup_success`) in a Dag with `fail_fast` set to `True` and that [teardown](/docs/learn/airflow-setup-teardown) tasks are exempt and will still run.
</Info>

## Branching and trigger rules

One common scenario where you might need to implement trigger rules is if your Dag contains conditional logic such as [branching](/docs/learn/airflow-branch-operator). In these cases, for the task directly after the branches, `none_failed_min_one_success` or `none_failed` are likely more helpful than `all_success`, because unless all branches are run, at least one upstream task will always be in a `skipped` state.

In the following example Dag there is a simple branch with a downstream task that needs to run if either of the branches are followed. With the `all_success` rule, the `end` task never runs because all but one of the `branch` tasks is always ignored and therefore doesn't have a success state. If you change the trigger rule to `none_failed_min_one_success`, then the `end` task can run so long as one at least one of the branches has succeeded and none of the branches have failed.

```python {10} wrap theme={null}
import random
from airflow.sdk import dag, task
from airflow.providers.standard.operators.empty import EmptyOperator


@dag
def branching_dag():
    # EmptyOperators to start and end the DAG
    start = EmptyOperator(task_id="start")
    end = EmptyOperator(task_id="end", trigger_rule="none_failed_min_one_success")

    # Branching task
    @task.branch
    def branching(**kwargs):
        branches = ["branch_0", "branch_1", "branch_2"]
        return random.choice(branches)

    branching_task = branching()

    start >> branching_task

    # set dependencies
    for i in range(0, 3):
        d = EmptyOperator(task_id="branch_{0}".format(i))
        branching_task >> d >> end


branching_dag()
```

This image shows the resulting Dag:

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_managing-dependencies_branch_decorator.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=9da9a2ff963f2de168ab526d283d010e" alt="Branch Dependencies" width="1085" height="440" data-path="images/img/guides/3_2_managing-dependencies_branch_decorator.png" />
</Frame>

<details>
  <summary>Traditional Syntax</summary>

  ```python {15} wrap theme={null}
  import random
  from airflow.sdk import DAG
  from airflow.providers.standard.operators.empty import EmptyOperator
  from airflow.providers.standard.operators.python import BranchPythonOperator


  def return_branch(**kwargs):
      branches = ["branch_0", "branch_1", "branch_2"]
      return random.choice(branches)


  with DAG(dag_id="branching_dag"):
      # EmptyOperators to start and end the DAG
      start = EmptyOperator(task_id="start")
      end = EmptyOperator(task_id="end", trigger_rule="none_failed_min_one_success")

      # Branching task
      branching = BranchPythonOperator(task_id="branching", python_callable=return_branch)

      start >> branching

      # set dependencies
      for i in range(0, 3):
          d = EmptyOperator(task_id="branch_{0}".format(i))
          branching >> d >> end
  ```
</details>

## Airflow trigger rules in detail

### `all_success`

This is the default trigger rule. A task with the trigger rule `all_success` only runs when all upstream tasks have succeeded.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_success.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=2cc0ad5109e738cd20f41091685680a6" alt="Graph view of a Dag where all four upstream tasks succeeded and the downstream authorize_flight task ran with the all_success trigger rule" width="1017" height="630" data-path="images/img/guides/3_2_airflow-trigger-rules_all_success.png" />
</Frame>

As soon as any upstream tasks are in the state of `failed`, `upstream_failed`, the downstream task is set to the state `upstream_failed` and doesn't run.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_success_upstream_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=1567c03d4a5f5bfa487dfdbc044c9a29" alt="Graph view of a Dag where the clear_paris task failed, setting the downstream authorize_flight task to upstream_failed under the all_success trigger rule" width="955" height="632" data-path="images/img/guides/3_2_airflow-trigger-rules_all_success_upstream_failed.png" />
</Frame>

Similarly, as soon as any upstream task is in the state `skipped`, the downstream task is set to the state `skipped` and doesn't run.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_success_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=5abec85dff696549d1f8807c60bc3840" alt="Graph view of a Dag where the clear_solo task was skipped, setting the downstream authorize_flight task to skipped under the all_success trigger rule" width="1006" height="653" data-path="images/img/guides/3_2_airflow-trigger-rules_all_success_skipped.png" />
</Frame>

If a task with the trigger rule `all_success` has one upstream task that is `skipped` and one that is `failed` / `upstream_failed`, whether the downstream task is set to `skipped` or `upstream_failed` depends on which of the upstream tasks finishes first. If the first upstream task that isn't successful ends with the state `skipped` the downstream task is skipped, if it ends in `failed` or `upstream_failed` the downstream task is set to `upstream_failed`. If both upstream tasks, `skipped` and `failed`/`upstream_failed` finish in the same scheduler evaluation period, the downstream task will be set to `upstream_failed`.

### `all_done`

The `all_done` trigger rule will make a task wait until all upstream tasks are done with their execution.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_done.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=9bacf60f712d185f9fb9f3de3e618eed" alt="Graph view of a Dag where the trajectory_mercury task is still running, so the downstream log_trajectory task has no status yet and waits under the all_done trigger rule" width="1146" height="654" data-path="images/img/guides/3_2_airflow-trigger-rules_all_done.png" />
</Frame>

As soon as all tasks finish, no matter what their state is, the downstream task will run.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_done_upstream_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=fc3dbc34aa10c7a2df43bf858baaf05e" alt="Graph view of a Dag where the upstream tasks finished in failed, upstream_failed, and skipped states and the downstream log_trajectory task still ran under the all_done trigger rule" width="1123" height="614" data-path="images/img/guides/3_2_airflow-trigger-rules_all_done_upstream_failed.png" />
</Frame>

### `all_failed`

The `all_failed` trigger rule will make a task wait until all upstream tasks are in a `failed` or `upstream_failed` state.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=03d4971dbe68604dd4a597d700251da2" alt="Graph view of a Dag where the check_vesta_orbit task is still running, so the downstream end_mission task has no status yet and waits under the all_failed trigger rule" width="1074" height="647" data-path="images/img/guides/3_2_airflow-trigger-rules_all_failed.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_failed_runs.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=6178b5bc0674c1af75a6e5c084d630da" alt="Graph view of a Dag where all upstream tasks are in failed or upstream_failed states and the downstream end_mission task ran under the all_failed trigger rule" width="1049" height="635" data-path="images/img/guides/3_2_airflow-trigger-rules_all_failed_runs.png" />
</Frame>

As soon as any upstream task is in the state `success` or `skipped`, the downstream task is set to the state `skipped` and doesn't run.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_failed_success.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=a063fc6712750b806347b9ffd34b00a0" alt="Graph view of a Dag where the check_pallas_orbit task succeeded, setting the downstream end_mission task to skipped under the all_failed trigger rule" width="1048" height="612" data-path="images/img/guides/3_2_airflow-trigger-rules_all_failed_success.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_failed_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=7f806da9448ffece408e98697a6b8d94" alt="Graph view of a Dag where the check_pallas_orbit task was skipped, setting the downstream end_mission task to skipped under the all_failed trigger rule" width="1099" height="671" data-path="images/img/guides/3_2_airflow-trigger-rules_all_failed_skipped.png" />
</Frame>

### `all_skipped`

A task with the trigger rule `all_skipped` waits for all its upstream tasks to be `skipped`.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=bcc036f4aaea33173b54c559f3541708" alt="Graph view of a Dag where three survey tasks are skipped and survey_ganymede is still running, so the downstream return_to_orbit task has no status yet and waits under the all_skipped trigger rule" width="958" height="658" data-path="images/img/guides/3_2_airflow-trigger-rules_all_skipped.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_skipped_runs.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=a743422253c931fac020639be870fe72" alt="Graph view of a Dag where all four survey tasks are skipped and the downstream return_to_orbit task ran under the all_skipped trigger rule" width="954" height="630" data-path="images/img/guides/3_2_airflow-trigger-rules_all_skipped_runs.png" />
</Frame>

As soon as any upstream task is in the state `success`, `failed`, or `upstream_failed`, the downstream task with the trigger rule `all_skipped` is set to the state `skipped` and doesn't run.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_skipped_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=685c78f86bb7c3d754ecd218ea65e26a" alt="Graph view of a Dag where the survey_io task succeeded, setting the downstream return_to_orbit task to skipped under the all_skipped trigger rule" width="992" height="672" data-path="images/img/guides/3_2_airflow-trigger-rules_all_skipped_skipped.png" />
</Frame>

### `all_done_min_one_success`

Tasks using the `all_done_min_one_success` trigger rule run only when three conditions are met:

1. All upstream tasks are in either `success`, `failed` or `upstream_failed` state.
2. At least one upstream task is in the success state.
3. No upstream task is in the `skipped` state.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_done_min_one_success.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=bb18337490e6b667ee90802fa3b41431" alt="Graph view of a Dag where ping_delta_relay and ping_ds9 failed, ping_voyager is upstream_failed, ping_enterprise succeeded, and ping_farragut is still running, so the downstream generate_report task has no status yet and waits under the all_done_min_one_success trigger rule" width="1103" height="638" data-path="images/img/guides/3_2_airflow-trigger-rules_all_done_min_one_success.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_done_min_one_success_runs.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=f9322c9167d92a30d518156ee98eafd6" alt="Graph view of a Dag where all upstream tasks finished with ping_enterprise succeeded and the others failed or upstream_failed, so the downstream generate_report task ran under the all_done_min_one_success trigger rule" width="1084" height="637" data-path="images/img/guides/3_2_airflow-trigger-rules_all_done_min_one_success_runs.png" />
</Frame>

If all upstream tasks finish in either `failed` or `upstream_failed` state, the task using the `all_done_min_one_success` trigger rule is set to `upstream_failed`.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_done_min_one_success_upstream_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=af263c1289711a28c96baa9d5b45e859" alt="Graph view of a Dag where all upstream tasks finished in failed or upstream_failed states, setting the downstream generate_report task to upstream_failed under the all_done_min_one_success trigger rule" width="1098" height="635" data-path="images/img/guides/3_2_airflow-trigger-rules_all_done_min_one_success_upstream_failed.png" />
</Frame>

As soon as any upstream task is in a `skipped` state the task using the `all_done_min_one_success` trigger rule is `skipped` as well.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_all_done_min_one_success_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=a48217ddc2d1462e7bd28049349cbc80" alt="Graph view of a Dag where the ping_enterprise task was skipped, setting the downstream generate_report task to skipped under the all_done_min_one_success trigger rule" width="1080" height="636" data-path="images/img/guides/3_2_airflow-trigger-rules_all_done_min_one_success_skipped.png" />
</Frame>

### always

A task with the trigger rule `always` runs as soon as the Dag run is started, regardless of the state of its upstream tasks.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_always.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=a3f25b0e2d70c707d1dd9209bf934481" alt="Graph view of a Dag where the downstream send_telemetry task already succeeded while all its upstream tasks are still running or have no status yet under the always trigger rule" width="1081" height="622" data-path="images/img/guides/3_2_airflow-trigger-rules_always.png" />
</Frame>

### `none_failed`

The `none_failed` trigger rule makes a task run only when all upstream tasks have either succeeded or been skipped.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_none_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=d049ab1d3cd59ede9d8d2f55729125b5" alt="Graph view of a Dag where calibrate_phobos and calibrate_io are skipped and calibrate_deimos and calibrate_luna succeeded, so the downstream initialize_navigation task ran under the none_failed trigger rule" width="962" height="664" data-path="images/img/guides/3_2_airflow-trigger-rules_none_failed.png" />
</Frame>

As soon as any upstream task is in the state `failed` or `upstream_failed`, the downstream task is set to the state `upstream_failed` and doesn't run.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_none_failed_upstream_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=4c0572af5d77f7c798ece7a37d6b4577" alt="Graph view of a Dag where the calibrate_luna task failed, setting the downstream initialize_navigation task to upstream_failed under the none_failed trigger rule" width="876" height="658" data-path="images/img/guides/3_2_airflow-trigger-rules_none_failed_upstream_failed.png" />
</Frame>

### `none_failed_min_one_success`

Tasks using the `none_failed_min_one_success` trigger rule run only when three conditions are met:

1. All upstream tasks are finished.
2. No upstream tasks are in the `failed` or `upstream_failed` state.
3. At least one upstream task is in the `success` state.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_none_failed_min_one_success.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=2b23c00c3763a8531224258521c8c184" alt="Graph view of a Dag where invite_stevens is still running, so the downstream launch_mission task has no status yet and waits under the none_failed_min_one_success trigger rule" width="1124" height="665" data-path="images/img/guides/3_2_airflow-trigger-rules_none_failed_min_one_success.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_none_failed_min_one_success_runs.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=ebb79e15ae6455f76810d2b9c680a859" alt="Graph view of a Dag where ping and invite_baldwin succeeded and the remaining invite tasks are skipped, so the downstream launch_mission task ran under the none_failed_min_one_success trigger rule" width="1111" height="651" data-path="images/img/guides/3_2_airflow-trigger-rules_none_failed_min_one_success_runs.png" />
</Frame>

If any upstream task is in the `failed` or `upstream_failed` state, the downstream task is set to the state `upstream_failed` and doesn't run.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_none_failed_min_one_success_upstream_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=f22e19d97712fe24bf0d151af4d10e79" alt="Graph view of a Dag where the ping task failed, setting invite_baldwin and the downstream launch_mission task to upstream_failed under the none_failed_min_one_success trigger rule" width="1082" height="650" data-path="images/img/guides/3_2_airflow-trigger-rules_none_failed_min_one_success_upstream_failed.png" />
</Frame>

If all upstream tasks are in the `skipped` state, the downstream task is set to the state `skipped` and doesn't run.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_none_failed_min_one_success_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=5b655ee8097ca2f5eae62a7c9038c953" alt="Graph view of a Dag where all upstream tasks are skipped, setting the downstream launch_mission task to skipped under the none_failed_min_one_success trigger rule" width="1111" height="652" data-path="images/img/guides/3_2_airflow-trigger-rules_none_failed_min_one_success_skipped.png" />
</Frame>

### `none_skipped`

Tasks using the `none_skipped` trigger rule run only when no upstream task is in the `skipped` state. Upstream tasks can be in any other state: `success`, `failed`, or `upstream_failed`.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_none_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=a3321a00117dcca0d58d2310dceffd49" alt="Graph view of a Dag where verify_hull is still running, so the downstream authorize_launch task has no status yet and waits under the none_skipped trigger rule" width="949" height="656" data-path="images/img/guides/3_2_airflow-trigger-rules_none_skipped.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_none_skipped_runs.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=29d4c51fbbadbb2b8a381db39764813a" alt="Graph view of a Dag where the verify tasks finished in success and failed states with none skipped, so the downstream authorize_launch task ran under the none_skipped trigger rule" width="942" height="681" data-path="images/img/guides/3_2_airflow-trigger-rules_none_skipped_runs.png" />
</Frame>

If any upstream task is in the `skipped` state, the downstream task is set to the state `skipped` and doesn't run.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_none_skipped_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=cc0c18bd2e3066f98f1e5c0399663d1a" alt="Graph view of a Dag where the verify_life_support task was skipped, setting the downstream authorize_launch task to skipped under the none_skipped trigger rule" width="927" height="637" data-path="images/img/guides/3_2_airflow-trigger-rules_none_skipped_skipped.png" />
</Frame>

### `one_done`

The `one_done` trigger rule makes a task run as soon as at least one of its upstream tasks is in either the `success` or `failed` state. Upstream tasks with `skipped` or `upstream_failed` states aren't considered "done."

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_one_done.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=f23244336544f6f23bda71f929b2d1eb" alt="Graph view of a Dag where contact_gamma_q and contact_alpha_q are running, contact_beta_q is skipped, and contact_delta_q is upstream_failed, so no upstream task is success or failed yet and the downstream record_uplink task waits under the one_done trigger rule" width="1104" height="696" data-path="images/img/guides/3_2_airflow-trigger-rules_one_done.png" />
</Frame>

Once one upstream task finishes (either in the `success` or `failed` state), the downstream task runs.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_one_done_runs.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=c7b718c4bd1c172065fff64e6a79e310" alt="Graph view of a Dag where contact_gamma_q succeeded while the other upstream tasks are skipped or upstream_failed, so the downstream record_uplink task ran under the one_done trigger rule" width="1134" height="684" data-path="images/img/guides/3_2_airflow-trigger-rules_one_done_runs.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_one_done_runs_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=0968ad5045e8d2124c4183a4e7f49e87" alt="Graph view of a Dag where contact_gamma_q failed while the other upstream tasks are skipped or upstream_failed, so the downstream record_uplink task ran under the one_done trigger rule" width="1113" height="683" data-path="images/img/guides/3_2_airflow-trigger-rules_one_done_runs_failed.png" />
</Frame>

If all upstream tasks are either in `skipped` or `upstream_failed` states, the downstream task with the `one_done` trigger rule is set to the state `skipped`.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_one_done_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=c891539bbe916f133bbd98622b9e922c" alt="Graph view of a Dag where all upstream tasks are skipped, setting the downstream record_uplink task to skipped under the one_done trigger rule" width="1089" height="692" data-path="images/img/guides/3_2_airflow-trigger-rules_one_done_skipped.png" />
</Frame>

### `one_failed`

The `one_failed` trigger rule will make a task run as soon as at least one of its upstream tasks is in either the `failed` or `upstream_failed` state.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_one_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=c19278dd560c99556d702fb28c30c072" alt="Graph view of a Dag where diagnose_razorback failed while the other upstream tasks are still running, so the downstream alert_engineering task ran under the one_failed trigger rule" width="1084" height="668" data-path="images/img/guides/3_2_airflow-trigger-rules_one_failed.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_one_failed_upstream_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=0be1589ce4a0fd41fdfc308a0479352f" alt="Graph view of a Dag where ping failed, setting diagnose_donnager to upstream_failed, so the downstream alert_engineering task ran under the one_failed trigger rule" width="1085" height="663" data-path="images/img/guides/3_2_airflow-trigger-rules_one_failed_upstream_failed.png" />
</Frame>

If all upstream tasks have completed and none of them are in the `failed` or `upstream_failed` state, the downstream task will be set to the state `skipped`.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_one_failed_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=3de6aadba99c016a2038fa0eaa175b71" alt="Graph view of a Dag where all upstream tasks succeeded with none failed or upstream_failed, setting the downstream alert_engineering task to skipped under the one_failed trigger rule" width="1116" height="649" data-path="images/img/guides/3_2_airflow-trigger-rules_one_failed_skipped.png" />
</Frame>

### `one_success`

The `one_success` trigger rule will make a task run as soon as at least one of its upstream tasks is in the `success` state.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_one_success.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=785588b3495904794ec106781afeea29" alt="Graph view of a Dag where ping_sojourner succeeded while the other upstream tasks are still running, so the downstream launch_supplies task ran under the one_success trigger rule" width="928" height="690" data-path="images/img/guides/3_2_airflow-trigger-rules_one_success.png" />
</Frame>

If all upstream tasks have been `skipped`, the downstream task with the `one_success` trigger rule is set to the state `skipped` as well.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_one_success_skipped.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=4753e5b63d7b0b625e8119af529e6ae0" alt="Graph view of a Dag where all upstream tasks are skipped, setting the downstream launch_supplies task to skipped under the one_success trigger rule" width="983" height="670" data-path="images/img/guides/3_2_airflow-trigger-rules_one_success_skipped.png" />
</Frame>

If all upstream tasks have completed and at least one of them is in the `failed` or `upstream_failed` state, the downstream task will be set to the state `upstream_failed`.

<Frame>
  <img src="https://mintcdn.com/astronomer/UcTR28b0xqXhSSb1/images/img/guides/3_2_airflow-trigger-rules_one_success_upstream_failed.png?fit=max&auto=format&n=UcTR28b0xqXhSSb1&q=85&s=1111fefc5250396c2a359635453910ef" alt="Graph view of a Dag where the upstream tasks finished with failures and a skip but no success, setting the downstream launch_supplies task to upstream_failed under the one_success trigger rule" width="1085" height="645" data-path="images/img/guides/3_2_airflow-trigger-rules_one_success_upstream_failed.png" />
</Frame>
