From 6bf288085b287cc04049a1bf21125a7c448398a5 Mon Sep 17 00:00:00 2001 From: isshaddad Date: Mon, 23 Feb 2026 16:11:07 -0500 Subject: [PATCH] added onCancel note --- docs/tasks/overview.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/tasks/overview.mdx b/docs/tasks/overview.mdx index fe2e7ce5c73..b2bca9bc1e1 100644 --- a/docs/tasks/overview.mdx +++ b/docs/tasks/overview.mdx @@ -535,6 +535,13 @@ export const cancelExampleTask = task({ point the process will be killed. + + `onCancel` only runs if the run is actively executing. If a run is cancelled while queued or + suspended (e.g. waiting for a token), no machine is spun up and `onCancel` will not be called. + This is a known limitation we're planning to address. Follow the progress on our [feedback + board](https://feedback.trigger.dev/p/call-the-onfailure-hook-for-runs-that-were-canceled-expired). + + ### `onStart` function (deprecated) The `onStart` function was deprecated in v4.1.0. Use `onStartAttempt` instead.