Durable Workflow PHP SDK — API Reference

Guides

Client
in package
implements WorkflowClientInterface

FinalYes

Synchronous control-plane and worker-plane client for the standalone server.

Table of Contents

Interfaces

WorkflowClientInterface
The application-facing workflow operations implemented by Client and its test fake.

Constants

ACTIVITY_TASK_PATH  : mixed = '/worker/activity-tasks/'
CLUSTER_INFO_PATH  : mixed = '/cluster/info'
EXTERNAL_PAYLOAD_REFERENCE_SCHEMA  : mixed = 'durable-workflow.v2.external-payload-reference...
TASK_COMPLETION_SUFFIX  : mixed = '/complete'
WORKFLOW_TASK_WAITING_FOR_HISTORY_MESSAGE  : mixed = 'Workflow task waiting for scheduled history.'
WORKFLOW_TASK_WAITING_FOR_HISTORY_TYPE  : mixed = 'WorkflowTaskWaitingForHistory'

Properties

$maxExternalPayloadBytes  : int
$namespace  : string
$workerProtocolVersion  : string
$activityLeaseBinding  : ActivityLeaseBinding
$activityLeaseBootstrap  : string|null
$authentication  : Authentication|null
$baseUri  : string
$boundedWorkerRequests  : bool
$claimedTaskReadyAgeSupported  : bool
$codec  : PayloadCodec
$executionTelemetry  : ExecutionTelemetry|null
$failureReports  : FailureReportLimiter
$metricsObserver  : MetricsObserver
$metricsRequest  : ClientRequestObservation|null
$observabilityContextSupported  : bool
$payloadUploads  : RuntimePayloadUploads
$transport  : Transport
$updateOutcomeReadsSupported  : bool|null
Cached once a Server has advertised update_outcome_reads (server#1131).
$workerPayloadObserver  : callable(string, Array, array<string, mixed>, Array): Array|null
$workerPollCutoffObserver  : callable(array<string, mixed>): void|null

Methods

__construct()  : mixed
acknowledgeActivityCancellation()  : array<string, mixed>
Report an original owner's stopped and joined remote callback. Never renews task authority.
activityContinuationHistory()  : array<string, mixed>
Server #1078: the run's history for computing an activity's continuation.
activityTaskStatus()  : array<string, mixed>
Observe ownership without renewing a lease or recording user progress.
appendMessageStream()  : array<string, mixed>
appendWorkflowStream()  : WorkflowStreamAppendResult
archiveWorkflow()  : array<string, mixed>
backfillSchedule()  : array<string, mixed>
boundedOperatorDashboard()  : array<string, mixed>
Dashboard aggregates without fleet-wide history audits. Unevaluated audit counts remain null. Servers without this route report HTTP 404.
cancelServiceOperation()  : ServiceOperationDescription
cancelWorkflow()  : array<string, mixed>
closeWorkerSession()  : array<string, mixed>
closeWorkflowStream()  : WorkflowStreamDescription
clusterInfo()  : ClusterInfo
completeActivityTask()  : array<string, mixed>
completeActivityTaskWithContinuation()  : array<string, mixed>
Server #1078: complete an activity and propose the run's next workflow task commands.
completeQueryTask()  : array<string, mixed>
completeWorkflowTask()  : array<string, mixed>
createNamespace()  : NamespaceDescription
createSchedule()  : ScheduleHandle
createSearchAttribute()  : SearchAttributeDefinition
createWorkerSession()  : array<string, mixed>
deleteNamespace()  : NamespaceDescription
deleteSchedule()  : void
deleteSearchAttribute()  : SearchAttributeDefinition
deliverWorkflowCancellation()  : array<string, mixed>
Commit delivery on the current claim without releasing or renewing its lease.
deregisterWorker()  : void
deregisterWorkerRegistration()  : array{worker_id: string, outcome: string, recovered_workflow_task_count: int}
describeNamespace()  : NamespaceDescription
describeSchedule()  : ScheduleDescription
describeServiceCatalogCall()  : array<string, mixed>
describeServiceCatalogEndpoint()  : array<string, mixed>
describeServiceCatalogOperation()  : array<string, mixed>
describeServiceCatalogService()  : array<string, mixed>
describeServiceOperation()  : ServiceOperationDescription
describeTaskQueue()  : array<string, mixed>
describeTaskQueueActivityDispatch()  : array<string, mixed>
Read whether activity dispatch is paused on one task queue of the client's namespace.
describeWorker()  : array<string, mixed>
describeWorkflow()  : WorkflowExecution
describeWorkflowStream()  : WorkflowStreamDescription
executeServiceOperation()  : ServiceOperationDescription
exportWorkflowHistory()  : array<string, mixed>
failActivityTask()  : array<string, mixed>
failQueryTask()  : array<string, mixed>
failWorkflowTask()  : array<string, mixed>
health()  : array<string, mixed>
heartbeatActivityTask()  : array<string, mixed>
heartbeatWorker()  : array<string, mixed>
heartbeatWorkflowTask()  : array<string, mixed>
iterateWorkflowHistory()  : Generator<int, array<string, mixed>>
Lazily enumerate the raw events of one exact run. This does not follow continue-as-new or subscribe after the last page.
iterateWorkflows()  : Generator<int, WorkflowExecution>
Lazily enumerate workflow visibility results in the Server's order.
iterateWorkflowStream()  : Generator<int, WorkflowStreamItem>
listNamespaces()  : array<int, NamespaceDescription>
listSchedules()  : SchedulePage
Return one server-filtered schedule page.
listSearchAttributes()  : SearchAttributeCollection
listServiceCatalogCalls()  : array<string, mixed>
listServiceCatalogEndpoints()  : array<string, mixed>
listServiceCatalogOperations()  : array<string, mixed>
listServiceCatalogServices()  : array<string, mixed>
listTaskQueues()  : array<string, mixed>
listWorkers()  : array<string, mixed>
listWorkflowRuns()  : array<int, WorkflowRun>
listWorkflows()  : WorkflowPage
listWorkflowStreams()  : array<int, WorkflowStreamDescription>
metricsRecorder()  : MetricsRecorder
operatorDashboard()  : array<string, mixed>
operatorMetrics()  : array<string, mixed>
pauseSchedule()  : void
pauseTaskQueueActivityDispatch()  : array<string, mixed>
Pause activity dispatch on one task queue of the client's namespace (native Server 3.8.0).
payloadCodec()  : PayloadCodec
pollActivityTask()  : array<string, mixed>|null
pollActivityTaskResponse()  : array<string, mixed>
Return the complete activity-task poll response, including typed refusal and protocol metadata.
pollQueryTask()  : array<string, mixed>|null
pollQueryTaskResponse()  : array<string, mixed>
Return the complete query-task poll response, including typed refusal and protocol metadata.
pollWorkflowTask()  : array<string, mixed>|null
pollWorkflowTaskResponse()  : array<string, mixed>
Return the complete workflow-task poll response, including typed refusal and protocol metadata.
queryTaskStatus()  : array<string, mixed>
Observe an original query claim without renewing it. Requires advertised query_task_authority support and worker protocol 1.20.
queryWorkflow()  : mixed
redriveWorkflow()  : array<string, mixed>
registerWorker()  : array<string, mixed>
Registers a low-level worker without advertising unsupported validator authoring.
renewActivityTaskLease()  : array<string, mixed>
Renew only the original runtime lease, without recording application progress.
renewWorkerSession()  : array<string, mixed>
repairWorkflow()  : array<string, mixed>
requestWorkflowCancellation()  : array<string, mixed>
Request bounded workflow-authored cleanup on a capable runtime.
resumeSchedule()  : void
resumeTaskQueueActivityDispatch()  : array<string, mixed>
Resume activity dispatch on one task queue of the client's namespace (native Server 3.8.0).
scheduleHandle()  : ScheduleHandle
scheduleHistory()  : array<string, mixed>
setNamespaceExternalStorage()  : NamespaceDescription
signalWorkflow()  : array<string, mixed>
Send a signal and return the Server receipt.
startServiceOperation()  : ServiceOperationHandle
startWorkflow()  : WorkflowHandle
subscribeWorkflowStream()  : WorkflowStreamPage
Read one bounded page starting at an inclusive offset.
systemHealth()  : array<string, mixed>
terminateWorkflow()  : array<string, mixed>
triggerSchedule()  : array<string, mixed>
updateNamespace()  : NamespaceDescription
updateOutcome()  : mixed
Read an accepted update's outcome later by its update id, without submitting it again.
updateOutcomeReceipt()  : array<string, mixed>
Read an accepted update's Server receipt by update id (server#1131). It writes nothing.
updateSchedule()  : void
updateWorkflow()  : mixed
Send an update and return its decoded result.
updateWorkflowReceipt()  : array<string, mixed>
Send an update and return the Server receipt.
withActivityLeaseBootstrap()  : self
Recreate custom authentication and HTTP configuration in the independent lease-maintenance process. The trusted PHP file must return a Client with this same runtime URI, namespace and protocol. It never runs user activity code.
withFailureReportLimit()  : self
Narrow the encoded failure-report request budget for an application transport.
withMetrics()  : self
withNamespace()  : self
Return a new client with the same transport, authentication, and codec for another namespace.
withTelemetry()  : self
Configure tracing before explicit cluster discovery and business I/O.
workerClusterInfo()  : ClusterInfo
Discover ordinary runtime capabilities using the worker credential.
workflowActivities()  : array<string, mixed>
workflowActivityResult()  : array<string, mixed>
Inspect one activity's canonical result in an exact run.
workflowDiagnostics()  : array<string, mixed>
workflowHandle()  : WorkflowHandle
workflowHistory()  : array<string, mixed>
Read one bounded history page. Pass its next_page_token to continue.
workflowObservation()  : array<string, mixed>
Read bounded run metadata without loading full diagnostics or application payloads.
workflowResult()  : mixed
workflowTaskHistory()  : array<string, mixed>
workflowTypeOperatorDashboard()  : array<string, mixed>
Bounded workflow aggregates for explicit types. An empty list matches no workflows. Operational metrics retain their namespace scope.
advancePaginationCycle()  : void
assertOutboundAvroPayload()  : void
assertWorkflowCommandPayloads()  : void
cancellationScopeClaimHistory()  : array<int, mixed>
carriedPollResponse()  : array<string, mixed>
commandRequestId()  : string
The caller command key for a signal or update: validated when supplied, otherwise generated once per call.
continuationToken()  : string|null
control()  : array<string, mixed>
dashboardWorkflowTypeQuery()  : string
decodedResponsePayload()  : mixed
hasExactKeys()  : bool
isValidExternalPayloadReference()  : bool
isWorkflowCommandCompletion()  : bool
Server 3.6.0 bounds these requests by its workflow-task completion limit.
iteratePages()  : Generator<int, T>
observeRequest()  : array<string, mixed>
paginationItems()  : array<int, array<string, mixed>>
pathWithQuery()  : string
performPollTaskResponse()  : array<string, mixed>
performRequest()  : array<string, mixed>
pollTaskResponse()  : array<string, mixed>
registrationMap()  : array<string|int, mixed>|stdClass|null
Keep a keyed registration map from becoming a JSON list for names 0, 1, .
rememberClaimedTaskReadyAge()  : void
request()  : array<string, mixed>
requestHeaders()  : array<string, string>
requestId()  : string
requestServiceOperation()  : ServiceOperationDescription
resolveResponsePayloads()  : array<string, mixed>
resultFromResponse()  : mixed
segment()  : string
sendTransportRequest()  : array<string, mixed>|array<int, mixed>|null
serviceCatalogRead()  : array<string, mixed>
serviceOperationBody()  : array<string, mixed>
serviceOperationPath()  : string
taskQueueActivityDispatch()  : array<string, mixed>
terminalHistoryPayloadPaths()  : array<int, array<int, int|string>>
terminalResult()  : mixed
updateStillPending()  : bool
A completed wait that ended before the update finished carries no result. Returning the receipt in its place would hand callers an array that looks like the handler's result.
withObservabilityContext()  : array<string|int, mixed>
withoutNulls()  : array<string, mixed>
worker()  : array<string, mixed>
workflowOperationPath()  : string
workflowStreamPath()  : string

Constants

ACTIVITY_TASK_PATH

private mixed ACTIVITY_TASK_PATH = '/worker/activity-tasks/'

CLUSTER_INFO_PATH

private mixed CLUSTER_INFO_PATH = '/cluster/info'

EXTERNAL_PAYLOAD_REFERENCE_SCHEMA

private mixed EXTERNAL_PAYLOAD_REFERENCE_SCHEMA = 'durable-workflow.v2.external-payload-reference.v1'

TASK_COMPLETION_SUFFIX

private mixed TASK_COMPLETION_SUFFIX = '/complete'

WORKFLOW_TASK_WAITING_FOR_HISTORY_MESSAGE

private mixed WORKFLOW_TASK_WAITING_FOR_HISTORY_MESSAGE = 'Workflow task waiting for scheduled history.'

WORKFLOW_TASK_WAITING_FOR_HISTORY_TYPE

private mixed WORKFLOW_TASK_WAITING_FOR_HISTORY_TYPE = 'WorkflowTaskWaitingForHistory'

Properties

$maxExternalPayloadBytes read-only

public int $maxExternalPayloadBytes = 67108864

$namespace read-only

public string $namespace = 'default'

$workerProtocolVersion read-only

public string $workerProtocolVersion = Version::WORKER_PROTOCOL

$activityLeaseBinding

private ActivityLeaseBinding $activityLeaseBinding

$activityLeaseBootstrap

private string|null $activityLeaseBootstrap = null

$baseUri read-only

private string $baseUri

$boundedWorkerRequests

private bool $boundedWorkerRequests = false

$claimedTaskReadyAgeSupported

private bool $claimedTaskReadyAgeSupported = false

$failureReports

private FailureReportLimiter $failureReports

$metricsObserver

private MetricsObserver $metricsObserver

$metricsRequest

private ClientRequestObservation|null $metricsRequest = null

$observabilityContextSupported

private bool $observabilityContextSupported = false

$updateOutcomeReadsSupported

Cached once a Server has advertised update_outcome_reads (server#1131).

private bool|null $updateOutcomeReadsSupported = null

$workerPayloadObserver

private callable(string, Array, array<string, mixed>, Array): Array|null $workerPayloadObserver = null

$workerPollCutoffObserver

private callable(array<string, mixed>): void|null $workerPollCutoffObserver = null

Methods

__construct()

public __construct(string $baseUri[, Authentication|null $authentication = null ][, string $namespace = 'default' ][, Transport|null $transport = null ][, PayloadCodec|null $codec = null ][, string|null $token = null ][, string|null $controlToken = null ][, string|null $workerToken = null ][, int $maxExternalPayloadBytes = 67108864 ][, string $workerProtocolVersion = Version::WORKER_PROTOCOL ][, float|null $requestTimeoutSeconds = null ][, float|null $workerRequestTimeoutSeconds = null ][, MetricsRecorder|null $metrics = null ]) : mixed
Parameters
$baseUri : string
$authentication : Authentication|null = null
$namespace : string = 'default'
$transport : Transport|null = null
$codec : PayloadCodec|null = null
$token : string|null = null
$controlToken : string|null = null
$workerToken : string|null = null
$maxExternalPayloadBytes : int = 67108864
$workerProtocolVersion : string = Version::WORKER_PROTOCOL
$requestTimeoutSeconds : float|null = null
$workerRequestTimeoutSeconds : float|null = null
$metrics : MetricsRecorder|null = null

acknowledgeActivityCancellation()

Report an original owner's stopped and joined remote callback. Never renews task authority.

public acknowledgeActivityCancellation(string $taskId, string $activityAttemptId, string $leaseOwner, string $requestId[, RequestBudget|null $budget = null ]) : array<string, mixed>
Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
$requestId : string
$budget : RequestBudget|null = null
Return values
array<string, mixed>

activityContinuationHistory()

Server #1078: the run's history for computing an activity's continuation.

public activityContinuationHistory(string $taskId, string $activityAttemptId, string $leaseOwner) : array<string, mixed>
Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
Return values
array<string, mixed>

activityTaskStatus()

Observe ownership without renewing a lease or recording user progress.

public activityTaskStatus(string $taskId, string $activityAttemptId, string $leaseOwner[, RequestBudget|null $budget = null ]) : array<string, mixed>
Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
$budget : RequestBudget|null = null
Return values
array<string, mixed>

appendMessageStream()

public appendMessageStream(string $workflowId, string $streamName, string $messageId[, array<int, mixed> $arguments = [] ]) : array<string, mixed>
Parameters
$workflowId : string
$streamName : string
$messageId : string
$arguments : array<int, mixed> = []
Return values
array<string, mixed>

archiveWorkflow()

public archiveWorkflow(string $workflowId[, string|null $reason = null ][, string|null $runId = null ]) : array<string, mixed>
Parameters
$workflowId : string
$reason : string|null = null
$runId : string|null = null
Return values
array<string, mixed>

backfillSchedule()

public backfillSchedule(string $scheduleId, string $startTime, string $endTime[, string|null $overlapPolicy = null ]) : array<string, mixed>
Parameters
$scheduleId : string
$startTime : string
$endTime : string
$overlapPolicy : string|null = null
Return values
array<string, mixed>

boundedOperatorDashboard()

Dashboard aggregates without fleet-wide history audits. Unevaluated audit counts remain null. Servers without this route report HTTP 404.

public boundedOperatorDashboard() : array<string, mixed>
Return values
array<string, mixed>

cancelServiceOperation()

public cancelServiceOperation(string $endpointName, string $serviceName, string $operationName, string $serviceCallId[, string|null $reason = null ]) : ServiceOperationDescription
Parameters
$endpointName : string
$serviceName : string
$operationName : string
$serviceCallId : string
$reason : string|null = null
Return values
ServiceOperationDescription

cancelWorkflow()

public cancelWorkflow(string $workflowId[, string|null $reason = null ][, string|null $runId = null ]) : array<string, mixed>
Parameters
$workflowId : string
$reason : string|null = null
$runId : string|null = null
Return values
array<string, mixed>

closeWorkerSession()

public closeWorkerSession(string $workerId, string $sessionId[, string $reason = 'worker_shutdown' ]) : array<string, mixed>
Parameters
$workerId : string
$sessionId : string
$reason : string = 'worker_shutdown'
Return values
array<string, mixed>

closeWorkflowStream()

public closeWorkflowStream(string $workflowId, string $runId, string $streamName[, string|null $errorReason = null ][, int|null $retentionSeconds = null ]) : WorkflowStreamDescription
Parameters
$workflowId : string
$runId : string
$streamName : string
$errorReason : string|null = null
$retentionSeconds : int|null = null
Return values
WorkflowStreamDescription

clusterInfo()

public clusterInfo([bool $includeDiagnostics = false ]) : ClusterInfo
Parameters
$includeDiagnostics : bool = false
Return values
ClusterInfo

completeActivityTask()

public completeActivityTask(string $taskId, string $activityAttemptId, string $leaseOwner, mixed $result[, array{worker_id: string, task_queue: string, poll_request_id: string, timeout_seconds: int, history_page_size: int, task_kinds: list}|null $workflowPoll = null ]) : array<string, mixed>
Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
$result : mixed
$workflowPoll : array{worker_id: string, task_queue: string, poll_request_id: string, timeout_seconds: int, history_page_size: int, task_kinds: list}|null = null
Return values
array<string, mixed>

completeActivityTaskWithContinuation()

Server #1078: complete an activity and propose the run's next workflow task commands.

public completeActivityTaskWithContinuation(string $taskId, string $activityAttemptId, string $leaseOwner, mixed $result, array{worker_id: string, task_queue: string, poll_request_id: string, timeout_seconds: int, history_page_size: int, task_kinds: list} $workflowPoll, array{version: int, history_through_sequence: int, history_last_event_id: string, commands: list>} $continuation) : array<string, mixed>
Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
$result : mixed
$workflowPoll : array{worker_id: string, task_queue: string, poll_request_id: string, timeout_seconds: int, history_page_size: int, task_kinds: list}
$continuation : array{version: int, history_through_sequence: int, history_last_event_id: string, commands: list>}
Return values
array<string, mixed>

completeQueryTask()

public completeQueryTask(string $taskId, string $leaseOwner, int $attempt, mixed $result[, RequestBudget|null $budget = null ]) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$result : mixed
$budget : RequestBudget|null = null
Return values
array<string, mixed>

completeWorkflowTask()

public completeWorkflowTask(string $taskId, string $leaseOwner, int $attempt, array<int, array<string, mixed>> $commands[, array<int, array{stream_name: string, through_position: int}> $messageStreamCursors = [] ][, array<int, array{stream_name: string, after_position: int}> $messageStreamWaits = [] ][, array{worker_id: string, workflow_id: string, run_id: string, build_id: string, ttl_seconds: int, metrics: array{hit: int, miss: int, eviction: int, forced_cold_replay: int}}|null $stickyCache = null ][, array{worker_id: string, task_queue: string, poll_request_id: string, timeout_seconds: int}|null $activityPoll = null ][, array{worker_id: string, task_queue: string, poll_request_id: string, timeout_seconds: int, history_page_size: int, task_kinds: list}|null $workflowPoll = null ]) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$commands : array<int, array<string, mixed>>
$messageStreamCursors : array<int, array{stream_name: string, through_position: int}> = []
$messageStreamWaits : array<int, array{stream_name: string, after_position: int}> = []
$stickyCache : array{worker_id: string, workflow_id: string, run_id: string, build_id: string, ttl_seconds: int, metrics: array{hit: int, miss: int, eviction: int, forced_cold_replay: int}}|null = null
$activityPoll : array{worker_id: string, task_queue: string, poll_request_id: string, timeout_seconds: int}|null = null
$workflowPoll : array{worker_id: string, task_queue: string, poll_request_id: string, timeout_seconds: int, history_page_size: int, task_kinds: list}|null = null
Return values
array<string, mixed>

createNamespace()

public createNamespace(string $name[, string|null $description = null ][, int $retentionDays = 30 ]) : NamespaceDescription
Parameters
$name : string
$description : string|null = null
$retentionDays : int = 30
Return values
NamespaceDescription

createSchedule()

public createSchedule(ScheduleSpec $spec, ScheduleAction $action[, string|null $scheduleId = null ][, string|null $overlapPolicy = null ][, int|null $jitterSeconds = null ][, int|null $maxRuns = null ][, array<string, mixed>|null $memo = null ][, array<string, mixed>|null $searchAttributes = null ][, bool $paused = false ][, string|null $note = null ]) : ScheduleHandle
Parameters
$spec : ScheduleSpec
$action : ScheduleAction
$scheduleId : string|null = null
$overlapPolicy : string|null = null
$jitterSeconds : int|null = null
$maxRuns : int|null = null
$memo : array<string, mixed>|null = null
$searchAttributes : array<string, mixed>|null = null
$paused : bool = false
$note : string|null = null
Tags
throws
ScheduleAlreadyExists

when the schedule id is taken, including by a deleted or exhausted schedule

Return values
ScheduleHandle

deleteSchedule()

public deleteSchedule(string $scheduleId) : void
Parameters
$scheduleId : string

deliverWorkflowCancellation()

Commit delivery on the current claim without releasing or renewing its lease.

public deliverWorkflowCancellation(string $taskId, string $leaseOwner, int $attempt, CancellationDelivery $delivery) : array<string, mixed>

Reload canonical history before throwing cancellation into workflow code, including when the delivery acknowledgment is lost or malformed.

Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$delivery : CancellationDelivery
Return values
array<string, mixed>

deregisterWorker()

public deregisterWorker(string $workerId) : void
Parameters
$workerId : string

deregisterWorkerRegistration()

public deregisterWorkerRegistration(string $workerId[, string|null $registrationToken = null ][, RequestBudget|null $budget = null ]) : array{worker_id: string, outcome: string, recovered_workflow_task_count: int}
Parameters
$workerId : string
$registrationToken : string|null = null
$budget : RequestBudget|null = null
Return values
array{worker_id: string, outcome: string, recovered_workflow_task_count: int}

describeServiceCatalogCall()

public describeServiceCatalogCall(string $callId) : array<string, mixed>
Parameters
$callId : string
Return values
array<string, mixed>

describeServiceCatalogEndpoint()

public describeServiceCatalogEndpoint(string $endpointId) : array<string, mixed>
Parameters
$endpointId : string
Return values
array<string, mixed>

describeServiceCatalogOperation()

public describeServiceCatalogOperation(string $operationId) : array<string, mixed>
Parameters
$operationId : string
Return values
array<string, mixed>

describeServiceCatalogService()

public describeServiceCatalogService(string $serviceId) : array<string, mixed>
Parameters
$serviceId : string
Return values
array<string, mixed>

describeServiceOperation()

public describeServiceOperation(string $endpointName, string $serviceName, string $operationName, string $serviceCallId) : ServiceOperationDescription
Parameters
$endpointName : string
$serviceName : string
$operationName : string
$serviceCallId : string
Return values
ServiceOperationDescription

describeTaskQueue()

public describeTaskQueue(string $taskQueue) : array<string, mixed>
Parameters
$taskQueue : string
Return values
array<string, mixed>

describeTaskQueueActivityDispatch()

Read whether activity dispatch is paused on one task queue of the client's namespace.

public describeTaskQueueActivityDispatch(string $taskQueue) : array<string, mixed>

Returns the Server's answer: namespace, task_queue and activity_dispatch (state paused or active, paused, reason, paused_at, paused_by, resumed_at, resumed_by). Needs an operator credential and a Server that advertises task_queue_activity_dispatch_pause (native 3.8.0 and later).

Parameters
$taskQueue : string
Tags
throws
ServerCapabilityUnavailable

when the Server has no activity dispatch routes

ServerException

for any other refusal, for example 403 for a worker credential

Return values
array<string, mixed>

describeWorker()

public describeWorker(string $workerId) : array<string, mixed>
Parameters
$workerId : string
Return values
array<string, mixed>

describeWorkflow()

public describeWorkflow(string $workflowId[, string|null $runId = null ]) : WorkflowExecution
Parameters
$workflowId : string
$runId : string|null = null
Return values
WorkflowExecution

exportWorkflowHistory()

public exportWorkflowHistory(string $workflowId, string $runId) : array<string, mixed>
Parameters
$workflowId : string
$runId : string
Return values
array<string, mixed>

failActivityTask()

public failActivityTask(string $taskId, string $activityAttemptId, string $leaseOwner, string $message[, string $failureType = 'PhpActivityFailure' ][, bool $nonRetryable = false ][, array<string, mixed>|null $details = null ][, string|null $stackTrace = null ][, array<string, mixed>|null $diagnostics = null ]) : array<string, mixed>
Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
$message : string
$failureType : string = 'PhpActivityFailure'
$nonRetryable : bool = false
$details : array<string, mixed>|null = null
$stackTrace : string|null = null
$diagnostics : array<string, mixed>|null = null
Return values
array<string, mixed>

failQueryTask()

public failQueryTask(string $taskId, string $leaseOwner, int $attempt, string $message[, string $reason = 'query_rejected' ][, RequestBudget|null $budget = null ]) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$message : string
$reason : string = 'query_rejected'
$budget : RequestBudget|null = null
Return values
array<string, mixed>

failWorkflowTask()

public failWorkflowTask(string $taskId, string $leaseOwner, int $attempt, string $message[, string $failureType = 'PhpWorkflowTaskFailure' ][, string|null $reason = null ][, int|null $sequence = null ][, string|null $stackTrace = null ]) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$message : string
$failureType : string = 'PhpWorkflowTaskFailure'
$reason : string|null = null
$sequence : int|null = null
$stackTrace : string|null = null
Return values
array<string, mixed>

health()

public health() : array<string, mixed>
Return values
array<string, mixed>

heartbeatActivityTask()

public heartbeatActivityTask(string $taskId, string $activityAttemptId, string $leaseOwner[, array<string|int, mixed> $details = [] ]) : array<string, mixed>
Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
$details : array<string|int, mixed> = []
Return values
array<string, mixed>

heartbeatWorker()

public heartbeatWorker(string $workerId[, array<string, int> $taskSlots = [] ][, RequestBudget|null $budget = null ][, int|null $processId = null ]) : array<string, mixed>
Parameters
$workerId : string
$taskSlots : array<string, int> = []
$budget : RequestBudget|null = null
$processId : int|null = null
Return values
array<string, mixed>

heartbeatWorkflowTask()

public heartbeatWorkflowTask(string $taskId, string $leaseOwner, int $attempt[, RequestBudget|null $budget = null ]) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$budget : RequestBudget|null = null
Return values
array<string, mixed>

iterateWorkflowHistory()

Lazily enumerate the raw events of one exact run. This does not follow continue-as-new or subscribe after the last page.

public iterateWorkflowHistory(string $workflowId, string $runId[, int|null $pageSize = null ][, string|null $nextPageToken = null ]) : Generator<int, array<string, mixed>>
Parameters
$workflowId : string
$runId : string
$pageSize : int|null = null
$nextPageToken : string|null = null
Return values
Generator<int, array<string, mixed>>

iterateWorkflows()

Lazily enumerate workflow visibility results in the Server's order.

public iterateWorkflows([string|null $workflowType = null ][, string|null $status = null ][, string|null $query = null ][, int|null $pageSize = null ][, string|null $nextPageToken = null ]) : Generator<int, WorkflowExecution>

This is not a snapshot across concurrent changes.

Parameters
$workflowType : string|null = null
$status : string|null = null
$query : string|null = null
$pageSize : int|null = null
$nextPageToken : string|null = null
Return values
Generator<int, WorkflowExecution>

iterateWorkflowStream()

public iterateWorkflowStream(string $workflowId, string $runId, string $streamName[, int $fromOffset = 0 ][, int $maxItems = 100 ][, int $waitSeconds = 30 ][, callable(): bool|null $cancelled = null ]) : Generator<int, WorkflowStreamItem>
Parameters
$workflowId : string
$runId : string
$streamName : string
$fromOffset : int = 0
$maxItems : int = 100
$waitSeconds : int = 30
$cancelled : callable(): bool|null = null
Return values
Generator<int, WorkflowStreamItem>

listSchedules()

Return one server-filtered schedule page.

public listSchedules([string|null $status = null ][, string|null $workflowType = null ][, string|null $query = null ][, int|null $pageSize = null ][, string|null $nextPageToken = null ]) : SchedulePage

Continuation tokens are opaque and must be reused with the same namespace and filters.

Parameters
$status : string|null = null
$workflowType : string|null = null
$query : string|null = null
$pageSize : int|null = null
$nextPageToken : string|null = null
Return values
SchedulePage

listServiceCatalogCalls()

public listServiceCatalogCalls([array<string, int|string> $filters = [] ]) : array<string, mixed>
Parameters
$filters : array<string, int|string> = []
Return values
array<string, mixed>

listServiceCatalogEndpoints()

public listServiceCatalogEndpoints([array<string, int|string> $filters = [] ]) : array<string, mixed>
Parameters
$filters : array<string, int|string> = []
Return values
array<string, mixed>

listServiceCatalogOperations()

public listServiceCatalogOperations([array<string, int|string> $filters = [] ]) : array<string, mixed>
Parameters
$filters : array<string, int|string> = []
Return values
array<string, mixed>

listServiceCatalogServices()

public listServiceCatalogServices([array<string, int|string> $filters = [] ]) : array<string, mixed>
Parameters
$filters : array<string, int|string> = []
Return values
array<string, mixed>

listTaskQueues()

public listTaskQueues() : array<string, mixed>
Return values
array<string, mixed>

listWorkers()

public listWorkers([string|null $taskQueue = null ][, string|null $status = null ]) : array<string, mixed>
Parameters
$taskQueue : string|null = null
$status : string|null = null
Return values
array<string, mixed>

listWorkflowRuns()

public listWorkflowRuns(string $workflowId) : array<int, WorkflowRun>
Parameters
$workflowId : string
Return values
array<int, WorkflowRun>

listWorkflows()

public listWorkflows([string|null $workflowType = null ][, string|null $status = null ][, string|null $query = null ][, int|null $pageSize = null ][, string|null $nextPageToken = null ]) : WorkflowPage
Parameters
$workflowType : string|null = null
$status : string|null = null
$query : string|null = null
$pageSize : int|null = null
$nextPageToken : string|null = null
Return values
WorkflowPage

operatorDashboard()

public operatorDashboard() : array<string, mixed>
Return values
array<string, mixed>

operatorMetrics()

public operatorMetrics() : array<string, mixed>
Return values
array<string, mixed>

pauseSchedule()

public pauseSchedule(string $scheduleId[, string|null $note = null ]) : void
Parameters
$scheduleId : string
$note : string|null = null

pauseTaskQueueActivityDispatch()

Pause activity dispatch on one task queue of the client's namespace (native Server 3.8.0).

public pauseTaskQueueActivityDispatch(string $taskQueue[, string|null $reason = null ]) : array<string, mixed>

While paused, no activity task on the queue is leased; leased activities keep running and workflow tasks are still delivered. The answer is the Server's: namespace, task_queue, outcome (paused, or already_paused when nothing changed and the original pause is reported) and activity_dispatch. $reason is optional, at most 1000 characters; the Server records the credential's principal as the one who paused. The request is sent once and never retried, so a lost answer can be checked with describeTaskQueueActivityDispatch().

Parameters
$taskQueue : string
$reason : string|null = null
Tags
throws
ServerCapabilityUnavailable

when the Server has no activity dispatch routes

ServerException

for any other refusal: 403 for a worker credential or another tenant's namespace, 422 with errors for an invalid reason or queue name

Return values
array<string, mixed>

pollActivityTask()

public pollActivityTask(string $workerId, string $taskQueue[, int $timeoutSeconds = 5 ]) : array<string, mixed>|null
Parameters
$workerId : string
$taskQueue : string
$timeoutSeconds : int = 5
Return values
array<string, mixed>|null

pollActivityTaskResponse()

Return the complete activity-task poll response, including typed refusal and protocol metadata.

public pollActivityTaskResponse(string $workerId, string $taskQueue[, int $timeoutSeconds = 5 ][, string|null $pollRequestId = null ]) : array<string, mixed>
Parameters
$workerId : string
$taskQueue : string
$timeoutSeconds : int = 5
$pollRequestId : string|null = null
Return values
array<string, mixed>

pollQueryTask()

public pollQueryTask(string $workerId, string $taskQueue[, int $timeoutSeconds = 5 ]) : array<string, mixed>|null
Parameters
$workerId : string
$taskQueue : string
$timeoutSeconds : int = 5
Return values
array<string, mixed>|null

pollQueryTaskResponse()

Return the complete query-task poll response, including typed refusal and protocol metadata.

public pollQueryTaskResponse(string $workerId, string $taskQueue[, int $timeoutSeconds = 5 ][, string|null $pollRequestId = null ]) : array<string, mixed>
Parameters
$workerId : string
$taskQueue : string
$timeoutSeconds : int = 5
$pollRequestId : string|null = null
Return values
array<string, mixed>

pollWorkflowTask()

public pollWorkflowTask(string $workerId, string $taskQueue[, int $timeoutSeconds = 5 ]) : array<string, mixed>|null
Parameters
$workerId : string
$taskQueue : string
$timeoutSeconds : int = 5
Return values
array<string, mixed>|null

pollWorkflowTaskResponse()

Return the complete workflow-task poll response, including typed refusal and protocol metadata.

public pollWorkflowTaskResponse(string $workerId, string $taskQueue[, int $timeoutSeconds = 5 ][, string|null $pollRequestId = null ][, int|null $historyPageSize = null ]) : array<string, mixed>
Parameters
$workerId : string
$taskQueue : string
$timeoutSeconds : int = 5
$pollRequestId : string|null = null
$historyPageSize : int|null = null
Return values
array<string, mixed>

queryTaskStatus()

Observe an original query claim without renewing it. Requires advertised query_task_authority support and worker protocol 1.20.

public queryTaskStatus(string $taskId, string $leaseOwner, int $attempt[, RequestBudget|null $budget = null ]) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$budget : RequestBudget|null = null
Return values
array<string, mixed>

queryWorkflow()

public queryWorkflow(string $workflowId, string $queryName[, array<int, mixed> $arguments = [] ][, string|null $runId = null ]) : mixed
Parameters
$workflowId : string
$queryName : string
$arguments : array<int, mixed> = []
$runId : string|null = null

redriveWorkflow()

public redriveWorkflow(string $workflowId, string $failedRunId[, string|null $requestId = null ]) : array<string, mixed>
Parameters
$workflowId : string
$failedRunId : string
$requestId : string|null = null
Return values
array<string, mixed>

registerWorker()

Registers a low-level worker without advertising unsupported validator authoring.

public registerWorker(string $workerId, string $taskQueue, array<int, string> $workflowTypes, array<int, string> $activityTypes[, array<int, string> $capabilities = ['query_tasks', 'workflow_updates', 'message_streams', 'memo_upserts', 'typed_search_attributes', 'durable_selection'] ][, int $maxConcurrentWorkflowTasks = 1 ][, int $maxConcurrentActivityTasks = 1 ][, string|null $buildId = null ][, array<string|int, array{queries: list, query_contracts: list}>, signals: list, signal_contracts: list}>, updates: list, update_validators?: list, update_contracts: list}>}>|null $workflowCommandContracts = null ][, array<string, array<string, bool|string>>|null $capabilityManifest = null ][, int $maxConcurrentWorkerSessions = 10 ][, array<string|int, string>|null $workflowDefinitionFingerprints = null ]) : array<string, mixed>

