Skip to content

Examples

Each example is a complete, runnable TypeScript file demonstrating a different combination of workflow features. All code is copy-pasteable.

ExampleKey features
Purchase Order ApprovalLinear flow, typed Zod payloads, named guards, getSnapshot / restoreInstance
Engineer Pre-Departure ChecklistForkState, JoinState mode:'all', inline guard with Zod literal
OCC Service Disruption SOPMulti-role named guards, fork + join + wait state combined, JsonGraphExporter
Station Opening ChecklistSequential flow, canExecute for UI affordances, snapshot hand-off / crash recovery

How to run an example locally

sh
cd flowyd
pnpm build
npx tsx examples/<filename>.ts

Released under the MIT License.