Examples
The following examples demonstrate various usage scenarios of the acts workflow engine.
Basic Examples
| Example | Description | Path |
|---|---|---|
| Simple Loop | Using JavaScript to implement a loop accumulator | examples/simple |
| While Loop | Accumulating with a while condition step | examples/while |
| Model Builder | Building workflows via Rust Builder API | examples/model_build |
Interaction Examples
| Example | Description | Path |
|---|---|---|
| Action Interaction | Using IRQ interrupts to interact with clients | examples/actions |
| Approval Process | Multi-role approval workflow (PM, GM) | examples/approve |
| Message Notification | Using MSG to send one-way notifications | examples/message |
Error & Timeout
| Example | Description | Path |
|---|---|---|
| Error Handling | Using catches to capture and handle errors | examples/catches |
| Timeout Handling | Using timeouts to handle step timeouts | examples/timeout |
Advanced Features
| Example | Description | Path |
|---|---|---|
| Event Driven | Using on events to trigger workflow start | examples/event |
| Subflow | Using subflow to call child workflows | examples/subflow |
| Custom Package | Creating and registering custom packages | examples/package |
| Custom Variables | Registering and using custom user variables | examples/user_var |
Plugin Examples
| Example | Description | Path |
|---|---|---|
| HTTP Request | Sending HTTP requests via acts-package-http | examples/plugins/http |
| Shell Execution | Executing shell scripts via acts-package-shell | examples/plugins/shell |
| State Management | Managing state via acts-package-state | examples/plugins/state |
Running Examples
# Run approval process example
cargo run --example approve
# Run error handling example
cargo run --example catches
# Run timeout handling example
cargo run --example timeout