Skip to content

WorkflowRuntime ​

WorkflowRuntime is the durable orchestrator. It is not WorkflowEngine. Construct it with storage and modules.

dart
WorkflowRuntime({
  required WorkflowStorage storage,
  WorkflowRegistry? workflows,
  OperationRegistry? operations,
  Iterable<WorkflowModule> modules = const [],
  WorkflowObserver observer = const NoopWorkflowObserver(),
  WorkflowRuntimeOptions options = const WorkflowRuntimeOptions(),
});

Direct Runtime API ​

APIPurpose
start(ref, input)Typed start
startEncoded(key, input)Wire/JSON start
drive(runId)Replay until blocked or terminal
requireState(runId)Load run, history, and commands
query(runId, name)Read-only published query
loadWorkItemLoad one projected work item
claimWork / releaseWorkManage pooled audience
respondRecord an actor response and resume
sendEventSend an idempotent external event
cancelCancel a run and runnable commands
retryOperationRetry an exhausted operation
redriveRe-evaluate a failed or stuck run
fireDueTimersFire due timers
expireDueWorkExpire bounded work
recoverRunnableRunsResume interrupted decisions
runOneOperationLease and execute one operation
runOneWorkflowSpawnReconcile one spawn command

Starts accept an optional run ID, correlation ID, and WorkflowRunMetadata.

Options ​

dart
const WorkflowRuntimeOptions({
  int maxHistoryEvents = 50000,
  int continueAsNewSuggestedAt = 10000,
});

Production Host ​

Most products use WorkflowServerApplication from vyuh_workflow_service instead of calling these methods directly.

See Also ​