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

ACTIVITY_RETRY_POLICY_FIELDS  : mixed = ['max_attempts', 'backoff_seconds', 'non_retrya...
CHILD_WORKFLOW_TIMEOUT_FIELDS  : mixed = ['execution_timeout_seconds', 'run_timeout_seco...
LOCAL_ACTIVITY_IDENTITY_FIELDS  : mixed = ['activity_type', 'arguments_value', 'execution...
LOCAL_ACTIVITY_OPTION_FIELDS  : mixed = ['retry_policy', 'start_to_close_timeout', 'sch...
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'
REMOTE_ACTIVITY_OPTION_FIELDS  : mixed = ['connection', 'queue', 'retry_policy', 'start_...
REMOTE_ACTIVITY_TIMEOUT_FIELDS  : mixed = ['start_to_close_timeout', 'schedule_to_start_t...

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
canonicalChildWorkflowPolicies()  : array<string, string>
Accept typed policies and their portable string values without changing omitted defaults.
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.
canonicalRemoteActivityOptions()  : array<string, mixed>
childWorkflow()  : self
conditionWait()  : self
continueAsNew()  : self
localActivity()  : self
serviceOperation()  : self
sideEffect()  : self
timer()  : self
toWire()  : array<string, mixed>
upsertMemo()  : self
upsertSearchAttributes()  : self
versionMarker()  : self
withAttributes()  : self
workflowStream()  : self
assertRemoteActivityFields()  : void
avroEncodedSize()  : int
canonicalLocalActivityRetryPolicy()  : array<string, mixed>
canonicalMemoValue()  : mixed
copyWithAttributes()  : self
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

ACTIVITY_RETRY_POLICY_FIELDS

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

CHILD_WORKFLOW_TIMEOUT_FIELDS

private mixed CHILD_WORKFLOW_TIMEOUT_FIELDS = ['execution_timeout_seconds', 'run_timeout_seconds']

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']

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'

REMOTE_ACTIVITY_OPTION_FIELDS

private mixed REMOTE_ACTIVITY_OPTION_FIELDS = ['connection', 'queue', 'retry_policy', 'start_to_close_timeout', 'schedule_to_start_timeout', 'schedule_to_close_timeout', 'heartbeat_timeout', 'worker_session', 'cancellation_policy']

REMOTE_ACTIVITY_TIMEOUT_FIELDS

private mixed REMOTE_ACTIVITY_TIMEOUT_FIELDS = ['start_to_close_timeout', 'schedule_to_start_timeout', 'schedule_to_close_timeout', 'heartbeat_timeout']

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

canonicalChildWorkflowPolicies()

Accept typed policies and their portable string values without changing omitted defaults.

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

canonicalLocalActivityOptions()

Validate and canonicalize the bounded record_local_activity authoring options.

public static canonicalLocalActivityOptions(array<string, mixed> $options[, bool $prepared = false ]) : array<string, mixed>
Parameters
$options : array<string, mixed>
$prepared : bool = false
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>

canonicalRemoteActivityOptions()

public static canonicalRemoteActivityOptions(array<string, mixed> $options) : array<string, mixed>
Parameters
$options : array<string, 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[, string|null $occurrenceId = null ]) : self
Parameters
$predicate : callable(): bool
$key : string|null
$definitionFingerprint : string|null
$timeoutSeconds : int|null
$occurrenceId : string|null = 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[, bool $prepared = false ]) : self
Parameters
$activityType : string
$arguments : array<int, mixed>
$options : array<string, mixed>
$executor : callable(string, array<int, mixed>, array<string, mixed>): array<string, mixed>
$prepared : bool = false
Return values
self

serviceOperation()

public static serviceOperation(string $endpointName, string $serviceName, string $operationName, mixed $request[, array<string, mixed> $options = [] ]) : self
Parameters
$endpointName : string
$serviceName : string
$operationName : string
$request : mixed
$options : 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[, array<string, string>|null $attributeTypes = null ]) : self
Parameters
$attributes : array<string, mixed>
$attributeTypes : array<string, string>|null = null
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

assertRemoteActivityFields()

private static assertRemoteActivityFields(array<string, mixed> $values, array<int, string> $allowed, string $subject) : void
Parameters
$values : array<string, mixed>
$allowed : array<int, string>
$subject : string

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

copyWithAttributes()

private copyWithAttributes(array<string, mixed> $attributes) : self
Parameters
$attributes : array<string, mixed>
Return values
self

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