WorkflowRuntime
WorkflowRuntime is the durable orchestrator. It is not WorkflowEngine. Construct it with storage and modules.
dart
WorkflowRuntime({
required WorkflowStorage storage,
WorkflowRegistry? workflows,
ActivityRegistry? activities,
Iterable<WorkflowModule> modules = const [],
WorkflowObserver observer = const NoopWorkflowObserver(),
WorkflowRuntimeOptions options = const WorkflowRuntimeOptions(),
});Direct Runtime API
| API | Purpose |
|---|---|
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 |
loadUserTask | Load one projected task |
claimUserTask / releaseUserTask | Pooled assignment |
completeUserTask | Record response and resume |
signal | Idempotent external message |
cancel | Cancel a run and runnable commands |
retryActivity | Retry exhausted work |
redrive | Re-evaluate a failed or stuck run |
fireDueTimers | Fire due timers |
expireDueUserTasks | Expire bounded tasks |
recoverRunnableRuns | Resume interrupted decisions |
runOneServiceTask | Lease and execute one activity |
runOneWorkflowSpawn | Reconcile 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.