【问题标题】:Airflow - create task that runs once all other tasks ran successfullyAirflow - 创建在所有其他任务成功运行后运行的任务
【发布时间】:2021-12-26 17:36:32
【问题描述】:

有没有办法添加一个任务,一旦所有其他任务在同一个 DAG 中成功运行,就可以运行,请参阅下面的我当前的 DAG。

例如,我当前的任务按以下顺序运行,但我想在以下所有任务运行后添加new_task。如果我把它留在下面,它就不会运行new_task

for endpoint in ENDPOINTS:
      latest_only = (operator...)
      s3 = (operator...)
      etc ....


      latest_only >> s3 >> short_circuit
      short_circuit >> snowflake >> success
      short_circuit >> postgres >> success
      if endpoint.name == "io_lineitems":
        success >> il_io_lineitems_tables
copy_monthly_billing >> load_io_monthly_billing_to_snowflake
copy_monthly_billing >> load_io_monthly_billing_to_postgres
new_task

【问题讨论】:

    标签: airflow airflow-2.x


    【解决方案1】:

    使用触发规则根据上游任务成功状态触发 trigger_rules

    【讨论】:

      猜你喜欢
      • 2015-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-21
      相关资源
      最近更新 更多