Workflow command contracts may omit update_validators for backward compatibility. When present, update_validators is a list<string> and must be empty.

Parameters
$workerId : string
$taskQueue : string
$workflowTypes : array<int, string>
$activityTypes : array<int, string>
$capabilities : array<int, string> = ['query_tasks', 'workflow_updates', 'message_streams', 'memo_upserts', 'typed_search_attributes', 'durable_selection']
$maxConcurrentWorkflowTasks : int = 1
$maxConcurrentActivityTasks : int = 1
$buildId : string|null = null
$workflowCommandContracts : array<string|int, array{queries: list, query_contracts: list}>, signals: list, signal_contracts: list}>, updates: list, update_validators?: list, update_contracts: list}>}>|null = null
$capabilityManifest : array<string, array<string, bool|string>>|null = null
$maxConcurrentWorkerSessions : int = 10
$workflowDefinitionFingerprints : array<string|int, string>|null = null
Tags
throws
InvalidArgumentException
Return values
array<string, mixed>

renewActivityTaskLease()

Renew only the original runtime lease, without recording application progress.

public renewActivityTaskLease(string $taskId, string $activityAttemptId, string $leaseOwner[, RequestBudget|null $budget = null ]) : array<string, mixed>

Discovery and transport share at most five seconds and any earlier caller ceiling. The caller must validate the returned original identity and actual grant before use.

Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
$budget : RequestBudget|null = null
Return values
array<string, mixed>

