Example index
The examples/ directory contains 31 runnable programs. Start with sequential_steps, then choose the group matching your production concern. Examples use temporary resources or explicit environment variables and never connect to a production service automatically.
Prepare
Flow 1.1 requires Rust 1.88. SQL examples compile their selected driver on first use and take longer than memory examples.
Steps and business orchestration
A useful order is sequential_steps, retry_backoff, recoverable_step_failure, then compensation. It exposes success, redelivery, exhaustion, and compensation boundaries one at a time.
Waits, signals, and callbacks
For an HTTP callback, run hook_approval to see token resolution, then read reliable redelivery in Signals and hooks. The example demonstrates Flow calls only and does not provide HTTP serving or authentication.
Long runs, rollout, and parent-child execution
Rollout examples use memory storage to isolate their contract. Production also needs exact runtime-build routes from Workers and rollout.
Local persistence
These examples work in temporary directories or files and clean their resources. Read owner and backup requirements in Stores and migrations before using a real path.
PostgreSQL
PostgreSQL examples connect only after A3S_FLOW_POSTGRES_URL is set.
Use a dedicated test database. Examples may create or migrate Flow tables and must never target production.
Tasks and workers
Task retry and step retry belong to different layers. Read lease recovery in task_queue_durability before host policy in boot_task_policy.
Observation and audit
Observers run after event commit. The examples deliberately keep observation output out of workflow decisions.
Native TypeScript
Install the compiler and make Bun available first.
Without the compiler environment variable, both examples print instructions and skip safely. See Native TypeScript for production configuration.
Workflow graph import
workflow_dsl_import accepts a YAML path and prints application data, version classification, node count, scopes, and execution digest.
Graph import validates structure and derives a plan without executing nodes. See host binding in Workflow graph.
Suggested production qualification path
When integrating a real service, replace one layer at a time.
- Confirm runtime and step boundaries with
sequential_steps. - Confirm restart recovery with the target SQL example.
- Verify duplicate timer delivery with
scheduler_worker. - Choose the signal or hook example matching ingress.
- Verify cleanup idempotency with
cancellation. - Replace in-process dispatch with task management.
- Inject process loss with the same store and queue as production.
Retain event history and external idempotency records at each stage. When behavior diverges, that evidence identifies which boundary owns the fault.
