Skip to content

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

APICreates
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.queryTyped read-only query contract

Context Actions

ActionMeaning
serviceTask / activityAutomated side effect
userTaskAssigned durable work
waitForSignalNamed typed external message
sleepDurable timer
parallel / race / quorumStructured concurrency
forEachKeyed durable fan-out
sagaReverse-order compensation
call / spawn / joinChild workflows
callRefJSON-native child call
exposeQueryPublish a read-only snapshot
continueAsNewClose and create the successor

continueAsNewSuggested is true once history reaches the soft limit.

See Also