renewWorkerSession()

public renewWorkerSession(string $workerId, string $sessionId, int $leaseSeconds) : array<string, mixed>
Parameters
$workerId : string
$sessionId : string
$leaseSeconds : int
Return values
array<string, mixed>

repairWorkflow()

public repairWorkflow(string $workflowId[, string|null $runId = null ]) : array<string, mixed>
Parameters
$workflowId : string
$runId : string|null = null
Return values
array<string, mixed>

requestWorkflowCancellation()

Request bounded workflow-authored cleanup on a capable runtime.

public requestWorkflowCancellation(string $workflowId[, string|null $reason = null ][, int|null $cleanupTimeoutSeconds = null ][, string|null $runId = null ]) : array<string, mixed>

Repeated requests retain the Server's original identity and deadline.

Parameters
$workflowId : string
$reason : string|null = null
$cleanupTimeoutSeconds : int|null = null
$runId : string|null = null
Return values
array<string, mixed>

resumeSchedule()

public resumeSchedule(string $scheduleId[, string|null $note = null ]) : void
Parameters
$scheduleId : string
$note : string|null = null

resumeTaskQueueActivityDispatch()

Resume activity dispatch on one task queue of the client's namespace (native Server 3.8.0).

public resumeTaskQueueActivityDispatch(string $taskQueue) : array<string, mixed>

