theis188 opened a new issue #20073:
URL: https://github.com/apache/airflow/issues/20073
### Description
Feature request: add the ability to attach multiple schedule/parameter pairs
to a DAG. For example
```
SCHEDULE = [
("0 0 * * 1", MONDAY_PARAM),
("0 0 * * 2", TUESDAY_PARAM)
...
]
```
Currently, scheduling DAGs can be accomplished by using the
`schedule_interval` kwarg on the DAG initialization
[Link](https://airflow.apache.org/docs/apache-airflow/stable/dag-run.html#dag-runs)
The documentation for DAG Run, describes the custom parametrization as
follows
[link](https://airflow.apache.org/docs/apache-airflow/stable/dag-run.html#passing-parameters-when-triggering-dags):
> When triggering a DAG from the CLI, the REST API or the UI, it is possible
to pass configuration for a DAG Run as a JSON blob.
So presumably (and in practice), any scheduled DAG Run will only use the
default parameters.
An internet search also did not indicate a way of scheduling DAGs with
custom parameters.
### Use case/motivation
When managing many similar jobs that run on different schedules, our
approach so far has been to create one DAG per job type. In terms of code, we
can efficiently create these DAGs using DAG and task factory functions, but DAG
management on the Airflow frontend becomes cluttered (although mitigated by
Tags and search features). The DAG scheduled with custom parameters would
provide an alternate means of managing these types of workflows.
Scheduling with custom parameters is a feature in, for example, Jenkins. We
have adjusted by using functional DAG creation as described, but this would be
a nice feature as well.
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]