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);
The cancelRunsForEvent() instance method will cancel all the job runs (yet to be executed) that are triggered by a given eventId.
Copy
Ask AI
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);
List of Job Run IDs that have failed to be cancelled.
Copy
Ask AI
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);