Quentin Sommer
Quentin Sommer

Reputation: 313

Best practice to run 1 time setup tasks

I often run into a scenario like this in my dags:

Is there an airflow way or a best practice to handle 1-off tasks that would only run once?

Upvotes: 0

Views: 59

Answers (1)

Elad Kalif
Elad Kalif

Reputation: 15931

You can create a DAG that will run only one time as:

from airflow.models import DAG

dag = DAG(
    dag_id='my_one_time_dag',
    schedule_interval='@once'
)

Upvotes: 1

Related Questions