airflowairflow-api

execution_date_gte parameter ignored in Airflow REST API dagRuns call


The execution_date_gte parameter seems to have no effect in below Airflow REST API dagRuns call.

curl -X GET 'http://localhost:8080/api/v1/dags/demand_forecast/dagRuns' -H 'Cache-Control: no-cache' -H 'Content-Type: application/json' -d '{"execution_date_gte": "2023-02-02T00:00:00+00:00"}' --user "airflow:airflow"

Response:

{
  "dag_runs": [
    {
      "conf": {},
      "dag_id": "demand_forecast",
      "dag_run_id": "scheduled__2022-02-15T00:00:00+00:00",
      "end_date": "2022-08-22T08:46:37.026194+00:00",
      "execution_date": "2022-02-15T00:00:00+00:00",
      "external_trigger": false,
      "logical_date": "2022-02-15T00:00:00+00:00",
      "start_date": "2022-08-22T08:46:15.451700+00:00",
      "state": "success"
    }
  ],
  "total_entries": 1
}

Here the returned dag run has an execution_date which is smaller than provided execution_date_gte (=2023-02-02T00:00:00+00:00).


Solution

  • execution_date_gte should be passed as a query parameter to the GET request.