What is fate?
fate is a statechart engine for Go.
It implements Harel statecharts — hierarchical states, parallel regions, and deep/shallow history — not a flat finite automaton. It is inspired by the semantics of SCXML and XState v5, expressed idiomatically in Go with strong typing via generics.
go
import "github.com/arisros/fate"The name is not an acronym. It is a statechart engine.
What you get
- Real statecharts. Hierarchy, parallelism, history, guards, actions, delayed transitions, and invoked/spawned child actors — the full statechart feature set, not a glorified
switchstatement. - Zero dependencies. The engine imports only the standard library. The optional Temporal integration lives in a separate module, so you never pull in the Temporal SDK unless you ask for it.
- Deterministic & persistable. A
Machineis immutable and shareable; anActor's state serialises to JSON and restores byte-for-byte. Safe to drive from deterministic environments such as Temporal workflows. - Typed. Context and events are your own Go types, checked at compile time via generics — no
interface{}soup, no string-keyed context bags.
What it is not
- It is not a workflow runtime. fate computes the next state; it never sleeps, calls the network, or touches the clock. An adapter performs effects. See How it works.
- It is not the studio. The visual viewer and live simulator, fate-studio, is a separate project so the engine stays dependency-free.
Status
Pre-release (v0.x)
The API may change between minor versions until v1.0.0. Breaking changes are flagged explicitly in the changelog under a Breaking heading. See Versioning & deprecation for the policy.
Next
- New here? → Background & the problem explains why statecharts.
- Want code now? → Getting started.
- Curious how it stays deterministic? → How it works.