Design Patterns
View as MarkdownReusable Flow shapes from the Dex examples. Each pattern page explains the problem and the approach, and links to multi-language code.
Flow control
- Parallel Steps — Choose static, dynamic, await-all, or first-win concurrent Step coordination.
- Parallel SubFlows — Fan out work to SubFlows, bound parent concurrency, partition across parents, and add durable back pressure.
- Interruptible execution — Stop or redirect long work gracefully based on durable control signals.
- Durable Timer — Choose cron schedules, reminders, or an inactivity tracker.
Reliability
- Failure Handling — Recover from execute or wait failures, escalate to an operator, or enforce a business deadline.
- Polling — Wait for an external system in one long-running Step.
Messaging
- Drain Channels — Finish a Flow after its internal or external Channel messages are processed.
- Responsive Update — Return at a Step boundary, wait for durable state, or stream incremental updates.
- Inbound Event Loop — Take inbound messages until a resolution arrives or the conversation goes quiet.
Data
- AttributeMap Partitioning — Split a growing collection into bounded chunks or hash partitions.
- Entity Flow with SQL Projection — Project durable per-entity Flow Attributes into an application-owned SQL table.
Full samples live under examples/. Try the HTTP samples from the examples playground.