WorkflowCancellationPolicy class
Controls how the workflow runtime auto-cancels runs.
Policies are persisted with the run and evaluated by the runtime whenever a run suspends or before each step is executed. Limits apply per run and do not prevent manual cancellation.
Constructors
- WorkflowCancellationPolicy({Duration? maxRunDuration, Duration? maxSuspendDuration})
-
Creates a cancellation policy for a workflow run.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether no limits are configured.
no setter
- maxRunDuration → Duration?
-
Maximum wall-clock time the workflow may run before being cancelled.
final
- maxSuspendDuration → Duration?
-
Maximum duration a single suspension (sleep/event wait) may last.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{Duration? maxRunDuration, Duration? maxSuspendDuration}) → WorkflowCancellationPolicy - Returns a copy of this policy with updated values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> - Serializes this policy to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Object? source) → WorkflowCancellationPolicy? - Parses a cancellation policy from JSON.