Registration
The graph engine registered executors through WorkflowDescriptor and a RegistryTypeResolver. The durable runtime registers contracts through WorkflowModule.
WorkflowModule
A product exports one module. The server installs it at construction. There is no per-definition registration call after start().
final orders = WorkflowModule(
name: 'orders',
workflows: [orderApproval, fulfillment],
activities: [
ActivityBinding.from(
reserve,
(context, order) => reservationService.reserve(
order,
idempotencyKey: context.idempotencyKey,
),
),
],
userTasks: [approve],
signals: [paymentReceived],
);WorkflowRuntime and WorkflowServerApplication take the same modules list. Registration becomes immutable after the server starts.
What a Module Installs
| List | Meaning |
|---|---|
workflows | Executable Dart or compiled JSON definitions |
activities | Versioned handlers bound to activity contracts |
userTasks | Assigned-work contracts and codecs |
signals | External-message contracts |
Do not wrap a single definition in its own helper module. Put related definitions in one product module.
Catalog Validation
Active workflow_versions rows must match code already linked into the worker. PostgreSQL cannot manufacture Dart functions. A digest mismatch fails startup instead of replaying history against the wrong binary.
Legacy Descriptors
WorkflowDescriptor still exists on LegacyWorkflowEngine for graph definitions that have not finished. New code does not add descriptors.