The answer is the Server's: namespace, task_queue, outcome (resumed, or not_paused when nothing changed) and activity_dispatch. Sent once, never retried.

Parameters
$taskQueue : string
Tags
throws
ServerCapabilityUnavailable

when the Server has no activity dispatch routes

ServerException

for any other refusal, for example 403 for a worker credential

Return values
array<string, mixed>

scheduleHistory()

public scheduleHistory(string $scheduleId[, int|null $limit = null ][, int|null $afterSequence = null ]) : array<string, mixed>
Parameters
$scheduleId : string
$limit : int|null = null
$afterSequence : int|null = null
Return values
array<string, mixed>

setNamespaceExternalStorage()

public setNamespaceExternalStorage(string $name, string $driver[, bool $enabled = true ][, int|null $thresholdBytes = null ][, array<string, mixed>|null $config = null ]) : NamespaceDescription
Parameters
$name : string
$driver : string
$enabled : bool = true
$thresholdBytes : int|null = null
$config : array<string, mixed>|null = null
Return values
NamespaceDescription

signalWorkflow()

Send a signal and return the Server receipt.

public signalWorkflow(string $workflowId, string $signalName[, array<int, mixed> $arguments = [] ][, string|null $runId = null ][, string|null $requestId = null ]) : array<string, mixed>

