Common Design Patterns
Reusable workflow structures for resource ownership, concurrency, durable waiting, and operator interaction.
- Cleanup supervisor (saga) — keep resource creation and cleanup in a small parent workflow while complex work runs in a child.
- Generation reconciler for long-running workflows: periodically replace obsolete or duplicate cancellable workflows while preserving durable execution history.
- Parallel fan-out and durable polling — submit independent work through join sets and poll external state with bounded durable sleeps.
- Human-in-the-loop signals — use stub activities for approvals, operator input, and external signals.
- Durable mailbox and notification channel — keep an always-outstanding offer stub as an inbox and self-fulfil a second stub as a progress outbox, sharing one WIT folder between the workflow and its stubs.
- Stub RPC (typed oneshot channels) — pair two stubs into request/response RPC that bridges a synchronous webhook onto a durable workflow.
- Self-fulfilled stub events publishes structured intermediate workflow output by submitting and immediately fulfilling a stub.