Conduit.WorkflowContext
Functions
fncheckpointcheckpoint(storage : s, ctx : Conduit.WorkflowContext, name : String, f) : Result(String, WorkflowError)#
Execute a durable checkpoint.
- Check in-memory Vault cache for
namespace ++ name. - If cached: return immediately — fn is NOT called.
- Check DB:
conduit_checkpointsfor (workflow_id, full_name). - If found in DB: populate cache and return.
- Otherwise: call fn(), record duration, persist to DB, cache, return.
`f` must return a String (typically JSON-serialized). The return value
is the stored string on success or a WorkflowError on failure.Create a sub-context for a parallel branch (namespaced checkpoints).
Create a root context for a new or resuming workflow execution.
Fan-out over a list of items, each with its own checkpoint sub-namespace.
Each item gets a child context `"parallel:N:"` so its checkpoints are
isolated and resumable independently. Execution is sequential in Phase 4.
`f` takes (item, sub_ctx) and returns Result(String, WorkflowError).
Returns Ok(List(String)) with results in order, or Err on first failure.fnwait_for_signalwait_for_signal(storage : s, ctx : Conduit.WorkflowContext, signal_type : String, timeout : Option(Duration))#
Wait for a signal of signal_type to arrive for this workflow.
Checks the DB immediately for a pending/undelivered signal. If found,
marks it delivered and returns its payload. If not found, polls every
second until a signal arrives or the timeout fires.
Returns Ok(payload_json) or Err(WorkflowError.TimedOut).Load all checkpoints for this workflow from the DB into Vault. Call this once before run() to avoid redundant DB lookups during execution.