Jidoka.Workflow.Snapshot (Jidoka v0.9.0)

Copy Markdown View Source

Serializable state for one suspended declarative workflow.

Runtime-only context is not stored. Pass fresh runtime context when the workflow resumes. The binary format is not authenticated. Deserialize it only from trusted application storage.

Summary

Functions

Restores a workflow snapshot from Erlang external term format.

Returns the current workflow snapshot schema version.

Serializes a workflow snapshot to Erlang external term format.

Types

t()

@type t() :: %Jidoka.Workflow.Snapshot{
  context: map(),
  input: map(),
  loop_cursor: Jidoka.Workflow.Loop.Cursor.t(),
  outcomes: map(),
  schema_version: pos_integer(),
  steps: map(),
  workflow: module(),
  workflow_id: String.t()
}

Functions

deserialize(binary)

@spec deserialize(binary()) :: {:ok, t()} | {:error, term()}

Restores a workflow snapshot from Erlang external term format.

schema_version()

@spec schema_version() :: pos_integer()

Returns the current workflow snapshot schema version.

serialize(snapshot)

@spec serialize(t()) :: {:ok, binary()} | {:error, term()}

Serializes a workflow snapshot to Erlang external term format.