Type Alias: Run {#type-alias-run}

Run = object

A run represents a single execution of a process handler in response to an event. Runs track their full lifecycle from creation through completion or failure.

Properties {#properties}

attempt {#attempt}

attempt: number

Current retry attempt number (0 for the first execution).


childRunIds {#childrunids}

childRunIds: string[]

IDs of runs triggered by this run’s handler via triggerEvent.


completedAt {#completedat}

completedAt: number | null

Unix epoch timestamp (ms) when the run reached a terminal state, or null.


context {#context}

context: Record<string, unknown>

Mutable key-value store scoped to the correlation chain.


correlationId {#correlationid}

correlationId: string

Shared identifier linking all runs in the same causal chain.


depth {#depth}

depth: number

Chain depth (0 for root runs, incremented for each chained event).


eventName {#eventname}

eventName: string

The event name that triggered this run.


handlerVersion {#handlerversion}

handlerVersion: string | null

Version string of the handler that processed this run, or null.


heartbeatAt {#heartbeatat}

heartbeatAt: number | null

Unix epoch timestamp (ms) of the last heartbeat, or null.


id {#id}

id: string

Unique identifier for this run.


idempotencyKey {#idempotencykey}

idempotencyKey: string | null

Idempotency key used to deduplicate this run, or null.


leaseExpiresAt {#leaseexpiresat}

leaseExpiresAt: number | null

Unix epoch timestamp (ms) when the current lease expires, or null.


leaseOwner {#leaseowner}

leaseOwner: string | null

Identifier of the worker that currently holds the lease, or null.


parentRunId {#parentrunid}

parentRunId: string | null

ID of the run that triggered this one, or null for root runs.


payload {#payload}

payload: unknown

The event payload passed to the handler.


processName {#processname}

processName: string

Name of the registered process that owns this run.


result {#result}

result: HandlerResult | null

Handler result, or null if the run has not completed.


retryAfter {#retryafter}

retryAfter: number | null

Unix epoch timestamp (ms) after which a retry may execute, or null.


startedAt {#startedat}

startedAt: number

Unix epoch timestamp (ms) when the run was created.


state {#state}

state: ProcessState

Current lifecycle state of the run.


timeline {#timeline}

timeline: TimelineEntry[]

Ordered log of every state transition this run has undergone.