WorkflowResult<T extends Object?> class
Typed result returned by StemWorkflowApp.waitForCompletion.
Provides the decoded workflow result (when available) along with the raw RunState so callers can continue inspecting suspension metadata, timestamps, or errors.
Constructors
- WorkflowResult({required String runId, required WorkflowStatus status, required RunState state, T? value, Object? rawResult, bool timedOut = false})
-
Creates a workflow result snapshot.
const
-
WorkflowResult.fromJson(Map<
String, Object?> json) -
Rehydrates a workflow result from serialized JSON.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCompleted → bool
-
Whether the workflow completed successfully.
no setter
- isFailed → bool
-
Whether the workflow failed.
no setter
- rawResult → Object?
-
Untyped payload stored by the workflow, useful for legacy consumers or
debugging scenarios.
final
- runId → String
-
Identifier of the workflow run.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → RunState
-
Snapshot retrieved from the workflow store.
final
- status → WorkflowStatus
-
Terminal or current status when the wait completed.
final
- timedOut → bool
-
Indicates the wait call returned due to the supplied timeout expiring
before the run reached a terminal state.
final
- value → T?
-
Strongly typed value decoded from the persisted workflow result when the
run completed successfully.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
payloadAs<
TResult> ({required PayloadCodec< TResult> codec}) → TResult? -
Decodes the raw persisted workflow result with
codec. -
payloadJson<
TResult> ({required TResult decode(Map< String, dynamic> payload), String? typeName}) → TResult? - Decodes the raw persisted workflow result with a JSON decoder.
-
payloadVersionedJson<
TResult> ({required int version, required TResult decode(Map< String, dynamic> payload, int version), int? defaultDecodeVersion, String? typeName}) → TResult? - Decodes the raw persisted workflow result with a version-aware JSON decoder.
-
requiredValue(
) → T - Returns the decoded value, throwing when it is absent.
-
toJson(
) → Map< String, Object?> - Converts this result to a JSON-compatible map.
-
toString(
) → String -
A string representation of this object.
inherited
-
valueOr(
T fallback) → T -
Returns value or
fallbackwhen the workflow has no decoded result.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited