Task cancellation propagation

Eric Allam

Eric Allam

CTO, Trigger.dev

Image for Task cancellation propagation

Cancelling a task will now propagate the cancellation to all child tasks (and any of their child tasks) that were triggered with either triggerAndWait or batchTriggerAndWait. Previously, only the parent task was cancelled, and child tasks continued to run.

Tasks triggered with trigger or batchTrigger are not affected by this change, since these functions are "fire and forget" and do not wait for the child task to complete.

NOTE

Cancellation of child tasks is best-effort and may not be immediate, depending on how many child tasks are executing. Task runs that are about to complete will sometimes not be cancelled in time.

Deploy your first agent today

Get set up in minutes, either on your own or with your coding agent.

Get started for free