State Machines (id_effect_fsm)
The id_effect_fsm crate adds typed finite-state machines and sagas on top of id_effect, plus a gen_statem-style process behaviour for running a machine under supervision.
Why FSMs in an effect library?
Business logic often has explicit states (order lifecycle, connection handshake, approval gates). A pure transition table keeps routing declarative; Effect values attach side effects to the edges, and the whole transition is itself an Effect you compose and interpret like any other.
Crate layout
TransitionTable/StateMachine— immutable edge map, current state + purestepFsm+#[derive(Fsm)]— declare the initial state and edges on an enumInterpreter— Effect-valued transition actions;step/runreturn anEffectFsmProcess/FsmHandle— host a machine in anid_effect_processprocess (events are mailbox messages)Statem/StatemProcess—gen_statemparity: data-carrying states with a separateData, state/event/generic timeouts, postpone, inserted events and replies (see Statem behaviour)Saga/SagaStep— forward steps with LIFO compensation, as oneEffectto_mermaid— documentation diagrams
Durable state machines
To make a machine survive restarts, drive it from a durable workflow of the published id_effect_workflow crate: events arrive as signals and each transition is a journaled step (see Workflow bridge and Workflow and cluster).