Skip to main content

Interface: Activation

Split a history into activations (C-HIST, spec 04 §2).

An activation is what one workflow task saw and did: the input events it delivered to the code, the clock it ran with, and (for completed tasks) the command events it appended. Replaying a history means running the code through the same activations in order and checking that each completed one issues the commands it recorded; the last, open activation then produces the new commands.

The rules:

  1. A boundary is a WORKFLOW_TASK_STARTED followed (input events may interleave) by WORKFLOW_TASK_COMPLETED of the same taskId. A Started followed by Failed or TimedOut is not a boundary; its inputs carry over.
  2. Activation k delivers the inputs appended before its Started, up to the history length the task was leased with (payload.historyLength, written on transient attempts, else the Started event's own seq).
  3. Inputs appended after that (while the task ran) belong to activation k+1.
  4. Command events after Completed(k) belong to activation k.
  5. The clock of activation k is payload.startedAt of its Started event when present, else the event time. The open activation uses nowMs.
  6. The history length activation k reports is its cutoff (rule 2); the open activation reports the leased length.

Properties​

historyLength​

historyLength: number

The history length the task saw when it started (what ctx.info.historyLength and continueAsNewSuggested report during the activation, so replay sees the same values the original task did).


inputs​

inputs: RunEventRecord[]

Input events to deliver, in history order.


recorded​

recorded: RunEventRecord[]

Command events the task appended; undefined for the open (new) activation.


taskId?​

optional taskId?: string

The completed task's id.


timeMs​

timeMs: number

The workflow clock during the activation.