Instance methods
TriggerClient: getRun() instance method
The getRun()
method gets the details for a given Run.
Parameters
runIdrequired
string
The Run ID you want to get the details for
options
Object
Returns
id
string | undefined
The id of the run
status
RunStatus | undefined
The status of the run. Can be one of the following: PENDING
, CANCELED
,
SUCCESS
, QUEUED
, WAITING_ON_CONNECTIONS
, PREPROCESSING
, STARTED
,
FAILURE
, TIMED_OUT
, ABORTED
startedAt
Date | undefined
The time the run started
completedAt
Date | undefined
The time the run completed
output
any
Whatever you returned from your run function, can be undefined
tasks
Task[]
The tasks from the run
nextCursor
string
If there are more tasks, you can use this to get them
// jobs/myJobs.ts
client.defineJob({
id: "my-job",
...
});
// someFile.ts
...
const runs = await client.getRuns("my-job");
if (runs.length === 0) {
throw new Error("No runs found");
}
const runDetail = await client.getRun(runs[0].id);
console.log(runDetail.tasks.length);
...
Was this page helpful?
// jobs/myJobs.ts
client.defineJob({
id: "my-job",
...
});
// someFile.ts
...
const runs = await client.getRuns("my-job");
if (runs.length === 0) {
throw new Error("No runs found");
}
const runDetail = await client.getRun(runs[0].id);
console.log(runDetail.tasks.length);
...