zach-overflow opened a new issue, #60484: URL: https://github.com/apache/airflow/issues/60484
### Description As of Airflow `3.1.5`, it appears that the [Airflow API](https://airflow.apache.org/docs/apache-airflow/3.1.5/stable-rest-api-ref.html#operation/get_dag_runs) does not support selecting an arbitrary dag version / bundle version to trigger via the `/api/v2/dags/{dag_id}/dagRuns` POST endpoint. As far as I can tell, when a client submits a request to the trigger dag run endpoint, [the underlying DagRun instance is always created](https://github.com/apache/airflow/blob/4ecd6c43b116303a1a70b8d3480fc7f35e0b0925/airflow-core/src/airflow/serialization/definitions/dag.py#L1084-L1109) with the latest `dag_version`, and either a null `bundle_version`, or the current bundle version. If I'm understanding the [distinction between bundle versions and dag versions](https://www.astronomer.io/docs/learn/airflow-dag-versioning#dag-versioning-vs-dag-bundles) correctly, then I believe this feature request would entail supporting an optional `bundle_version` parameter in the trigger dag run post requests. Requests without that parameter would trigger a dag run as they currently do, whereas requests with that parameter would trigger a prior bundled version of the dag (if the provided `bundle_version` exists, and if the dag bundle supports versioning). ### Use case/motivation It would be nice in certain scenarios to programmatically trigger a dag run for a specific past dag version. For example, comparing the results, side effects, or other behaviors associated with a "past" dag bundle version and the "latest" of that same dag. ### Related issues None that I could find, but feel free to link any that I may have missed. ### 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]
