Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to schedule DAG with different parameters

I have a scenario where I've to schedule an Airflow DAG with different params based on scheduling criteria.

For instance, I've to:

Schedule DAG on Monday and Tuesday with the variable "source" as "process_usa"
Schedule DAG every Friday with the variable "source" as "process_ca"
Schedule DAG on Tuesday, Wednesday and Sunday with the variable "source" as "process_ind"

Any idea how can I do scheduling of the DAG with different params based on schedule.

like image 627
Alica Bellchi Avatar asked Dec 17 '25 14:12

Alica Bellchi


1 Answers

There is no straightforward approach that I know of. But you can basically have a PythonOperator as the first task (or alternatively wrap your dag in another dag, if you don't want to disturb actual dag) and you should be able to handle schedule check in the function.

like image 120
Bala Avatar answered Dec 20 '25 08:12

Bala



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!