Skip to content

Make the default run list filters more explicit #2494

Open

Description

@myftija

In the /runs API endpoint we apply a time range filter (last 7 days) by default. This is not obvious in the API docs or in the SDK runs.list method, which can lead to confusion.

We should document this behavior in the docs. Additionally it might be reasonable to add the applied filters as metadata in the API response.

Similarly in the runs page in the dashboard, we can hint at changing the default time range filter when there are no runs returned for the selected filters.

Activity

  1. WoutDeRijck commented on Jun 30, 2026

    @WoutDeRijck

    We were indeed confused by this, is there a way to remove the time range filter?

  2. matt-aitken commented on Jul 2, 2026

    @matt-aitken
    Member

    @WoutDeRijck there's a performance impact on changing this default to be longer. Returning all of the filters in the response, including the implicit time period makes sense.

  3. Rutvij97 commented on Nov 10, 2026

    @Rutvij97

    I've put together a small change along the lines @matt-aitken suggested above (keep the 7 day default for performance, but make it explicit by returning the applied filters), and would like to contribute it if a maintainer is willing to vouch for me.

    Branch: https://github.com/Rutvij97/trigger.dev/tree/feat/runs-list-applied-filters (compare: main...Rutvij97:trigger.dev:feat/runs-list-applied-filters)

    What it does:

    • GET /api/v1/runs now returns a filters object next to data and pagination, echoing the filters the list was produced with. When the request has no filter[createdAt], that includes the implicit default: "filters": { "createdAt": { "period": "7d" } }. Explicit period / from / to, and any status, env, task, version, tag, queue, etc. filters are echoed as well. Only the webapp ApiRunListPresenter is touched; the resolution of the default reuses timeFilters() from SharedFilters, so the API and the dashboard stay in sync.
    • Documents the new filters field on ListRunsResult in docs/v3-openapi.yaml, and adds a note to the runs.list() section of docs/runs.mdx explaining the 7 day default and how to pass period / from / to to list older runs.
    • Adds a .server-changes entry and a small vitest unit test for the filter echo (webapp typecheck, oxfmt and oxlint are clean; I couldn't run the container-based tests locally as I don't have Docker).

    Deliberately left out of this change, could be follow-ups if you want them:

    • The SDK's CursorPage schema strips unknown keys, so runs.list() doesn't surface filters yet. Exposing it would mean a packages/core schema change plus a changeset, which felt like a separate PR.
    • A hint in the dashboard's empty run list ("showing the last 7 days") for the UI side of this issue.

    Happy to adjust the shape or scope before opening a draft PR. If the vouch process should go through discussion #5010 instead, let me know and I'll post there.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions