March Docs

Conduit.EventStore

Functions

fnappendappend(storage : s, workflow_id : String, sequence : Int, event_type : String, payload : String) : Result(Int, String)#

Append an event to the store.

Returns the event id on success.
fncheckpoint_payloadcheckpoint_payload(name : String, value : String, duration_ms : Int) : String#

Build a JSON event payload for a checkpoint event.

Format: {"name":"full_name","value":"...","duration_ms":42}
fncountcount(storage : s, workflow_id : String) : Result(Int, String)#

Return the total number of events recorded for a workflow.

fnextract_valueextract_value(payload : String) : String#

Extract the 'value' field from a checkpoint event payload.

fnload_allload_all(storage : s, workflow_id : String) : Result(List(Conduit.WorkflowEvent), String)#

Load all events for a workflow in sequence order.

fnload_up_toload_up_to(storage : s, workflow_id : String, max_sequence : Int) : Result(List(Conduit.WorkflowEvent), String)#

Load events for a workflow up to and including max_sequence.

fnreplay_keyreplay_key(workflow_id : String)#

The Vault namespace key used for replay state of a given workflow.

fnwarm_replaywarm_replay(storage : s, workflow_id : String) : Result((), String)#

Load all events for a workflow into Vault and set replay mode.

After this call, `WorkflowContext.checkpoint` will use the event store
instead of the normal checkpoint DB path. Events already recorded are
replayed (fn skipped); new checkpoints beyond the recorded events
execute normally and append new events.
fnwarm_replay_towarm_replay_to(storage : s, workflow_id : String, max_sequence : Int) : Result((), String)#

Load events up to a given sequence for point-in-time replay.

Same as warm_replay but only loads events with sequence <= max_sequence.