Filtering builds by source and createdBy in GraphQL API

Hi Buildkite team,

I’d like to request additional filters for the builds connection in the GraphQL API.

Use case:
Right now, when querying builds for a pipeline, the API returns all builds in the timeframe (including scheduled builds). In many cases, we only want to count builds triggered by users or webhooks, and exclude scheduled builds. Today the only option is to fetch all builds and filter client-side based on:

  • source.name (e.g. "Webhook", "Schedule")

  • createdBy (null vs user/unregistered user)

This makes queries heavier than necessary, especially when looking at long time ranges.

Add optional arguments to the builds connection, such as:

builds(
  branch: "%default"
  state: PASSED
  createdAtFrom: $from
  createdAtTo: $to
  source: [Schedule, Webhook, Api, Manual]   # new
  createdBy: NOT_NULL | NULL                 # new
) { ... }

This would make it possible to fetch only non-scheduled builds directly, without client-side filtering.

Benefit:

  • More efficient queries (smaller responses)

  • Cleaner client implementations (no need for extra filtering logic)

  • Consistency with how other filters (branch, state, createdAt) already work

Thanks for considering this improvement, it would make a big difference for teams that want to report on “real” developer-triggered builds vs scheduled runs.

Hi and thank you for reaching out to us at Buildkite Support :waving_hand: ,

Thanks as well for the detailed feature request! I can see how adding source and createdBy filters to the builds connection would be really useful for your use case. Being able to filter out scheduled builds server-side would definitely make your queries more efficient and eliminate the need for client-side filtering.

I’ve passed this along to our product team with the details you provided. Thanks for taking the time to explain the use case and suggesting specific filter arguments!

Cheers!