Replies: 1 comment 2 replies
-
Have you considered using with DAG("main_dag", ...) as dag:
for i, conf in generate_configs():
TriggerDagRunOperator(task_id=f"task_id_{i}", conf=conf, trigger_dag_id="your_dag_id") Mind that dynamic DAGs can be problematic in case of backfills or reruns - for example if they are time based. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a requirement to have a DAG which can be run in different ways depending on the configuration. I see I can provide configuration for the DAG run itself from UI. What I would ideally want is multiple different DAGs doing the same tasks but appearing distinctly in the UI. This is because I want to restrict access to these similar DAGs based on owner.
One way could be to repeat the DAG multiple times in the python files in
dags
folder, with their separate owner and config. But this can quickly become too large. Also the number of these DAGs are not fixed, and would need to be determined at runtime. For ex, at runtime, I would determine how many such "duplicate" DAGs need to be created and have the config for them, and if they already exist, I won't create them again.What is the best way to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions