Replayer
in package
Re-executes a straight-line workflow Fiber against committed, sequence-ordered history.
Table of Contents
Constants
- CONDITION_DEADLINE_POLICY : mixed = 'occurrence'
- The occurrence-deadline opt-in on an anchored condition-wait open (#269).
- DELIVERY_EVENTS : mixed = ['CooperativeCancellationDelivered', 'Cancellat...
- A delivered cancellation consumes the interrupted call even when that call was never scheduled, and its sequence_span reserves the whole interrupted range, sequence .. sequence + span - 1 inclusive (Core WorkflowStepHistory::nextSequenceFromEvents()).
- DURABLE_COMMAND_KINDS : mixed = ['ActivityScheduled' => 'activity', 'ActivitySt...
- Every durable history event that claims a workflow sequence, by the command kind that owns it, following Core's WorkflowStepHistory::WORKFLOW_STEP_EVENT_TYPES. A command's lifecycle rows (terminal, retry, heartbeat and cancelled rows included) share its sequence. Internal wait-timeout timer rows belong to their wait; see durableCommandKind(). ActivityOutcomeRejected is deliberately absent: it is a payload-free audit fact that neither resolves an activity nor consumes a command position. Rows that only point at a step claim nothing: signal receipt and rejection, updates, message cursors, selection markers, cancellation requests and scope requests or preparations. Cancellation deliveries claim their whole span; see DELIVERY_EVENTS.
- MAX_VERSION : mixed = 2147483647
- MIN_VERSION : mixed = -2147483648
- RUN_CLOSED_CANCELLATION_REASON : mixed = 'run_closed'
- `cancellation_reason` of an ActivityCancelled that the run's own close recorded (complete, fail or continue-as-new) for an activity it never awaited, such as a select() loser (Workflow #1117, Server #1193).
- SEARCH_ATTRIBUTE_MAX_KEYWORD_LENGTH : mixed = 255
- SEARCH_ATTRIBUTE_MAX_STRING_LENGTH : mixed = 2048
- UPSERT_COMMAND_KINDS : mixed = ['memo', 'search_attributes']
- An upsert is the only command at its sequence.
Properties
- $codec : PayloadCodec
- $conditionOccurrenceDeadline : bool
- Whether this task's Server advertises condition_wait_occurrence_deadline.
- $groupedConditionWaitRefusal : callable(): Array|null
- Names the Server that refuses new condition waits inside groups (sdk-php#278), or returns null when they're allowed. Asked only when such a wait is about to be sent.
- $lastBusinessReplayClock : BusinessReplayClock|null
Methods
- __construct() : mixed
- replay() : ReplayResult
- advanceCancellationClock() : void
- anchorNewConditionChain() : WorkflowCommand
- A new top-level chain opts in only when the Server advertises the capability and the call has an occurrence id and a timeout. The budget is the authored timeout; timeout_seconds stays the replay input (#269).
- appendCompleteCommand() : ReplayResult|null
- appendWorkflowCommand() : ReplayResult|null
- Materialize and JSON-validate a command before adding it to the task completion. Once a local activity has run, a later payload failure must return its durable record instead of discarding it on task redelivery.
- assertCancellationCallMatches() : void
- assertCancellationConsumed() : void
- assertCancellationScopeReplaySupported() : bool
- assertCommandMatchesStep() : void
- assertConditionChainPolicy() : void
- Every physical open of one anchored chain names the same policy, its original authored budget and the chain's occurrence; a chain that began without the policy never gains it (#269).
- assertConditionWaitCompatible() : void
- assertDurableHandleExecutionIdentity() : void
- assertNoRemainingSteps() : void
- assertParallelPathMatches() : void
- assertPendingScopeGroup() : void
- assertVersionDecisionCompatible() : void
- assertVersionSupported() : void
- bindConditionReopens() : array<int, array<string, mixed>>
- A physical reopen of one logical condition wait keeps that wait's first opening time and authored timeout. Workers before #269 reopened with the full timeout; later ones reopen with the time remaining, so a reopen may record a smaller timeout than the wait it continues.
- blockingResolutionOrders() : array<int, int>
- cancellationBoundary() : CancellationDelivery|null
- canonicalSearchAttributes() : array<string, null|bool|int|float|string|array<int, string>>
- The canonical replay identity of a search-attribute upsert's values.
- characterLength() : int|null
- childIdentity() : ChildWorkflowIdentity|null
-
collapseConditionReopens()
: array<int, Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list
>, resolution_order: int, physical_condition_steps?: list >>} - commandDetail() : string|null
- completeCommand() : array{type: string, result: array{codec: string, blob: string}}
- conditionDetail() : string
- conditionReopen() : WorkflowCommand
- The command that reopens a recorded condition wait, bounded by the wait's original deadline as embedded await($condition, $timeout) is. The Server satisfies an open wait on any signal and starts a new timer from each physical open, so the full timeout would move the deadline forward.
- conditionStepKey() : string|null
-
conditionTailAfterConsumption()
: array{consumed: bool, occurrence: ?string, terminal: array
, steps: list >}|null - Keep the raw opens until workflow code has consumed the earlier result.
- conditionTerminalIdentityMatches() : bool
- conditionWaitStillLive() : bool
- A later open continues a wait the Server satisfied (a false wake) or a wait that was still open when the later one opened (a repeated open, #269 part 2). What counts is the state at that open: a repeated open's orphan may time out afterwards (#283) and is still the same wait. A wait that timed out or failed before the later open is finished, so that open is a separate call, such as a grace period.
- decodeMemoHistoryMap() : array<string, mixed>
- Decode the inline Avro map envelope returned by Server history.
- decodeResult() : mixed
- deliveryRange() : array{int, int}
- The sequences a cancellation delivery reserves: its interrupted call's sequence through sequence + sequence_span - 1, inclusive, as Core counts them. A span that is present must be a positive integer.
- durableCommandKind() : string|null
- The command kind that owns a durable history row, or null for a row that only points at a step. A wait's internal timeout timer belongs to that wait, not to a workflow timer.
-
durableHandleResolution()
: Throwable, resolution_orders: list
} - eventTime() : DateTimeImmutable|null
- groupClockPathMatches() : bool
- hasCompletedHistory() : bool
- historyEventShape() : string|null
- intValue() : int|null
- isConditionReopen() : bool
- isLegacySatisfiedCondition() : bool
- isRootCancellationBoundary() : bool
- memoSequence() : int
- parallelEntry() : array<string, mixed>
- parallelPath() : array<int, array<string, mixed>>
- payloadDetail() : string|null
- payloadEncodingFailure() : ReplayResult
- preparedLocalCall() : PreparedLocalActivityCall
- recordedConditionDeadlinePolicy() : array{policy: string, budget: int}|null
- The recorded opt-in of one physical open. Both fields are present together, with the only defined policy and a non-negative integer budget no smaller than this open's non-negative remaining timeout, or both are absent. The check runs on every physical open, before a reopen's timeout is replaced by its chain's first-open value.
- recordedSearchAttributeTypes() : array<string, string>
-
recordedSteps()
: array<int, Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list
>, resolution_order: int, child_policies?: array >, activity_cancellation_policy?: string, cancellation_scope_id?: string, cancellation_cleanup?: array , scope_parent?: string, scope_shield?: bool} - refuseUpsertCollision() : never
- remainingConditionReopen() : WorkflowCommand
- resolutionParallelPath() : array<int, array<string, mixed>>
-
resolvedStep()
: Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list
>, resolution_order: int} - restoreConsumedConditionTail() : array<int, array<string, mixed>>
- result() : ReplayResult
- resumeExecution() : mixed
- resumeGroupExecution() : mixed
- searchAttributesDifference() : string|null
- Compare two canonical maps structurally and type-strictly, without any JSON or php.ini dependent formatting. An int and a float are different values; floats compare numerically, so -0.0 equals 0.0.
- searchAttributeSequence() : int
- A recorded search-attribute upsert must name its own workflow step; replay never synthesizes one. The reasons match sdk-rust.
- selectionCancellationForHandle() : array<string, mixed>|null
- selectionCancellations() : array<string|int, mixed>
- selectionOperationIdentities() : array<int, string>
- selectionResolutions() : array<string|int, mixed>
- sequence() : int|null
- settledAtRunClose() : bool
- The run's close cancelled this activity after the workflow had moved past it. The workflow never observed it, so it is not an outcome: it never resolves a step, a selection member or a group failure, and the activity stays open for replay.
-
step()
: Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list
>, resolution_order: int} - stepChildIdentity() : ChildWorkflowIdentity|null
- stepOccurrence() : string|null
- stringValue() : string|null
- throwGroupIntoExecution() : mixed
- throwIntoExecution() : mixed
- throwSelectionMarkerMismatch() : never
- unrecordedConditionResult() : bool|null
- validatedSelectionResolution() : array<string, mixed>
- validateSelectionCancellationsForHandles() : void
- versionMarker() : array{string, int}
- versionMarkerInteger() : int
- versionMarkerSequence() : int
Constants
CONDITION_DEADLINE_POLICY
The occurrence-deadline opt-in on an anchored condition-wait open (#269).
public
mixed
CONDITION_DEADLINE_POLICY
= 'occurrence'
DELIVERY_EVENTS
A delivered cancellation consumes the interrupted call even when that call was never scheduled, and its sequence_span reserves the whole interrupted range, sequence .. sequence + span - 1 inclusive (Core WorkflowStepHistory::nextSequenceFromEvents()).
private
mixed
DELIVERY_EVENTS
= ['CooperativeCancellationDelivered', 'CancellationScopeDelivered']
DURABLE_COMMAND_KINDS
Every durable history event that claims a workflow sequence, by the command kind that owns it, following Core's WorkflowStepHistory::WORKFLOW_STEP_EVENT_TYPES. A command's lifecycle rows (terminal, retry, heartbeat and cancelled rows included) share its sequence. Internal wait-timeout timer rows belong to their wait; see durableCommandKind(). ActivityOutcomeRejected is deliberately absent: it is a payload-free audit fact that neither resolves an activity nor consumes a command position. Rows that only point at a step claim nothing: signal receipt and rejection, updates, message cursors, selection markers, cancellation requests and scope requests or preparations. Cancellation deliveries claim their whole span; see DELIVERY_EVENTS.
private
mixed
DURABLE_COMMAND_KINDS
= ['ActivityScheduled' => 'activity', 'ActivityStarted' => 'activity', 'ActivityHeartbeatRecorded' => 'activity', 'ActivityRetryScheduled' => 'activity', 'ActivityCompleted' => 'activity', 'ActivityFailed' => 'activity', 'ActivityCancelled' => 'activity', 'ActivityTimedOut' => 'activity', 'ActivityCancellationAcknowledged' => 'activity', 'TimerScheduled' => 'timer', 'TimerFired' => 'timer', 'TimerCancelled' => 'timer', 'ChildWorkflowScheduled' => 'child', 'ChildRunStarted' => 'child', 'ChildRunCompleted' => 'child', 'ChildRunFailed' => 'child', 'ChildRunCancelled' => 'child', 'ChildRunTerminated' => 'child', 'ConditionWaitOpened' => 'condition', 'ConditionWaitSatisfied' => 'condition', 'ConditionWaitTimedOut' => 'condition', 'ConditionWaitCancelled' => 'condition', 'SignalWaitOpened' => 'signal', 'SignalWaitReceived' => 'signal', 'SignalApplied' => 'signal', 'SignalWaitTimedOut' => 'signal', 'SignalWaitCancelled' => 'signal', 'ServiceOperationScheduled' => 'service_call', 'ServiceCallStarted' => 'service_call', 'ServiceCallCompleted' => 'service_call', 'ServiceCallFailed' => 'service_call', 'ServiceCallCancelled' => 'service_call', 'ServiceCallTimedOut' => 'service_call', 'SideEffectRecorded' => 'side_effect', 'VersionMarkerRecorded' => 'version_marker', 'MemoUpserted' => 'memo', 'SearchAttributesUpserted' => 'search_attributes', 'CancellationScopeOpened' => 'cancellation_scope', 'WorkflowContinuedAsNew' => 'continue_as_new']
MAX_VERSION
private
mixed
MAX_VERSION
= 2147483647
MIN_VERSION
private
mixed
MIN_VERSION
= -2147483648
RUN_CLOSED_CANCELLATION_REASON
`cancellation_reason` of an ActivityCancelled that the run's own close recorded (complete, fail or continue-as-new) for an activity it never awaited, such as a select() loser (Workflow #1117, Server #1193).
private
mixed
RUN_CLOSED_CANCELLATION_REASON
= 'run_closed'
SEARCH_ATTRIBUTE_MAX_KEYWORD_LENGTH
private
mixed
SEARCH_ATTRIBUTE_MAX_KEYWORD_LENGTH
= 255
SEARCH_ATTRIBUTE_MAX_STRING_LENGTH
private
mixed
SEARCH_ATTRIBUTE_MAX_STRING_LENGTH
= 2048
UPSERT_COMMAND_KINDS
An upsert is the only command at its sequence.
private
mixed
UPSERT_COMMAND_KINDS
= ['memo', 'search_attributes']
Properties
$codec read-only
private
PayloadCodec
$codec
$conditionOccurrenceDeadline
Whether this task's Server advertises condition_wait_occurrence_deadline.
private
bool
$conditionOccurrenceDeadline
= false
$groupedConditionWaitRefusal
Names the Server that refuses new condition waits inside groups (sdk-php#278), or returns null when they're allowed. Asked only when such a wait is about to be sent.
private
callable(): Array|null
$groupedConditionWaitRefusal
= null
$lastBusinessReplayClock
private
BusinessReplayClock|null
$lastBusinessReplayClock
= null
Methods
__construct()
public
__construct(PayloadCodec $codec) : mixed
Parameters
- $codec : PayloadCodec
replay()
public
replay(callable(WorkflowContext, mixed ...$input): mixed $handler, array<int, array<string, mixed>> $history, array<int, mixed> $input, string $taskQueue[, array<string, mixed> $task = [] ][, callable|null $localActivityExecutor = null ][, bool $prepareLocalActivities = false ][, bool $prepareLocalActivityGroups = false ][, array<int, string> $localActivityCancellationPolicies = [] ][, bool $allowCancellationScopeAuthoring = false ][, bool $replayCommittedCancellationScopes = false ][, bool $prepareCancellationScopeDelivery = false ][, bool $allowScopedPreparedLocalActivities = false ]) : ReplayResult
Parameters
- $handler : callable(WorkflowContext, mixed ...$input): mixed
- $history : array<int, array<string, mixed>>
- $input : array<int, mixed>
- $taskQueue : string
- $task : array<string, mixed> = []
- $localActivityExecutor : callable|null = null
- $prepareLocalActivities : bool = false
- $prepareLocalActivityGroups : bool = false
- $localActivityCancellationPolicies : array<int, string> = []
- $allowCancellationScopeAuthoring : bool = false
- $replayCommittedCancellationScopes : bool = false
- $prepareCancellationScopeDelivery : bool = false
- $allowScopedPreparedLocalActivities : bool = false
Return values
ReplayResultadvanceCancellationClock()
private
advanceCancellationClock(WorkflowContext $context, array<int, array<string, mixed>> $history, array<int, int> $orders) : void
Parameters
- $context : WorkflowContext
- $history : array<int, array<string, mixed>>
- $orders : array<int, int>
anchorNewConditionChain()
A new top-level chain opts in only when the Server advertises the capability and the call has an occurrence id and a timeout. The budget is the authored timeout; timeout_seconds stays the replay input (#269).
private
anchorNewConditionChain(WorkflowCommand $command) : WorkflowCommand
Grouped waits keep the authored timeout until grouped reopens are qualified (#278).
Parameters
- $command : WorkflowCommand
Return values
WorkflowCommandappendCompleteCommand()
private
appendCompleteCommand(array<int, array<string, mixed>> &$commands, mixed $result, WorkflowContext|null $context) : ReplayResult|null
Parameters
- $commands : array<int, array<string, mixed>>
- $result : mixed
- $context : WorkflowContext|null
Return values
ReplayResult|nullappendWorkflowCommand()
Materialize and JSON-validate a command before adding it to the task completion. Once a local activity has run, a later payload failure must return its durable record instead of discarding it on task redelivery.
private
appendWorkflowCommand(array<int, array<string, mixed>> &$commands, WorkflowCommand $command, string $taskQueue, WorkflowContext|null $context) : ReplayResult|null
Parameters
- $commands : array<int, array<string, mixed>>
- $command : WorkflowCommand
- $taskQueue : string
- $context : WorkflowContext|null
Return values
ReplayResult|nullassertCancellationCallMatches()
private
assertCancellationCallMatches(mixed $command, CancellationDelivery $boundary, array<int, array<string, mixed>> $stepsBySequence, WorkflowContext|null $context) : void
Parameters
- $command : mixed
- $boundary : CancellationDelivery
- $stepsBySequence : array<int, array<string, mixed>>
- $context : WorkflowContext|null
assertCancellationConsumed()
private
assertCancellationConsumed(CancellationHistory $cancellation, bool $consumed) : void
Parameters
- $cancellation : CancellationHistory
- $consumed : bool
assertCancellationScopeReplaySupported()
private
assertCancellationScopeReplaySupported(array<int, array<string, mixed>> $history, bool $allowAuthoring, array<string, mixed> $task, bool $replayCommittedScopes) : bool
Parameters
- $history : array<int, array<string, mixed>>
- $allowAuthoring : bool
- $task : array<string, mixed>
- $replayCommittedScopes : bool
Return values
boolassertCommandMatchesStep()
private
assertCommandMatchesStep(WorkflowCommand $command, array<string, mixed> $step) : void
Parameters
- $command : WorkflowCommand
- $step : array<string, mixed>
assertConditionChainPolicy()
Every physical open of one anchored chain names the same policy, its original authored budget and the chain's occurrence; a chain that began without the policy never gains it (#269).
private
assertConditionChainPolicy(array<string, mixed> $first, array<string, mixed> $reopen) : void
Parameters
- $first : array<string, mixed>
-
The chain so far, carrying its first open's policy.
- $reopen : array<string, mixed>
assertConditionWaitCompatible()
private
assertConditionWaitCompatible(Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int} $step, WorkflowCommand $command) : void
Parameters
- $step : Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int}
- $command : WorkflowCommand
assertDurableHandleExecutionIdentity()
private
assertDurableHandleExecutionIdentity(DurableOperationHandle $handle, WorkflowContext|null $context) : void
Parameters
- $handle : DurableOperationHandle
- $context : WorkflowContext|null
assertNoRemainingSteps()
private
assertNoRemainingSteps(array<int, Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list>, resolution_order: int} > $steps, int $stepCursor, string $terminalCommand) : void
Parameters
-
$steps
: array<int, Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list
>, resolution_order: int} > - $stepCursor : int
- $terminalCommand : string
assertParallelPathMatches()
private
assertParallelPathMatches(array<string, mixed> $step, array<int, array<string, mixed>> $expectedPath) : void
Parameters
- $step : array<string, mixed>
- $expectedPath : array<int, array<string, mixed>>
assertPendingScopeGroup()
private
assertPendingScopeGroup(ParallelWorkflowCommand $group, CancellationDelivery $boundary, array<int, array<string, mixed>> $stepsBySequence, string $scopeId) : void
Parameters
- $group : ParallelWorkflowCommand
- $boundary : CancellationDelivery
- $stepsBySequence : array<int, array<string, mixed>>
- $scopeId : string
assertVersionDecisionCompatible()
private
assertVersionDecisionCompatible(string $changeId, array{version: int, sequence: ?int} $decision, WorkflowCommand $command) : void
Parameters
- $changeId : string
- $decision : array{version: int, sequence: ?int}
- $command : WorkflowCommand
assertVersionSupported()
private
assertVersionSupported(string $changeId, int $version, int $minSupported, int $maxSupported, int|null $sequence) : void
Parameters
- $changeId : string
- $version : int
- $minSupported : int
- $maxSupported : int
- $sequence : int|null
bindConditionReopens()
A physical reopen of one logical condition wait keeps that wait's first opening time and authored timeout. Workers before #269 reopened with the full timeout; later ones reopen with the time remaining, so a reopen may record a smaller timeout than the wait it continues.
private
bindConditionReopens(array<int, array<string, mixed>> $steps) : array<int, array<string, mixed>>
Parameters
- $steps : array<int, array<string, mixed>>
Return values
array<int, array<string, mixed>>blockingResolutionOrders()
private
blockingResolutionOrders(array{shape: string, resolution_order: int} $step) : array<int, int>
Parameters
- $step : array{shape: string, resolution_order: int}
Return values
array<int, int>cancellationBoundary()
private
cancellationBoundary(mixed $command, int $sequence, array<int, array<string, mixed>> $stepsBySequence, string $requestId[, CancellationDelivery|null $delivery = null ]) : CancellationDelivery|null
Parameters
- $command : mixed
- $sequence : int
- $stepsBySequence : array<int, array<string, mixed>>
- $requestId : string
- $delivery : CancellationDelivery|null = null
Return values
CancellationDelivery|nullcanonicalSearchAttributes()
The canonical replay identity of a search-attribute upsert's values.
private
canonicalSearchAttributes(mixed $attributes, int $sequence, string $origin) : array<string, null|bool|int|float|string|array<int, string>>
History keeps the values as Core's UpsertSearchAttributesCall normalizes them: a non-empty map with 1-64 character URL-safe string keys; each value null, a bool, an int, a finite float, a string of at most 2048 characters or a list of strings of at most 255 characters each; strings and list items trimmed, an empty scalar string as a deletion, keys sorted. The authored call is normalized the same way. Anything outside that set, recorded or authored, refuses replay instead of being coerced.
Explicitly authored types bind separately against known recorded types. Legacy one-argument calls remain value-only because effective types may come from a namespace registration the worker cannot see. Histories without type metadata also retain value-only compatibility.
Parameters
- $attributes : mixed
- $sequence : int
- $origin : string
Return values
array<string, null|bool|int|float|string|array<int, string>>characterLength()
private
static characterLength(string $value) : int|null
Parameters
- $value : string
Return values
int|nullchildIdentity()
private
childIdentity(array<string, mixed> $payload) : ChildWorkflowIdentity|null
Parameters
- $payload : array<string, mixed>
Return values
ChildWorkflowIdentity|nullcollapseConditionReopens()
private
collapseConditionReopens(array<int, Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list>, resolution_order: int, physical_condition_steps?: list>} > $steps) : array<int, Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list>, resolution_order: int, physical_condition_steps?: list>} >
Parameters
-
$steps
: array<int, Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list
>, resolution_order: int, physical_condition_steps?: list >>}
Return values
array<int, Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: listcommandDetail()
private
commandDetail(WorkflowCommand $command) : string|null
Parameters
- $command : WorkflowCommand
Return values
string|nullcompleteCommand()
private
completeCommand(mixed $result) : array{type: string, result: array{codec: string, blob: string}}
Parameters
- $result : mixed
Return values
array{type: string, result: array{codec: string, blob: string}}conditionDetail()
private
conditionDetail(string|null $conditionKey, string|null $definitionFingerprint) : string
Parameters
- $conditionKey : string|null
- $definitionFingerprint : string|null
Return values
stringconditionReopen()
The command that reopens a recorded condition wait, bounded by the wait's original deadline as embedded await($condition, $timeout) is. The Server satisfies an open wait on any signal and starts a new timer from each physical open, so the full timeout would move the deadline forward.
private
conditionReopen(WorkflowCommand $command, array<string, mixed> $step, array<int, array<string, mixed>> $history) : WorkflowCommand
Parameters
- $command : WorkflowCommand
- $step : array<string, mixed>
- $history : array<int, array<string, mixed>>
Return values
WorkflowCommandconditionStepKey()
private
conditionStepKey(array<string, mixed> $payload, array<string, string> $conditionStepsByWaitId) : string|null
Parameters
- $payload : array<string, mixed>
- $conditionStepsByWaitId : array<string, string>
Return values
string|nullconditionTailAfterConsumption()
Keep the raw opens until workflow code has consumed the earlier result.
private
conditionTailAfterConsumption(array<string, mixed> $step, WorkflowCommand $command, bool $satisfied) : array{consumed: bool, occurrence: ?string, terminal: array, steps: list>}|null
Equal keys/fingerprints alone cannot decide whether a later legacy open was another false wake or a new authored call. Only a recorded satisfied wait followed by a different recorded wait identity can supply a tail; its own original timeout/opening is used if code actually authors it.
Parameters
- $step : array<string, mixed>
- $command : WorkflowCommand
- $satisfied : bool
Return values
array{consumed: bool, occurrence: ?string, terminal: arrayconditionTerminalIdentityMatches()
private
conditionTerminalIdentityMatches(array<string, mixed> $step) : bool
Parameters
- $step : array<string, mixed>
Return values
boolconditionWaitStillLive()
A later open continues a wait the Server satisfied (a false wake) or a wait that was still open when the later one opened (a repeated open, #269 part 2). What counts is the state at that open: a repeated open's orphan may time out afterwards (#283) and is still the same wait. A wait that timed out or failed before the later open is finished, so that open is a separate call, such as a grace period.
private
conditionWaitStillLive(array<string, mixed> $previous, array<string, mixed> $next) : bool
Parameters
- $previous : array<string, mixed>
- $next : array<string, mixed>
Return values
booldecodeMemoHistoryMap()
Decode the inline Avro map envelope returned by Server history.
private
decodeMemoHistoryMap(mixed $envelope, int $sequence, string $field, bool $requireEntries) : array<string, mixed>
External memo command references are resolved by the runtime before the MemoUpserted event is recorded, so replay always consumes inline bytes.
Parameters
- $envelope : mixed
- $sequence : int
- $field : string
- $requireEntries : bool
Return values
array<string, mixed>decodeResult()
private
decodeResult(array<string, mixed> $payload) : mixed
Parameters
- $payload : array<string, mixed>
deliveryRange()
The sequences a cancellation delivery reserves: its interrupted call's sequence through sequence + sequence_span - 1, inclusive, as Core counts them. A span that is present must be a positive integer.
private
deliveryRange(string $type, array<string, mixed> $payload) : array{int, int}
Parameters
- $type : string
- $payload : array<string, mixed>
Return values
array{int, int}durableCommandKind()
The command kind that owns a durable history row, or null for a row that only points at a step. A wait's internal timeout timer belongs to that wait, not to a workflow timer.
private
durableCommandKind(string $type, array<string, mixed> $payload) : string|null
Parameters
- $type : string
- $payload : array<string, mixed>
Return values
string|nulldurableHandleResolution()
private
durableHandleResolution(DurableOperationHandle $handle, array<int, array<string, mixed>> $stepsBySequence, array<string, array<string, mixed>> $selectionCancellations, array<string, int> $selectionCancellationOrders) : Throwable, resolution_orders: list}
Parameters
- $handle : DurableOperationHandle
- $stepsBySequence : array<int, array<string, mixed>>
- $selectionCancellations : array<string, array<string, mixed>>
- $selectionCancellationOrders : array<string, int>
Return values
Throwable, resolution_orders: listeventTime()
private
eventTime(mixed $event) : DateTimeImmutable|null
Parameters
- $event : mixed
Return values
DateTimeImmutable|nullgroupClockPathMatches()
private
groupClockPathMatches(array<string, mixed> $body, array<int, array<string, mixed>> $expected) : bool
Parameters
- $body : array<string, mixed>
- $expected : array<int, array<string, mixed>>
Return values
boolhasCompletedHistory()
private
hasCompletedHistory(array<int, array<string, mixed>> $history) : bool
Parameters
- $history : array<int, array<string, mixed>>
Return values
boolhistoryEventShape()
private
historyEventShape(string $type, array<string, mixed> $payload) : string|null
Parameters
- $type : string
- $payload : array<string, mixed>
Return values
string|nullintValue()
private
intValue(mixed $value) : int|null
Parameters
- $value : mixed
Return values
int|nullisConditionReopen()
private
isConditionReopen(array<string, mixed> $previous, array<string|int, mixed> $next) : bool
Parameters
- $previous : array<string, mixed>
-
@param array<string, mixed> $next
- $next : array<string|int, mixed>
Return values
boolisLegacySatisfiedCondition()
private
isLegacySatisfiedCondition(array<string, mixed> $step) : bool
Parameters
- $step : array<string, mixed>
Return values
boolisRootCancellationBoundary()
private
isRootCancellationBoundary(mixed $command, CancellationDelivery $boundary, array<int, array<string, mixed>> $stepsBySequence, WorkflowContext $context) : bool
Parameters
- $command : mixed
- $boundary : CancellationDelivery
- $stepsBySequence : array<int, array<string, mixed>>
- $context : WorkflowContext
Return values
boolmemoSequence()
private
memoSequence(array<string, mixed> $payload) : int
Parameters
- $payload : array<string, mixed>
Return values
intparallelEntry()
private
parallelEntry(array<string, mixed> $payload, int $sequence) : array<string, mixed>
Parameters
- $payload : array<string, mixed>
- $sequence : int
Return values
array<string, mixed>parallelPath()
private
parallelPath(array<string, mixed> $payload, int $sequence) : array<int, array<string, mixed>>
Parameters
- $payload : array<string, mixed>
- $sequence : int
Return values
array<int, array<string, mixed>>payloadDetail()
private
payloadDetail(array<string, mixed> $payload, string $shape) : string|null
Parameters
- $payload : array<string, mixed>
- $shape : string
Return values
string|nullpayloadEncodingFailure()
private
payloadEncodingFailure(array<int, array<string, mixed>> $commands, WorkflowContext|null $context, Throwable $failure) : ReplayResult
Parameters
- $commands : array<int, array<string, mixed>>
- $context : WorkflowContext|null
- $failure : Throwable
Return values
ReplayResultpreparedLocalCall()
private
preparedLocalCall(WorkflowCommand $command, int $sequence, bool $recover, array<int, array<string, mixed>> $history, CancellationHistory $cancellation, WorkflowContext $context, bool $cancellationConsumed) : PreparedLocalActivityCall
Parameters
- $command : WorkflowCommand
- $sequence : int
- $recover : bool
- $history : array<int, array<string, mixed>>
- $cancellation : CancellationHistory
- $context : WorkflowContext
- $cancellationConsumed : bool
Return values
PreparedLocalActivityCallrecordedConditionDeadlinePolicy()
The recorded opt-in of one physical open. Both fields are present together, with the only defined policy and a non-negative integer budget no smaller than this open's non-negative remaining timeout, or both are absent. The check runs on every physical open, before a reopen's timeout is replaced by its chain's first-open value.
private
recordedConditionDeadlinePolicy(array<string, mixed> $payload, int $sequence) : array{policy: string, budget: int}|null
Parameters
- $payload : array<string, mixed>
- $sequence : int
Return values
array{policy: string, budget: int}|nullrecordedSearchAttributeTypes()
private
recordedSearchAttributeTypes(array<string, mixed> $attributes, mixed $types, int $sequence) : array<string, string>
Parameters
- $attributes : array<string, mixed>
- $types : mixed
- $sequence : int
Return values
array<string, string>recordedSteps()
private
recordedSteps(array<int, array<string, mixed>> $history, bool $preserveConditionReopens, CancellationScopeHistory $scopes) : array<int, Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list>, resolution_order: int, child_policies?: array, activity_cancellation_policy?: string, cancellation_scope_id?: string, cancellation_cleanup?: array, scope_parent?: string, scope_shield?: bool} >
Parameters
- $history : array<int, array<string, mixed>>
- $preserveConditionReopens : bool
- $scopes : CancellationScopeHistory
Return values
array<int, Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: listrefuseUpsertCollision()
private
refuseUpsertCollision(int $sequence, string $type, string $existing, string $incoming) : never
Parameters
- $sequence : int
- $type : string
- $existing : string
- $incoming : string
Return values
neverremainingConditionReopen()
private
remainingConditionReopen(WorkflowCommand $command, array<string, mixed> $step, array<int, array<string, mixed>> $history) : WorkflowCommand
Parameters
- $command : WorkflowCommand
- $step : array<string, mixed>
- $history : array<int, array<string, mixed>>
Return values
WorkflowCommandresolutionParallelPath()
private
resolutionParallelPath(array<string, mixed> $payload, array<string, mixed>|null $previous, int $sequence) : array<int, array<string, mixed>>
Parameters
- $payload : array<string, mixed>
- $previous : array<string, mixed>|null
- $sequence : int
Return values
array<int, array<string, mixed>>resolvedStep()
private
resolvedStep(int $sequence, string $shape, mixed $value[, Throwable|null $failure = null ][, string|null $detail = null ][, string|null $conditionKey = null ][, string|null $conditionDefinitionFingerprint = null ][, int|null $timeoutSeconds = null ][, array<int, array<string, mixed>> $parallelPath = [] ][, int $resolutionOrder = PHP_INT_MAX ]) : Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list>, resolution_order: int}
Parameters
- $sequence : int
- $shape : string
- $value : mixed
- $failure : Throwable|null = null
- $detail : string|null = null
- $conditionKey : string|null = null
- $conditionDefinitionFingerprint : string|null = null
- $timeoutSeconds : int|null = null
- $parallelPath : array<int, array<string, mixed>> = []
- $resolutionOrder : int = PHP_INT_MAX
Return values
Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: listrestoreConsumedConditionTail()
private
restoreConsumedConditionTail(mixed $command, array{consumed: bool, occurrence: ?string, terminal: array, steps: list>} $pending) : array<int, array<string, mixed>>
Parameters
- $command : mixed
-
$pending
: array{consumed: bool, occurrence: ?string, terminal: array
, steps: list >}
Return values
array<int, array<string, mixed>>result()
private
result(array<int, array<string, mixed>> $commands, WorkflowContext|null $context[, Throwable|null $terminalFailure = null ][, int|null $failedActivitySequence = null ][, string|null $failedActivityExecutionId = null ][, PreparedLocalActivityCall|null $preparedLocalActivity = null ][, PreparedLocalActivityGroup|null $preparedLocalActivityGroup = null ][, CancellationScopeOpening|null $cancellationScopeOpening = null ]) : ReplayResult
Parameters
- $commands : array<int, array<string, mixed>>
- $context : WorkflowContext|null
- $terminalFailure : Throwable|null = null
- $failedActivitySequence : int|null = null
- $failedActivityExecutionId : string|null = null
- $preparedLocalActivity : PreparedLocalActivityCall|null = null
- $preparedLocalActivityGroup : PreparedLocalActivityGroup|null = null
- $cancellationScopeOpening : CancellationScopeOpening|null = null
Return values
ReplayResultresumeExecution()
private
resumeExecution(Fiber<mixed, mixed> $execution, BusinessReplayClock $clock, mixed $value[, array<string, mixed>|null $step = null ]) : mixed
Parameters
- $execution : Fiber<mixed, mixed>
- $clock : BusinessReplayClock
- $value : mixed
- $step : array<string, mixed>|null = null
resumeGroupExecution()
private
resumeGroupExecution(Fiber<mixed, mixed> $execution, BusinessReplayClock $clock, mixed $value, array<int, array{step: array, path: list>, offset: int}> $members, int $size) : mixed
Parameters
- $execution : Fiber<mixed, mixed>
- $clock : BusinessReplayClock
- $value : mixed
-
$members
: array<int, array{step: array
, path: list >, offset: int}> - $size : int
searchAttributesDifference()
Compare two canonical maps structurally and type-strictly, without any JSON or php.ini dependent formatting. An int and a float are different values; floats compare numerically, so -0.0 equals 0.0.
private
static searchAttributesDifference(array<string, mixed> $recorded, array<string, mixed> $authored) : string|null
Parameters
- $recorded : array<string, mixed>
- $authored : array<string, mixed>
Return values
string|null —a payload-free description of the first difference
searchAttributeSequence()
A recorded search-attribute upsert must name its own workflow step; replay never synthesizes one. The reasons match sdk-rust.
private
searchAttributeSequence(array<string, mixed> $payload) : int
Parameters
- $payload : array<string, mixed>
Return values
intselectionCancellationForHandle()
private
selectionCancellationForHandle(DurableOperationHandle $handle, array<string, array<string, mixed>> $selectionCancellations) : array<string, mixed>|null
Parameters
- $handle : DurableOperationHandle
- $selectionCancellations : array<string, array<string, mixed>>
Return values
array<string, mixed>|nullselectionCancellations()
private
selectionCancellations(array<int, array<string, mixed>> $history, array<string|int, mixed> &$cancellationOrders) : array<string|int, mixed>
Parameters
- $history : array<int, array<string, mixed>>
-
@param array<string, int> $cancellationOrders @return array<string, array<string, mixed>>
- $cancellationOrders : array<string|int, mixed>
Return values
array<string|int, mixed>selectionOperationIdentities()
private
selectionOperationIdentities(array<int, array<string, mixed>> $history) : array<int, string>
Parameters
- $history : array<int, array<string, mixed>>
Return values
array<int, string>selectionResolutions()
private
selectionResolutions(array<int, array<string, mixed>> $history, array<string|int, mixed> &$resolutionOrders) : array<string|int, mixed>
Parameters
- $history : array<int, array<string, mixed>>
-
@param array<string, int> $resolutionOrders @return array<string, array<string, mixed>>
- $resolutionOrders : array<string|int, mixed>
Return values
array<string|int, mixed>sequence()
private
sequence(array<string, mixed> $payload) : int|null
Parameters
- $payload : array<string, mixed>
Return values
int|nullsettledAtRunClose()
The run's close cancelled this activity after the workflow had moved past it. The workflow never observed it, so it is not an outcome: it never resolves a step, a selection member or a group failure, and the activity stays open for replay.
private
static settledAtRunClose(string $type, array<string, mixed> $payload) : bool
Parameters
- $type : string
- $payload : array<string, mixed>
Return values
boolstep()
private
step(int $sequence, string $shape[, string|null $detail = null ][, string|null $conditionKey = null ][, string|null $conditionDefinitionFingerprint = null ][, int|null $timeoutSeconds = null ][, array<int, array<string, mixed>> $parallelPath = [] ][, int $resolutionOrder = PHP_INT_MAX ]) : Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: list>, resolution_order: int}
Parameters
- $sequence : int
- $shape : string
- $detail : string|null = null
- $conditionKey : string|null = null
- $conditionDefinitionFingerprint : string|null = null
- $timeoutSeconds : int|null = null
- $parallelPath : array<int, array<string, mixed>> = []
- $resolutionOrder : int = PHP_INT_MAX
Return values
Throwable, condition_key: ?string, condition_definition_fingerprint: ?string, timeout_seconds: ?int, parallel_path: liststepChildIdentity()
private
stepChildIdentity(array<string, mixed> $step) : ChildWorkflowIdentity|null
Parameters
- $step : array<string, mixed>
Return values
ChildWorkflowIdentity|nullstepOccurrence()
private
stepOccurrence(array<string, mixed> $step) : string|null
Parameters
- $step : array<string, mixed>
Return values
string|nullstringValue()
private
stringValue(mixed $value) : string|null
Parameters
- $value : mixed
Return values
string|nullthrowGroupIntoExecution()
private
throwGroupIntoExecution(Fiber<mixed, mixed> $execution, BusinessReplayClock $clock, Throwable $failure, array<int, array{step: array, path: list>, offset: int}> $members, int $size, int $order) : mixed
Parameters
- $execution : Fiber<mixed, mixed>
- $clock : BusinessReplayClock
- $failure : Throwable
-
$members
: array<int, array{step: array
, path: list >, offset: int}> - $size : int
- $order : int
throwIntoExecution()
private
throwIntoExecution(Fiber<mixed, mixed> $execution, BusinessReplayClock $clock, Throwable $failure[, array<string, mixed>|null $step = null ]) : mixed
Parameters
- $execution : Fiber<mixed, mixed>
- $clock : BusinessReplayClock
- $failure : Throwable
- $step : array<string, mixed>|null = null
throwSelectionMarkerMismatch()
private
throwSelectionMarkerMismatch(int $sequence, array<string, mixed> $marker, string $detail[, string $reason = 'selection_resolution_member_mismatch' ]) : never
Parameters
- $sequence : int
- $marker : array<string, mixed>
- $detail : string
- $reason : string = 'selection_resolution_member_mismatch'
Return values
neverunrecordedConditionResult()
private
unrecordedConditionResult(WorkflowCommand $command, array<string, mixed>|null $step) : bool|null
Parameters
- $command : WorkflowCommand
- $step : array<string, mixed>|null
Return values
bool|nullvalidatedSelectionResolution()
private
validatedSelectionResolution(ParallelWorkflowCommand $group, int $baseSequence, array<string, mixed> $marker, array<int, array<string, mixed>> $stepsBySequence, array<int, array<string, mixed>> $history, array<int, string> $operationIdentities) : array<string, mixed>
Parameters
- $group : ParallelWorkflowCommand
- $baseSequence : int
- $marker : array<string, mixed>
- $stepsBySequence : array<int, array<string, mixed>>
- $history : array<int, array<string, mixed>>
- $operationIdentities : array<int, string>
Return values
array<string, mixed>validateSelectionCancellationsForHandles()
private
validateSelectionCancellationsForHandles(array<int|string, DurableOperationHandle> $handles, array<string, array<string, mixed>> $selectionCancellations) : void
Parameters
- $handles : array<int|string, DurableOperationHandle>
- $selectionCancellations : array<string, array<string, mixed>>
versionMarker()
private
versionMarker(array<string, mixed> $payload, int $sequence) : array{string, int}
Parameters
- $payload : array<string, mixed>
- $sequence : int
Return values
array{string, int}versionMarkerInteger()
private
versionMarkerInteger(array<string, mixed> $payload, string $field, int $sequence) : int
Parameters
- $payload : array<string, mixed>
- $field : string
- $sequence : int
Return values
intversionMarkerSequence()
private
versionMarkerSequence(array<string, mixed> $payload) : int
Parameters
- $payload : array<string, mixed>