Skip to content

process-manager

Stateful coordinator that drives a long-running flow. See Concepts: Process Manager.

Fields

Field Required Description
apiVersion yes schema.esdm.io/core/v1
kind yes process-manager
name yes The Process Manager name.
scope yes scope.domain reference.
deliveryGuarantee yes at-least-once or at-most-once.
idempotency required when deliveryGuarantee is at-least-once The idempotency strategy.
correlatedBy yes How an incoming Event maps to a running instance.
state yes JSON Schema describing per-instance state.
startsWhen yes The Event reference that triggers a new instance.
endsWhen yes The condition under which an existing instance terminates.
reactions no Per-trigger reactions, each carrying its own when/rule/emits/setTimers/cancelTimers.
timers no Timer definitions the Process Manager may arm.
invariants no Named rules every instance's state must satisfy.
constraints no Entity-wide activation conditions.
description no Free-form prose.
metadata no Non-semantic labels and annotations.

correlatedBy

Discriminated oneOf on source. Today, the only variant is:

source Sibling field Description
event-field field The instance key is the value of a named field that must exist on every Event in startsWhen and in any reactions[].when Event.

reactions[]

Each reaction binds an Event trigger to a per-trigger logic block: when (the Event), rule (prose), and any of emits (Command references), setTimers (timer activations), cancelTimers (timer deactivations).

timers[]

Timer definitions. Each timer carries the field that triggers its scheduling, the duration after which it fires, and the Commands it emits.

Example

apiVersion: schema.esdm.io/core/v1
kind: process-manager
name: round-publishing-flow
scope:
  domain: golf-club-management
deliveryGuarantee: at-least-once
idempotency:
  strategy: deduplication-key
  key: roundId
correlatedBy:
  source: event-field
  field: roundId
state:
  type: object
  properties:
    roundId: { type: string }
    status: { type: string, enum: [draft, scheduled, published] }
  required: [roundId, status]
startsWhen:
  boundedContext: round-play
  aggregate: round
  event: round-drafted
endsWhen:
  rule: The instance ends when the round has been published or canceled.