$requestId is the caller command key (1 to 255 Unicode characters). Omit it to generate sdk-php-signal-<hex> once per call. The receipt always carries request_id; retrying with the same key and intent returns the retained receipt (retained: true) instead of a second signal.

Parameters
$workflowId : string
$signalName : string
$arguments : array<int, mixed> = []
$runId : string|null = null
$requestId : string|null = null
Return values
array<string, mixed>

startWorkflow()

public startWorkflow(string $workflowType, string $workflowId, string $taskQueue[, array<int, mixed> $input = [] ][, int $executionTimeoutSeconds = 3600 ][, int $runTimeoutSeconds = 600 ][, string|null $duplicatePolicy = null ][, array<string, mixed>|null $memo = null ][, array<string, mixed>|null $searchAttributes = null ][, int|null $priority = null ][, string|null $fairnessKey = null ][, int|null $fairnessWeight = null ][, string|null $buildId = null ]) : WorkflowHandle
Parameters
$workflowType : string
$workflowId : string
$taskQueue : string
$input : array<int, mixed> = []
$executionTimeoutSeconds : int = 3600
$runTimeoutSeconds : int = 600
$duplicatePolicy : string|null = null
$memo : array<string, mixed>|null = null
$searchAttributes : array<string, mixed>|null = null
$priority : int|null = null
$fairnessKey : string|null = null
$fairnessWeight : int|null = null
$buildId : string|null = null
Return values
WorkflowHandle

