const event = client.sendEvent({
  name: "test.job",
});

// Some time later...
const res = await client.cancelRunsForEvent(event.id);

console.log(res.cancelledRunIds);
console.log(res.failedToCancelRunIds);

Parameters

eventId
string
required

The event ID to cancel the job runs for. This is returned when calling either client.sendEvent() or io.sendEvent().

Returns

cancelledRunIds
array
required

List of Job Run IDs that are cancelled.

failedToCancelRunIds
array
required

List of Job Run IDs that have failed to be cancelled.

Was this page helpful?