Getting started
Examples
Five small applications, each in Python, TypeScript, Rust, Go and Java. They
print the same results in every language, and scripts/check_examples.sh
runs all twenty-five in CI.
| Python | TypeScript | Rust | Go | Java | |
|---|---|---|---|---|---|
| Payment saga: reserve, charge, wait for shipping; compensations undo on failure | py | ts | rs | go | java |
| Agent loop: model and tool calls, each a step | py | ts | rs | go | java |
| Scheduled job: a schedule starts a report each second (a cron expression in a real job) | py | ts | rs | go | java |
| Human approval: ask, wait up to three days for a decision, act on it | py | ts | rs | go | java |
| Cart object: one object per user, calls that take turns, a repeated call that runs once | py | ts | rs | go | java |
Each keeps its data in ./data/<example> under the directory it runs
from, and its workflow IDs attach to an earlier run (use-existing), so
running one again, or killing it midway and running it again, continues
where it was.
Run one:
PYTHONPATH=bindings/python/python python3 examples/python/payment_saga.py
cargo run --release -p fusee --example payment_saga
(cd examples/go && go run ./payment_saga)
java -cp bindings/java/target/classes examples/java/PaymentSaga.javaThe TypeScript examples import fusee: run them from a project where it is
installed (npm install @bitsinfra/fusee), as scripts/check_examples.sh arranges.
invoked_worker.py and invoked-worker.mjs show a worker the server
starts on demand (server mode).