Enum Record
pub enum Record<S, B> {
Show 24 variants
Start {Show 14 fields
run: RunId,
id: S,
wtype: S,
version: u32,
codec: u8,
started_ms: u64,
deadline_ms: u64,
parent: Option<ParentRef>,
policy: u8,
from: Option<Origin>,
copies: u32,
update: Option<Box<StartUpdate<S, B>>>,
input: B,
meta: Option<Box<StartMeta<B>>>,
},
Step {
run: RunId,
seq: Seq,
name: S,
attempt: u32,
status: Status,
payload: B,
time: Option<StepTime>,
},
Attempt {
run: RunId,
seq: Seq,
name: S,
attempt: u32,
retry_at_ms: u64,
error: B,
},
Timer {
run: RunId,
seq: Seq,
name: S,
fire_at_ms: u64,
},
Fired {
run: RunId,
seq: Seq,
},
Signal {
run: RunId,
name: S,
dedup: u64,
payload: B,
by: Option<B>,
},
Wait {
run: RunId,
seq: Seq,
name: S,
deadline_ms: u64,
},
Waited {
run: RunId,
seq: Seq,
outcome: WaitOutcome,
},
Value {
run: RunId,
seq: Seq,
kind: u8,
value: B,
},
Child {
run: RunId,
seq: Seq,
wtype: S,
id: S,
flags: u8,
deadline_ms: u64,
input: B,
},
ChildDone {
run: RunId,
seq: Seq,
status: Status,
payload: B,
},
Send {
run: RunId,
seq: Seq,
target: S,
name: S,
payload: B,
},
Cancel {
run: RunId,
reason: B,
by: Option<B>,
},
Done {
run: RunId,
status: Status,
finished_ms: u64,
payload: B,
by: Option<B>,
},
Update {
run: RunId,
name: S,
id: S,
payload: B,
caller: Option<ParentRef>,
},
UpdateDone {
run: RunId,
seq: Seq,
ordinal: u64,
status: Status,
payload: B,
state: B,
},
Heartbeat {
run: RunId,
seq: Seq,
attempt: u32,
payload: B,
},
Awaiting {
run: RunId,
seq: Seq,
name: S,
attempt: u32,
},
Completed {
run: RunId,
seq: Seq,
attempt: u32,
status: Status,
payload: B,
},
Patch {
run: RunId,
at: Seq,
id: S,
},
Attributes {
run: RunId,
seq: Seq,
payload: B,
},
Chunk {
run: RunId,
seq: Seq,
attempt: u32,
stream: S,
offset: u64,
payload: B,
},
StreamEnd {
run: RunId,
seq: Seq,
stream: S,
chunks: u64,
status: Status,
},
Resume {
run: RunId,
seq: Seq,
attempt: u32,
by: Option<B>,
},
}Expand description
A journal record.
Audit: the by of a Signal, Cancel, Done (terminate, reset) or a
reset’s Start names who asked, as the API that took the request saw
them (a token’s scope, a proxy’s identity header, a CLI user). It is
written after the record’s other fields only when present, so records
without it carry no extra bytes.
Variants§
Start
A run was created. Its acknowledgment is released once durable.
Fields
id: Swtype: Scopies: u32How many of the run’s following records are copies from
from’s journal (reset). Their messages are not sent again.
update: Option<Box<StartUpdate<S, B>>>An update delivered in the same record (update-with-start). Boxed: rare, and it keeps every record small.
input: BStep
A step finished (or was cancelled). Delivered to code in journal order.
Attempt
A step attempt failed and will be retried at retry_at_ms.
Timer
A durable timer was set (ctx.sleep).
Fired
A durable timer fired and its sleep returned. Delivered.
Signal
A signal arrived. Its acknowledgment is released once durable.
dedup (0 = none) suppresses repeated deliveries of the same message.
Wait
The run began waiting for a signal; deadline_ms 0 means no timeout.
Waited
A wait finished. Delivered.
Value
A recorded nondeterministic value.
Child
The run started a child workflow. Sent once durable. flags is the
child’s start policy (policy).
ChildDone
A child workflow finished. Delivered.
Send
The run sent a signal to another workflow. Sent once durable.
Cancel
Cancellation was delivered: every operation pending at this point in
the journal ends with Status::Cancelled. Delivered.
Done
The run finished. Its result is released once durable.
Fields
payload: BUpdate
An update passed its validator and was accepted. Delivered: the handler starts at this point in the journal. Its ordinal is the number of updates the run accepted before it.
UpdateDone
An update’s handler returned. Its result is released once durable.
Fields
payload: Bstate: BAn object’s state changes the handler commits with its result (an encoded JSON object, sealed by the codec; empty for none).
Heartbeat
A running step reported progress (only the latest is kept).
Awaiting
An asynchronously completed step handed out its token for attempt
and now waits for engine.complete or engine.fail.
Completed
An asynchronously completed step got its result. Delivered.
Patch
ctx.patched(id) took the new branch at journal position at. Takes
no position itself, so adding or removing patches never shifts the
journal.
Attributes
Search attributes set by the code (a JSON object, never encrypted).
Chunk
A chunk appended to one of the run’s streams (ctx.stream). seq
and attempt name the step attempt that wrote it, or are
stream::WORKFLOW and 0 for workflow code; offset is its place
in the stream (0, 1, 2, …). Takes no journal position.
StreamEnd
A stream was completed after chunks chunks: closed by workflow
code (seq stream::WORKFLOW) or by a step, or by the final
result of the step that wrote it (status is that result’s).
Resume
A paused step (an Attempt whose retry_at_ms is PAUSED) was
resumed: its next attempt runs at once with a fresh retry budget.
attempt is the step’s last attempt before it.
Implementations§
§impl<S, B> Record<S, B>
impl<S, B> Record<S, B>
pub fn map<'a, S2, B2>(
&'a self,
n: impl Fn(&'a S) -> S2,
p: impl Fn(&'a B) -> B2,
) -> Record<S2, B2>
pub fn map<'a, S2, B2>( &'a self, n: impl Fn(&'a S) -> S2, p: impl Fn(&'a B) -> B2, ) -> Record<S2, B2>
The same record with its names and payloads converted.