Repository navigation
Description
Is your feature request related to a problem? Please describe.
I may be missing an existing exported type, so please feel free to redirect me if there is already a recommended way to type this.
Feature Request
It would be useful if @trigger.dev/sdk exported the public run status type, for example:
import type { RunStatus } from "@trigger.dev/sdk";
Use case example
I am building operational tooling around Trigger. In that context, I need to list runs by status and type status-based logic around runs.list(...) and runs.retrieve(...).
For example:
import { runs } from "@trigger.dev/sdk";
import type { RunStatus } from "@trigger.dev/sdk";
export async function* listTriggerRunsCreatedBetween(params: {
createdAtFrom: Date;
createdAtUntil: Date;
status?: RunStatus[];
detailed?: boolean;
}) {
const listedRuns = runs.list({
status: params.status,
from: params.createdAtFrom,
to: params.createdAtUntil,
})
for await (const run of listedRuns) {
yield params.detailed ? await runs.retrieve(run.id) : run;
}
}Currently, RunStatus does not appear to be directly exported from @trigger.dev/sdk, so consumers need to derive it indirectly:
import { runs } from "@trigger.dev/sdk";
type Run = Awaited<ReturnType<typeof runs.retrieve>>;
type RunStatus = Run["status"];These workarounds are usable, but they are less discoverable and couple application code to SDK method signatures rather than to an explicit public SDK type.
Describe the solution you'd like to see
Suggested API
import type { RunStatus } from "@trigger.dev/sdk";
Describe alternate solutions
Optionally, if the list filter type is intentionally different from the run object status type:
import type { RunListStatusFilter } from "@trigger.dev/sdk";
Additional information
Why this would help
This would improve TypeScript ergonomics for operational tooling such as run monitoring, ledgers, dashboards, queue inspection, backfills/replays, alerting and guardrails.
It's a small DX improvement but it would make the SDK easier to use for typed operational workflow.
Activity
itzzdev09 commentedon Aug 28, 2026
Still not exported as of
@trigger.dev/[email protected]:The type does exist — it's declared in
@trigger.dev/core(v3/schemas/api.d.ts) asz.infer<typeof RunStatus>, just not re-exported from the SDK's root.Two things that compile today, if you need to unblock without waiting:
or derive it from the SDK's own surface, which avoids the second import entirely and stays correct if the union changes:
I'd lean toward the derived version for your generator — it's tied to what
runs.retrieveactually returns, so it can't drift from the SDK, whereas thecoreimport reaches past the public API and could break without it counting as a breaking change.Both verified against 4.5.13. The request still seems worth doing though:
runs.list({ status })takes the type as input, so needing an internal package to name it is awkward.