Skip to main content

Module record

Module record 

Expand description

Journal records.

A record is one fact about one workflow run. The same Record type is used borrowed (RecordRef, for encoding on the hot path) and owned (RecordBuf, after decoding). Records have two encodings:

  • Segment: inside a log segment. Workflow type and step names are interned per segment: the first record that uses a name defines it in a prefix, later records refer to it by a small integer.
  • Canonical: names written inline. Used for journals held in memory, spilled run blobs, checkpoints, replication and the server protocol, so a record means the same thing wherever it travels.

Modules§

kind
origin
policy
The policy byte of a Start record (and the flags of a Child record, which become the child’s start policy). Recorded so replay and recovery apply the same rules.
stream
Streams (ctx.stream).
value_kind
Recorded nondeterministic values (ctx.now(), ctx.random(), …).

Structs§

Inline
Canonical encoding: names inline.
InlineDecoder
Canonical decoding. Repeated names share one allocation.
Origin
Where a run came from, when it is not a fresh start.
ParentRef
The parent of a child workflow: the shard and run that started it and the journal position that waits for its result.
StartMeta
The rare fields of a Start record, boxed so every record stays small.
StartUpdate
An update carried by a Start record (update-with-start).
StepTime
When a step ran: recorded under the dev profile only (production steps read no clock for it and write no byte), for the UI’s timeline.

Enums§

Record
A journal record.
Status
How a step, child or workflow ended.
WaitOutcome
The outcome of a Waited record.

Constants§

PAUSED
The retry_at_ms of an Attempt whose step is paused: retried only once a Record::Resume follows.

Traits§

NameDecoder
How names are read from a record body.
NameEncoder
How names are written into a record body.
ToName
A record’s string field as a Name: shared when it is one already, allocated when borrowed.
ToPayload
A record’s payload as a Payload: shared when it is one, copied when borrowed.

Functions§

decode_body
Decodes a record body produced by encode_body. Fails on trailing bytes.
decode_canonical_all
Decodes a concatenation of encode_canonical records.
decode_canonical_into
decode_canonical_all into out (cleared first), with a name cache the caller keeps: names repeated across journals (workflow types, step names) are then decoded without allocating.
encode_body
Encodes the record body: the kind byte, then fields. defines holds new interned names to define in a prefix (segment encoding only).
encode_canonical
Canonical encoding of one record, appended to out with a varint length prefix so records can be concatenated into journals and blobs.
start_record
A plain start record (no origin, copies or update).

Type Aliases§

Lsn
Name
Payload
RecordBuf
RecordRef
RunId
Seq