Durable Workflow PHP SDK — API Reference

Guides

WorkflowCommand
in package

FinalYes

A replayable command emitted when straight-line workflow code suspends.

Table of Contents

Constants

LOCAL_ACTIVITY_IDENTITY_FIELDS  : mixed = ['activity_type', 'arguments_value', 'execution...
LOCAL_ACTIVITY_OPTION_FIELDS  : mixed = ['retry_policy', 'start_to_close_timeout', 'sch...
LOCAL_ACTIVITY_RETRY_POLICY_FIELDS  : mixed = ['max_attempts', 'backoff_seconds', 'non_retrya...
MAX_LOCAL_ACTIVITY_ATTEMPTS  : mixed = 100
MAX_LOCAL_ACTIVITY_EXCEPTION_TYPE_BYTES  : mixed = 255
MAX_MEMO_ENTRIES  : mixed = 100
MAX_MEMO_TOTAL_SIZE_BYTES  : mixed = 65536
MAX_MEMO_VALUE_SIZE_BYTES  : mixed = 10240
MEMO_KEY_PATTERN  : mixed = '/^(?!-?[0-9]+$)[A-Za-z0-9_.:-]{1,64}$/D'

Properties

$attributes  : array<string|int, mixed>
$historyShape  : string
$localResult  : mixed
$type  : string
$versionResultKind  : string|null
$conditionPredicate  : Closure|null
$localActivity  : Closure|null
$localActivityArgumentsEnvelope  : array<string|int, mixed>|null
$localActivityResultEnvelope  : array<string|int, mixed>|null
$sideEffect  : Closure|null

Methods

__construct()  : mixed
activity()  : self
canonicalLocalActivityOptions()  : array<string, mixed>
Validate and canonicalize the bounded record_local_activity authoring options.
canonicalMemoEntries()  : array<string, mixed>
Validate and canonicalize the language-neutral memo patch. The wire serializer wraps the whole map in the public Avro payload envelope.
childWorkflow()  : self
conditionWait()  : self
continueAsNew()  : self
localActivity()  : self
sideEffect()  : self
timer()  : self
toWire()  : array<string, mixed>
upsertMemo()  : self
upsertSearchAttributes()  : self
versionMarker()  : self
withAttributes()  : self
workflowStream()  : self
avroEncodedSize()  : int
canonicalLocalActivityRetryPolicy()  : array<string, mixed>
canonicalMemoValue()  : mixed
hasOverlongLocalActivityExceptionType()  : bool
invalidLocalActivityOutcome()  : array<string, mixed>
jsonUnsafeLocalActivityOutcome()  : array<string, mixed>
Record a terminal, non-retryable failure after application code produced outcome metadata that cannot cross the HTTP JSON document boundary.
unencodableLocalActivityResult()  : array<string, mixed>
Replace a completed attempt whose result cannot cross the durable codec boundary with an authoritative terminal failure. The activity must not be retried because its side effect has already happened.

Constants

LOCAL_ACTIVITY_IDENTITY_FIELDS

private mixed LOCAL_ACTIVITY_IDENTITY_FIELDS = ['activity_type', 'arguments_value', 'execution_mode']

LOCAL_ACTIVITY_OPTION_FIELDS

private mixed LOCAL_ACTIVITY_OPTION_FIELDS = ['retry_policy', 'start_to_close_timeout', 'schedule_to_close_timeout', 'heartbeat_timeout']

LOCAL_ACTIVITY_RETRY_POLICY_FIELDS

private mixed LOCAL_ACTIVITY_RETRY_POLICY_FIELDS = ['max_attempts', 'backoff_seconds', 'non_retryable_error_types']

MAX_LOCAL_ACTIVITY_ATTEMPTS

private mixed MAX_LOCAL_ACTIVITY_ATTEMPTS = 100

MAX_LOCAL_ACTIVITY_EXCEPTION_TYPE_BYTES

private mixed MAX_LOCAL_ACTIVITY_EXCEPTION_TYPE_BYTES = 255

MAX_MEMO_TOTAL_SIZE_BYTES

private mixed MAX_MEMO_TOTAL_SIZE_BYTES = 65536

MAX_MEMO_VALUE_SIZE_BYTES

private mixed MAX_MEMO_VALUE_SIZE_BYTES = 10240

MEMO_KEY_PATTERN

private mixed MEMO_KEY_PATTERN = '/^(?!-?[0-9]+$)[A-Za-z0-9_.:-]{1,64}$/D'

Properties

$versionResultKind read-only

public string|null $versionResultKind = null

$conditionPredicate read-only

private Closure|null $conditionPredicate = null

$localActivityArgumentsEnvelope read-only

private array<string|int, mixed>|null $localActivityArgumentsEnvelope = null

$localActivityResultEnvelope read-only

private array<string|int, mixed>|null $localActivityResultEnvelope = null

Methods

__construct()

public __construct(string $type, string $historyShape[, array<string, mixed> $attributes = [] ][, mixed $localResult = null ][, callable(): mixed|null $sideEffect = null ][, Closure|null $conditionPredicate = null ][, Closure|null $localActivity = null ][, string|null $versionResultKind = null ][, array{codec: string, blob: string}|null $localActivityArgumentsEnvelope = null ][, array{codec: string, blob: string}|null $localActivityResultEnvelope = null ]) : mixed
Parameters
$type : string
$historyShape : string
$attributes : array<string, mixed> = []
$localResult : mixed = null
$sideEffect : callable(): mixed|null = null
$conditionPredicate : Closure|null = null
$localActivity : Closure|null = null
$versionResultKind : string|null = null
$localActivityArgumentsEnvelope : array{codec: string, blob: string}|null = null
$localActivityResultEnvelope : array{codec: string, blob: string}|null = null

activity()

public static activity(string $activityType, array<int, mixed> $arguments[, array<string, mixed> $options = [] ]) : self
Parameters
$activityType : string
$arguments : array<int, mixed>
$options : array<string, mixed> = []
Return values
self

canonicalLocalActivityOptions()

Validate and canonicalize the bounded record_local_activity authoring options.

public static canonicalLocalActivityOptions(array<string, mixed> $options) : array<string, mixed>
Parameters
$options : array<string, mixed>
Return values
array<string, mixed>

canonicalMemoEntries()

Validate and canonicalize the language-neutral memo patch. The wire serializer wraps the whole map in the public Avro payload envelope.

public static canonicalMemoEntries(array<string|int, mixed> $entries) : array<string, mixed>
Parameters
$entries : array<string|int, mixed>
Return values
array<string, mixed>

childWorkflow()

public static childWorkflow(string $workflowType, array<int, mixed> $arguments[, array<string, mixed> $options = [] ]) : self
Parameters
$workflowType : string
$arguments : array<int, mixed>
$options : array<string, mixed> = []
Return values
self

conditionWait()

public static conditionWait(callable(): bool $predicate, string|null $key, string|null $definitionFingerprint, int|null $timeoutSeconds) : self
Parameters
$predicate : callable(): bool
$key : string|null
$definitionFingerprint : string|null
$timeoutSeconds : int|null
Return values
self

continueAsNew()

public static continueAsNew(array<int, mixed> $arguments[, string|null $workflowType = null ][, string|null $taskQueue = null ]) : self
Parameters
$arguments : array<int, mixed>
$workflowType : string|null = null
$taskQueue : string|null = null
Return values
self

localActivity()

public static localActivity(string $activityType, array<int, mixed> $arguments, array<string, mixed> $options, callable(string, array<int, mixed>, array<string, mixed>): array<string, mixed> $executor) : self
Parameters
$activityType : string
$arguments : array<int, mixed>
$options : array<string, mixed>
$executor : callable(string, array<int, mixed>, array<string, mixed>): array<string, mixed>
Return values
self

sideEffect()

public static sideEffect(callable(): mixed $operation) : self
Parameters
$operation : callable(): mixed
Return values
self

timer()

public static timer(int $seconds) : self
Parameters
$seconds : int
Return values
self

upsertMemo()

public static upsertMemo(array<string, mixed> $entries) : self
Parameters
$entries : array<string, mixed>
Return values
self

upsertSearchAttributes()

public static upsertSearchAttributes(array<string, mixed> $attributes) : self
Parameters
$attributes : array<string, mixed>
Return values
self

versionMarker()

public static versionMarker(string $changeId, int $minSupported, int $maxSupported, string $resultKind) : self
Parameters
$changeId : string
$minSupported : int
$maxSupported : int
$resultKind : string
Return values
self

withAttributes()

public withAttributes(array<string, mixed> $attributes) : self
Parameters
$attributes : array<string, mixed>
Return values
self

workflowStream()

public static workflowStream(array<string, mixed> $directive) : self
Parameters
$directive : array<string, mixed>
Return values
self

avroEncodedSize()

private static avroEncodedSize(mixed $value) : int
Parameters
$value : mixed
Return values
int

canonicalLocalActivityRetryPolicy()

private static canonicalLocalActivityRetryPolicy(mixed $retryPolicy) : array<string, mixed>
Parameters
$retryPolicy : mixed
Return values
array<string, mixed>

canonicalMemoValue()

private static canonicalMemoValue(mixed $value) : mixed
Parameters
$value : mixed

hasOverlongLocalActivityExceptionType()

private static hasOverlongLocalActivityExceptionType(array<string, mixed> $outcome) : bool
Parameters
$outcome : array<string, mixed>
Return values
bool

invalidLocalActivityOutcome()

private static invalidLocalActivityOutcome(string $message) : array<string, mixed>
Parameters
$message : string
Return values
array<string, mixed>

jsonUnsafeLocalActivityOutcome()

Record a terminal, non-retryable failure after application code produced outcome metadata that cannot cross the HTTP JSON document boundary.

private static jsonUnsafeLocalActivityOutcome() : array<string, mixed>
Return values
array<string, mixed>

unencodableLocalActivityResult()

Replace a completed attempt whose result cannot cross the durable codec boundary with an authoritative terminal failure. The activity must not be retried because its side effect has already happened.

private static unencodableLocalActivityResult(array<string, mixed> $outcome, Throwable $exception, string $codecName) : array<string, mixed>
Parameters
$outcome : array<string, mixed>
$exception : Throwable
$codecName : string
Return values
array<string, mixed>
On this page

Search results