const event = await client.getEvent(anEventId);
if (event.runs.length === 0) {
  throw new Error("No runs");
}

These are the docs for Trigger.dev v2 which will be deprecated on January 31st, 2025. You probably want the v3 docs.

Parameters

eventId
string
required

The event ID to get the details for. This is returned when calling either client.sendEvent() or io.sendEvent().

Returns

id
string | undefined

The event ID.

name
string | undefined

The event name.

createdAt
Date | undefined

When the event was created

updatedAt
Date | undefined

When the event was last updated

runs
Run[] | undefined
const event = await client.getEvent(anEventId);
if (event.runs.length === 0) {
  throw new Error("No runs");
}