subscribeWorkflowStream()

Read one bounded page starting at an inclusive offset.

public subscribeWorkflowStream(string $workflowId, string $runId, string $streamName[, int $fromOffset = 0 ][, int $maxItems = 100 ][, int $waitSeconds = 0 ][, callable|null $cancelled = null ]) : WorkflowStreamPage

Delivery is at least once: persist nextOffset only after processing the page, and make item processing idempotent. The cancellation callback is checked before and after the bounded HTTP long poll.

Parameters
$workflowId : string
$runId : string
$streamName : string
$fromOffset : int = 0
$maxItems : int = 100
$waitSeconds : int = 0
$cancelled : callable|null = null
Return values
WorkflowStreamPage

systemHealth()

public systemHealth() : array<string, mixed>
Return values
array<string, mixed>

terminateWorkflow()

public terminateWorkflow(string $workflowId[, string|null $reason = null ][, string|null $runId = null ]) : array<string, mixed>
Parameters
$workflowId : string
$reason : string|null = null
$runId : string|null = null
Return values
array<string, mixed>

triggerSchedule()

public triggerSchedule(string $scheduleId[, string|null $overlapPolicy = null ]) : array<string, mixed>
Parameters
$scheduleId : string
$overlapPolicy : string|null = null
Return values
array<string, mixed>

updateNamespace()

public updateNamespace(string $name[, string|null $description = null ][, int|null $retentionDays = null ]) : NamespaceDescription
Parameters
$name : string
$description : string|null = null
$retentionDays : int|null = null
Return values
NamespaceDescription

updateOutcome()

Read an accepted update's outcome later by its update id, without submitting it again.

public updateOutcome(string $workflowId, string $updateId[, string $waitFor = 'completed' ][, int|null $waitTimeoutSeconds = null ]) : mixed

By default this waits for the outcome, like updateWorkflow(). It returns the decoded result of a completed update (including null), throws UpdateStillPending while the update is still accepted, and throws UpdateFailed for a failed or rejected update, or for 404 update_not_found (no retained update has that id, for example after pruning). Needs a Server that advertises update_outcome_reads (native 3.6.0 and later).

Parameters
$workflowId : string
$updateId : string
$waitFor : string = 'completed'
$waitTimeoutSeconds : int|null = null
Tags
throws
UpdateStillPending
UpdateFailed
LogicException

when the Server doesn't advertise update_outcome_reads

updateOutcomeReceipt()

Read an accepted update's Server receipt by update id (server#1131). It writes nothing.

public updateOutcomeReceipt(string $workflowId, string $updateId[, string $waitFor = 'accepted' ][, int|null $waitTimeoutSeconds = null ]) : array<string, mixed>

Refuses with a LogicException when the Server doesn't advertise update_outcome_reads: resubmitting the update is never a substitute for reading it.

Parameters
$workflowId : string
$updateId : string
$waitFor : string = 'accepted'
$waitTimeoutSeconds : int|null = null
Tags
throws
UpdateFailed
LogicException

when the Server doesn't advertise update_outcome_reads

Return values
array<string, mixed>

updateSchedule()

public updateSchedule(string $scheduleId, array<string, mixed> $changes) : void
Parameters
$scheduleId : string
$changes : array<string, mixed>

updateWorkflow()

Send an update and return its decoded result.

