Table of Contents

Class FlowRunTimeline

Namespace
FlowOrchestrator.Core.Storage
Assembly
FlowOrchestrator.Core.dll

Derives a run's chronological timeline from data every store already keeps: the run record and the per-execution rows of Attempts.

public static class FlowRunTimeline
Inheritance
FlowRunTimeline
Inherited Members

Remarks

Replaces the persisted FlowEvents log removed in 2.0. That log cost two extra awaited store commits per step on the execution path and duplicated what FlowRuns and FlowStepAttempts already record, so the timeline is now rebuilt on read instead.

Fields

RunCompleted

Entry type for the run reaching a terminal status.

public const string RunCompleted = "run.completed"

Field Value

string

RunStarted

Entry type for the run's start.

public const string RunStarted = "run.started"

Field Value

string

StepCompleted

Entry type for an attempt that finished with a non-failed terminal status.

public const string StepCompleted = "step.completed"

Field Value

string

StepFailed

Entry type for an attempt that failed.

public const string StepFailed = "step.failed"

Field Value

string

StepPending

Entry type for an attempt that ended non-terminally (a poll or signal wait that will run again, or a loop waiting on its iterations).

public const string StepPending = "step.pending"

Field Value

string

StepSkipped

Entry type for a step that was skipped (unmet runAfter, a false When clause, or a terminated run).

public const string StepSkipped = "step.skipped"

Field Value

string

StepStarted

Entry type for an attempt starting to execute.

public const string StepStarted = "step.started"

Field Value

string

Methods

Build(FlowRunRecord)

Builds the timeline of run: run.started, then per step attempt a step.started plus its outcome (step.completed / step.failed / step.pending), a single step.skipped for skipped steps, and finally run.completed once the run is terminal — ordered by timestamp.

public static IReadOnlyList<FlowEventRecord> Build(FlowRunRecord run)

Parameters

run FlowRunRecord

A run loaded with its steps, as returned by GetRunDetailAsync(Guid). Steps without an attempt history are treated as a single attempt built from the step row.

Returns

IReadOnlyList<FlowEventRecord>

The entries in chronological order, with Sequence numbered from 1.

Remarks

Complexity per call: O(a log a) time and O(a) allocation, where a is the number of attempt rows in the run (one sort over at most two entries per attempt plus the two run entries). Called on read only — never from the engine's step-completion path.

Ties on timestamp keep run.started first, run.completed last, and otherwise the per-attempt order (started before its outcome). A skipped step is reported by its skip entry only: a skip is recorded without the step having executed, so a preceding step.started would be misleading. Consecutive skipped attempts of one step are reported once.