Skip to content

is_scheduled REST API parameter - #72029

Open
RNHTTR wants to merge 5 commits into
apache:mainfrom
RNHTTR:oss/53741-goal-add-an-only
Open

is_scheduled REST API parameter#72029
RNHTTR wants to merge 5 commits into
apache:mainfrom
RNHTTR:oss/53741-goal-add-an-only

Conversation

@RNHTTR

@RNHTTR RNHTTR commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

closes: #53741

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [Roborchestra] following the guidelines

Roborchestra is a collection of Airflow Dags that invoke AgentOperator (and other Airflow-native tools) to address open issues in Airflow.


API="http://localhost:28080/api/v2/dags?exclude_stale=false&limit=1"
H="Authorization: Bearer $TOKEN"

curl -s -H "$H" "$API"                   -o all.json
curl -s -H "$H" "$API&is_scheduled=true"  -o sched.json
curl -s -H "$H" "$API&is_scheduled=false" -o unsched.json

jq -n \
  --slurpfile a all.json \
  --slurpfile s sched.json \
  --slurpfile u unsched.json \
  '{
     total:             $a[0].total_entries,
     scheduled:         $s[0].total_entries,
     unscheduled:       $u[0].total_entries,
     sums_correctly:    ($s[0].total_entries + $u[0].total_entries == $a[0].total_entries)
   }'
{
  "total": 211,
  "scheduled": 71,
  "unscheduled": 140,
  "sums_correctly": true
}

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up.

Another good question I came up with is that should we consider the OnceTimetable as unscheduled or scheduled?

dag_ids=readable_dags_filter.value,
)
if is_scheduled is not None:
unscheduled_timetable_types = ("NullTimetable", "PartitionedAtRuntime")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about maintaining the list as frozenset at model level? Though it seems API server is the only caller now, but having the them in the model level should have better maintenance and can be served as single source of truth.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel strongly either way. Selfishly and candidly, I'd prefer this to be merged and then adjusted later since this PR is mostly for my Summit talk about using Airflow as a sort of guardrail for automated agentic coding, and it one-shot this.

I think it'd be a backward compatible change, and I'd be happy to commit to changing that in a follow-up PR. That's not a good reason to avoid this if you feel it's important, though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as we move this in a follow up PR then this works for me.

@RNHTTR

RNHTTR commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the follow-up.

Another good question I came up with is that should we consider the OnceTimetable as unscheduled or scheduled?

My gut reaction is that we should consider anything that doesn't have schedule=None as "scheduled". It's possible that the OnceTimetable is configured to be run at a future time via start_date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add API Support for Filtering Unscheduled DAGs

3 participants