StaticnonExecute fn with cancellation suppressed. Durable operations
inside the callback will not throw CancelledFailure even if
the workflow has a pending cancellation request. Use this for
cleanup logic (refunds, notifications, audit logs) that must
complete regardless of cancellation state.
The return value of fn.
Controls how cancellation propagates through workflow code.
When a workflow is cancelled via
handle.cancel(), the next durable operation (sleep,proxyActivities,executeChild,condition,continueAsNew) throws a CancelledFailure. UseCancellationScope.nonCancellable(fn)to shield cleanup code from this behavior — durable operations inside the scope will execute normally even when cancellation is pending.Examples