public updateWorkflow(string $workflowId, string $updateName[, array<int, mixed> $arguments = [] ][, string $waitFor = 'completed' ][, int|null $waitTimeoutSeconds = null ][, string|null $requestId = null ][, string|null $runId = null ]) : mixed

With $waitFor = 'completed' (the default), an update that hasn't completed when the wait ends throws UpdateStillPending. Call this again with the same $requestId to keep waiting; the Server returns the retained update instead of admitting a second one. With $waitFor = 'accepted' this returns the acceptance receipt. Use updateWorkflowReceipt() to read the raw receipt in either case.

Parameters
$workflowId : string
$updateName : string
$arguments : array<int, mixed> = []
$waitFor : string = 'completed'
$waitTimeoutSeconds : int|null = null
$requestId : string|null = null
$runId : string|null = null
Tags
throws
UpdateStillPending

updateWorkflowReceipt()

Send an update and return the Server receipt.

public updateWorkflowReceipt(string $workflowId, string $updateName[, array<int, mixed> $arguments = [] ][, string $waitFor = 'completed' ][, int|null $waitTimeoutSeconds = null ][, string|null $requestId = null ][, string|null $runId = null ]) : array<string, mixed>

$requestId is the caller command key (1 to 255 Unicode characters). Omit it to generate sdk-php-update-<hex> once per call. The receipt always carries request_id; retrying with the same key and intent returns the retained receipt (retained: true) instead of a second update.

Parameters
$workflowId : string
$updateName : string
$arguments : array<int, mixed> = []
$waitFor : string = 'completed'
$waitTimeoutSeconds : int|null = null
$requestId : string|null = null
$runId : string|null = null
Return values
array<string, mixed>

withActivityLeaseBootstrap()

Recreate custom authentication and HTTP configuration in the independent lease-maintenance process. The trusted PHP file must return a Client with this same runtime URI, namespace and protocol. It never runs user activity code.

public withActivityLeaseBootstrap(string $path) : self
Parameters
$path : string
Return values
self

withFailureReportLimit()

Narrow the encoded failure-report request budget for an application transport.

public withFailureReportLimit(int $requestBytes) : self
Parameters
$requestBytes : int
Return values
self

withNamespace()

Return a new client with the same transport, authentication, and codec for another namespace.

public withNamespace(string $namespace) : self
Parameters
$namespace : string
Return values
self

workerClusterInfo()

Discover ordinary runtime capabilities using the worker credential.

public workerClusterInfo() : ClusterInfo
Return values
ClusterInfo

workflowActivities()

public workflowActivities(string $workflowId, string $runId) : array<string, mixed>
Parameters
$workflowId : string
$runId : string
Return values
array<string, mixed>

workflowActivityResult()

Inspect one activity's canonical result in an exact run.

public workflowActivityResult(string $workflowId, string $runId, string $activityId) : array<string, mixed>

The response retains its diagnostic state. An available result_envelope can be decoded with payloadCodec(); external bytes use the existing authenticated, size- and checksum-verified payload transport.

Parameters
$workflowId : string
$runId : string
$activityId : string
Return values
array<string, mixed>

workflowDiagnostics()

public workflowDiagnostics(string $workflowId[, string|null $runId = null ]) : array<string, mixed>
Parameters
$workflowId : string
$runId : string|null = null
Return values
array<string, mixed>

workflowHandle()

public workflowHandle(string $workflowId[, string|null $selectedRunId = null ]) : WorkflowHandle
Parameters
$workflowId : string
$selectedRunId : string|null = null
Return values
WorkflowHandle

workflowHistory()

Read one bounded history page. Pass its next_page_token to continue.

public workflowHistory(string $workflowId, string $runId[, int|null $pageSize = null ][, string|null $nextPageToken = null ]) : array<string, mixed>
Parameters
$workflowId : string
$runId : string
$pageSize : int|null = null
$nextPageToken : string|null = null
Return values
array<string, mixed>

workflowObservation()

Read bounded run metadata without loading full diagnostics or application payloads.

public workflowObservation(string $workflowId[, string|null $runId = null ][, array<string|int, mixed> $searchAttributeKeys = [] ][, int|null $historyPageSize = null ][, string|null $historyPageToken = null ]) : array<string, mixed>
Parameters
$workflowId : string
$runId : string|null = null
$searchAttributeKeys : array<string|int, mixed> = []

A list of explicit application context keys, at most 20.

$historyPageSize : int|null = null
$historyPageToken : string|null = null
Return values
array<string, mixed>

workflowResult()

public workflowResult(string $workflowId[, string|null $selectedRunId = null ][, float $timeoutSeconds = 30.0 ][, float $pollIntervalSeconds = 0.5 ][, bool $followCurrentRun = true ]) : mixed
Parameters
$workflowId : string
$selectedRunId : string|null = null
$timeoutSeconds : float = 30.0
$pollIntervalSeconds : float = 0.5
$followCurrentRun : bool = true

workflowTaskHistory()

public workflowTaskHistory(string $taskId, string $leaseOwner, int $attempt, string $nextPageToken[, RequestBudget|null $budget = null ]) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$nextPageToken : string
$budget : RequestBudget|null = null
Return values
array<string, mixed>

workflowTypeOperatorDashboard()

Bounded workflow aggregates for explicit types. An empty list matches no workflows. Operational metrics retain their namespace scope.

public workflowTypeOperatorDashboard(array<int, string> $workflowTypes) : array<string, mixed>

Servers without this additive route report their original HTTP 404.

Parameters
$workflowTypes : array<int, string>
Return values
array<string, mixed>

advancePaginationCycle()

private static advancePaginationCycle(string|null $current, string|null $next, string|null &$checkpoint, int &$distance, int &$power) : void
Parameters
$current : string|null
$next : string|null
$checkpoint : string|null
$distance : int
$power : int

assertOutboundAvroPayload()

private assertOutboundAvroPayload(mixed $payload, string $location[, mixed $declaredCodec = null ]) : void
Parameters
$payload : mixed
$location : string
$declaredCodec : mixed = null

assertWorkflowCommandPayloads()

private assertWorkflowCommandPayloads(array<int, mixed> $commands) : void
Parameters
$commands : array<int, mixed>

cancellationScopeClaimHistory()

private cancellationScopeClaimHistory(string $taskId, string $leaseOwner, int $attempt, string $token, RequestBudget $budget) : array<int, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$token : string
$budget : RequestBudget
Return values
array<int, mixed>

carriedPollResponse()

private carriedPollResponse(array<string, mixed> $answer, array<string, mixed> $request, string $path) : array<string, mixed>
Parameters
$answer : array<string, mixed>
$request : array<string, mixed>
$path : string
Return values
array<string, mixed>

commandRequestId()

The caller command key for a signal or update: validated when supplied, otherwise generated once per call.

private commandRequestId(string $command, string|null $requestId) : string
Parameters
$command : string
$requestId : string|null
Return values
string

continuationToken()

private continuationToken(array<string, mixed> $page) : string|null
Parameters
$page : array<string, mixed>
Return values
string|null

control()

private control(string $method, string $path[, array<string, mixed>|null $body = null ][, string|null $operation = null ][, string|null $requestId = null ]) : array<string, mixed>
Parameters
$method : string
$path : string
$body : array<string, mixed>|null = null
$operation : string|null = null
$requestId : string|null = null
Return values
array<string, mixed>

dashboardWorkflowTypeQuery()

private dashboardWorkflowTypeQuery(array<string|int, mixed> $workflowTypes) : string
Parameters
$workflowTypes : array<string|int, mixed>
Return values
string

decodedResponsePayload()

private decodedResponsePayload(array<string, mixed> $response, string $field) : mixed
Parameters
$response : array<string, mixed>
$field : string

hasExactKeys()

private static hasExactKeys(array<string|int, mixed> $value, array<int, string> $keys) : bool
Parameters
$value : array<string|int, mixed>
$keys : array<int, string>
Return values
bool

