Design Patterns
Reusable Flow shapes from the Dex examples. Each pattern page explains the problem, the approach, and links to multi-language code.
- Cron schedule — Run a Flow on a recurring schedule without inventing a scheduler service.
- Drain internal channels — Gracefully finish producer/consumer Flows without losing in-flight channel messages.
- Drain signal channels — Complete short-lived Flows when external channel traffic is drained.
- Interruptible execution — Stop or redirect long work gracefully based on durable control signals.
- Manual intervention — When an API fails, let a human retry or skip without abandoning the Flow.
- Parallel Steps — Run Steps concurrently and optionally await results.
- Parent–child Flows — Start a child Flow and wait for its completion from the parent.
- Polling — Wait on external readiness with simple timers or backoff Step retries.
- Failure recovery — Recover from failed Steps with retries and compensating paths.
- Reminders — Send periodic reminders until opt-out or timeout.
- Resettable timer — Extend or reset a wait window based on fresh activity.
- Scalable parallel — Control fan-out with parent/child Flows for large parallel workloads.
- Storage singleton — Expose a durable key-value style store via RPC on a singleton Flow.
- Timeout — Bound work with graceful timeout and dead-end paths.
- Wait for Step completion — Let callers wait for a Step while background work continues.