# `Jidoka.Workflow.Snapshot`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/workflow/snapshot.ex#L1)

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.

# `t`

```elixir
@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()
}
```

# `deserialize`

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

Restores a workflow snapshot from Erlang external term format.

# `schema_version`

```elixir
@spec schema_version() :: pos_integer()
```

Returns the current workflow snapshot schema version.

# `serialize`

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

Serializes a workflow snapshot to Erlang external term format.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