isValidExternalPayloadReference()

private isValidExternalPayloadReference(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

isWorkflowCommandCompletion()

Server 3.6.0 bounds these requests by its workflow-task completion limit.

private static isWorkflowCommandCompletion(string $path) : bool
Parameters
$path : string
Return values
bool

iteratePages()

private iteratePages(callable(Array): T>, 1: array} $fetch, string|null $token) : Generator<int, T>
Parameters
$fetch : callable(Array): T>, 1: array}
$token : string|null
Tags
template
Return values
Generator<int, T>

observeRequest()

private observeRequest(string $method, string $path, bool $worker, callable(ClientRequestObservation): array<string, mixed> $operation) : array<string, mixed>
Parameters
$method : string
$path : string
$worker : bool
$operation : callable(ClientRequestObservation): array<string, mixed>
Return values
array<string, mixed>

paginationItems()

private paginationItems(array<string, mixed> $page, string $field) : array<int, array<string, mixed>>
Parameters
$page : array<string, mixed>
$field : string
Return values
array<int, array<string, mixed>>

pathWithQuery()

private pathWithQuery(string $path, array<string, bool|int|float|string|null> $query) : string
Parameters
$path : string
$query : array<string, bool|int|float|string|null>
Return values
string

performPollTaskResponse()

private performPollTaskResponse(string $path, array<string, mixed> $body) : array<string, mixed>
Parameters
$path : string
$body : array<string, mixed>
Return values
array<string, mixed>

performRequest()

private performRequest(string $method, string $path, bool $worker, array<string, mixed>|null $body, string|null $operation, RequestBudget|null $budget, callable(array<string, mixed>): array<int, array<int, int|string>>|null $payloadPaths, string|null $requestId, ClientRequestObservation|null $observation) : array<string, mixed>
Parameters
$method : string
$path : string
$worker : bool
$body : array<string, mixed>|null
$operation : string|null
$budget : RequestBudget|null
$payloadPaths : callable(array<string, mixed>): array<int, array<int, int|string>>|null
$requestId : string|null
$observation : ClientRequestObservation|null
Return values
array<string, mixed>

pollTaskResponse()

private pollTaskResponse(string $path, array<string, mixed> $body) : array<string, mixed>
Parameters
$path : string
$body : array<string, mixed>
Return values
array<string, mixed>

registrationMap()

Keep a keyed registration map from becoming a JSON list for names 0, 1, .

private registrationMap(array<string|int, mixed>|null $values) : array<string|int, mixed>|stdClass|null

..

Parameters
$values : array<string|int, mixed>|null
Return values
array<string|int, mixed>|stdClass|null

rememberClaimedTaskReadyAge()

private rememberClaimedTaskReadyAge(mixed $capabilities) : void
Parameters
$capabilities : mixed

request()

private request(string $method, string $path, bool $worker[, array<string, mixed>|null $body = null ][, string|null $operation = null ][, RequestBudget|null $budget = null ][, callable(array<string, mixed>): array<int, array<int, int|string>>|null $payloadPaths = null ][, string|null $requestId = null ]) : array<string, mixed>
Parameters
$method : string
$path : string
$worker : bool
$body : array<string, mixed>|null = null
$operation : string|null = null
$budget : RequestBudget|null = null
$payloadPaths : callable(array<string, mixed>): array<int, array<int, int|string>>|null = null
$requestId : string|null = null
Return values
array<string, mixed>

requestHeaders()

private requestHeaders(bool $worker) : array<string, string>
Parameters
$worker : bool
Return values
array<string, string>

requestId()

private requestId(string $prefix) : string
Parameters
$prefix : string
Return values
string

requestServiceOperation()

private requestServiceOperation(string $endpointName, string $serviceName, string $operationName, array<string, mixed> $body) : ServiceOperationDescription
Parameters
$endpointName : string
$serviceName : string
$operationName : string
$body : array<string, mixed>
Return values
ServiceOperationDescription

resolveResponsePayloads()

private resolveResponsePayloads(array<string, mixed>|array<int, mixed>|null $response, string $path, bool $worker, array<string, mixed>|null $body, array<string, string> $headers, RequestBudget|null $budget, RequestBudget|null $callerBudget, bool $poll, callable(array<string, mixed>): array<int, array<int, int|string>>|null $payloadPaths) : array<string, mixed>
Parameters
$response : array<string, mixed>|array<int, mixed>|null
$path : string
$worker : bool
$body : array<string, mixed>|null
$headers : array<string, string>
$budget : RequestBudget|null
$callerBudget : RequestBudget|null
$poll : bool
$payloadPaths : callable(array<string, mixed>): array<int, array<int, int|string>>|null
Return values
array<string, mixed>

resultFromResponse()

private resultFromResponse(array<string, mixed> $response) : mixed
Parameters
$response : array<string, mixed>

segment()

private segment(string $value) : string
Parameters
$value : string
Return values
string

sendTransportRequest()

private sendTransportRequest(string $method, string $path, bool $worker, array<string, string> $headers, array<string, mixed>|null $body, RequestBudget|null $budget) : array<string, mixed>|array<int, mixed>|null
Parameters
$method : string
$path : string
$worker : bool
$headers : array<string, string>
$body : array<string, mixed>|null
$budget : RequestBudget|null
Return values
array<string, mixed>|array<int, mixed>|null

serviceCatalogRead()

private serviceCatalogRead(string $path[, array<string, int|string> $filters = [] ][, string|null $id = null ]) : array<string, mixed>
Parameters
$path : string
$filters : array<string, int|string> = []
$id : string|null = null
Return values
array<string, mixed>

serviceOperationPath()

private serviceOperationPath(string $endpointName, string $serviceName, string $operationName, string $suffix) : string
Parameters
$endpointName : string
$serviceName : string
$operationName : string
$suffix : string
Return values
string

taskQueueActivityDispatch()

private taskQueueActivityDispatch(string $method, string $taskQueue, string $action[, array<string, mixed>|null $body = null ]) : array<string, mixed>
Parameters
$method : string
$taskQueue : string
$action : string
$body : array<string, mixed>|null = null
Return values
array<string, mixed>

terminalHistoryPayloadPaths()

private static terminalHistoryPayloadPaths(array<string, mixed> $response) : array<int, array<int, int|string>>
Parameters
$response : array<string, mixed>
Return values
array<int, array<int, int|string>>

terminalResult()

private terminalResult(string $workflowId, string $runId, string $status, WorkflowExecution $execution) : mixed
Parameters
$workflowId : string
$runId : string
$status : string
$execution : WorkflowExecution

updateStillPending()

A completed wait that ended before the update finished carries no result. Returning the receipt in its place would hand callers an array that looks like the handler's result.

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

withObservabilityContext()

private withObservabilityContext(array<string, mixed> $body) : array<string|int, mixed>
Parameters
$body : array<string, mixed>

@return array<string, mixed>

Return values
array<string|int, mixed>

withoutNulls()

private withoutNulls(array<string, mixed> $values) : array<string, mixed>
Parameters
$values : array<string, mixed>
Return values
array<string, mixed>

worker()

private worker(string $method, string $path[, array<string, mixed>|null $body = null ][, RequestBudget|null $budget = null ]) : array<string, mixed>
Parameters
$method : string
$path : string
$body : array<string, mixed>|null = null
$budget : RequestBudget|null = null
Return values
array<string, mixed>

workflowOperationPath()

private workflowOperationPath(string $workflowId, string|null $runId, string $operation) : string
Parameters
$workflowId : string
$runId : string|null
$operation : string
Return values
string

workflowStreamPath()

private workflowStreamPath(string $workflowId, string $runId[, string|null $streamName = null ]) : string
Parameters
$workflowId : string
$runId : string
$streamName : string|null = null
Return values
string
On this page

Search results