Workflow and Context
Workflow is the namespace for durable contracts. WorkflowContext is the argument to execute. There is no WorkflowBuilder graph API on this surface.
Construction
| API | Creates |
|---|---|
Workflow.ref<I, O>(code:, version:) | Typed reference |
Workflow.activity<I, O>(...) | Automated-work contract |
Workflow.userTask<R>(...) | Assigned-work contract |
Workflow.signal<P>(...) | External-message contract |
Workflow.define<I, O>(...) | Typed Dart workflow |
Workflow.defineJson<I, O>(...) | JSON-native Dart workflow |
Workflow.fromJson(document) | Compiled JSON document |
Workflow.document(document) | Compile an existing WorkflowDocument |
Workflow.query | Typed read-only query contract |
Context Actions
| Action | Meaning |
|---|---|
serviceTask / activity | Automated side effect |
userTask | Assigned durable work |
waitForSignal | Named typed external message |
sleep | Durable timer |
parallel / race / quorum | Structured concurrency |
forEach | Keyed durable fan-out |
saga | Reverse-order compensation |
call / spawn / join | Child workflows |
callRef | JSON-native child call |
exposeQuery | Publish a read-only snapshot |
continueAsNew | Close and create the successor |
continueAsNewSuggested is true once history reaches the soft limit.