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

EXTERNAL_PAYLOAD_REFERENCE_SCHEMA  : mixed = 'durable-workflow.v2.external-payload-reference...
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
$authentication  : Authentication|null
$baseUri  : string
$codec  : PayloadCodec
$payloadUploads  : RuntimePayloadUploads
$transport  : Transport

Methods

__construct()  : mixed
appendMessageStream()  : array<string, mixed>
appendWorkflowStream()  : WorkflowStreamAppendResult
archiveWorkflow()  : array<string, mixed>
backfillSchedule()  : array<string, mixed>
cancelServiceOperation()  : ServiceOperationDescription
cancelWorkflow()  : array<string, mixed>
closeWorkerSession()  : array<string, mixed>
closeWorkflowStream()  : WorkflowStreamDescription
clusterInfo()  : ClusterInfo
completeActivityTask()  : array<string, mixed>
completeQueryTask()  : array<string, mixed>
completeWorkflowTask()  : array<string, mixed>
createNamespace()  : NamespaceDescription
createSchedule()  : ScheduleHandle
createSearchAttribute()  : SearchAttributeDefinition
createWorkerSession()  : array<string, mixed>
deleteNamespace()  : NamespaceDescription
deleteSchedule()  : void
deleteSearchAttribute()  : SearchAttributeDefinition
deregisterWorker()  : void
deregisterWorkerRegistration()  : array{worker_id: string, outcome: string, recovered_workflow_task_count: int}
describeNamespace()  : NamespaceDescription
describeSchedule()  : ScheduleDescription
describeServiceOperation()  : ServiceOperationDescription
describeTaskQueue()  : array<string, mixed>
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>
iterateWorkflowStream()  : Generator<int, WorkflowStreamItem>
listNamespaces()  : array<int, NamespaceDescription>
listSchedules()  : SchedulePage
Return one server-filtered schedule page.
listSearchAttributes()  : SearchAttributeCollection
listTaskQueues()  : array<string, mixed>
listWorkers()  : array<string, mixed>
listWorkflowRuns()  : array<int, WorkflowRun>
listWorkflows()  : WorkflowPage
listWorkflowStreams()  : array<int, WorkflowStreamDescription>
operatorDashboard()  : array<string, mixed>
operatorMetrics()  : array<string, mixed>
pauseSchedule()  : void
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.
queryWorkflow()  : mixed
redriveWorkflow()  : array<string, mixed>
registerWorker()  : array<string, mixed>
Registers a low-level worker without advertising unsupported validator authoring.
renewWorkerSession()  : array<string, mixed>
repairWorkflow()  : array<string, mixed>
resumeSchedule()  : void
scheduleHandle()  : ScheduleHandle
scheduleHistory()  : array<string, mixed>
setNamespaceExternalStorage()  : NamespaceDescription
signalWorkflow()  : array<string, mixed>
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
updateSchedule()  : void
updateWorkflow()  : mixed
withNamespace()  : self
Return a new client with the same transport, authentication, and codec for another namespace.
workflowActivities()  : array<string, mixed>
workflowDiagnostics()  : array<string, mixed>
workflowHandle()  : WorkflowHandle
workflowHistory()  : array<string, mixed>
workflowResult()  : mixed
workflowTaskHistory()  : array<string, mixed>
assertOutboundAvroPayload()  : void
assertWorkflowCommandPayloads()  : void
control()  : array<string, mixed>
decodedResponsePayload()  : mixed
hasExactKeys()  : bool
isValidExternalPayloadReference()  : bool
pathWithQuery()  : string
pollTaskResponse()  : array<string, mixed>
request()  : array<string, mixed>
requestId()  : string
requestServiceOperation()  : ServiceOperationDescription
resultFromResponse()  : mixed
segment()  : string
serviceOperationBody()  : array<string, mixed>
serviceOperationPath()  : string
terminalResult()  : mixed
withoutNulls()  : array<string, mixed>
worker()  : array<string, mixed>
workflowOperationPath()  : string
workflowStreamPath()  : string

Constants

EXTERNAL_PAYLOAD_REFERENCE_SCHEMA

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

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'

$baseUri read-only

private string $baseUri

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 ]) : 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

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>

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<string, mixed>
Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
$result : mixed
Return values
array<string, mixed>

completeQueryTask()

public completeQueryTask(string $taskId, string $leaseOwner, int $attempt, mixed $result) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$result : mixed
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<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
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
Return values
ScheduleHandle

deleteSchedule()

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

deregisterWorker()

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

deregisterWorkerRegistration()

public deregisterWorkerRegistration(string $workerId) : array{worker_id: string, outcome: string, recovered_workflow_task_count: int}
Parameters
$workerId : string
Return values
array{worker_id: string, outcome: string, recovered_workflow_task_count: int}

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>

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 ]) : array<string, mixed>
Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
$message : string
$failureType : string = 'PhpActivityFailure'
$nonRetryable : bool = false
$details : 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' ]) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$message : string
$reason : string = 'query_rejected'
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 ]) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$message : string
$failureType : string = 'PhpWorkflowTaskFailure'
$reason : string|null = null
$sequence : int|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 = [] ]) : array<string, mixed>
Parameters
$workerId : string
$taskSlots : array<string, int> = []
Return values
array<string, mixed>

heartbeatWorkflowTask()

public heartbeatWorkflowTask(string $taskId, string $leaseOwner, int $attempt) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
Return values
array<string, mixed>

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

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

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>

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, 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, 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, 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, string>|null = null
Tags
throws
InvalidArgumentException
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>

resumeSchedule()

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

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()

public signalWorkflow(string $workflowId, string $signalName[, array<int, mixed> $arguments = [] ][, string|null $runId = null ]) : array<string, mixed>
Parameters
$workflowId : string
$signalName : string
$arguments : array<int, mixed> = []
$runId : 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

updateSchedule()

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

updateWorkflow()

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
Parameters
$workflowId : string
$updateName : string
$arguments : array<int, mixed> = []
$waitFor : string = 'completed'
$waitTimeoutSeconds : int|null = null
$requestId : string|null = null
$runId : string|null = null

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

workflowActivities()

public workflowActivities(string $workflowId, string $runId) : array<string, mixed>
Parameters
$workflowId : string
$runId : 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()

public workflowHistory(string $workflowId, string $runId) : array<string, mixed>
Parameters
$workflowId : string
$runId : string
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) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$nextPageToken : string
Return values
array<string, mixed>

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>

control()

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

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

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

pollTaskResponse()

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

request()

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

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

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

serviceOperationPath()

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

terminalResult()

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

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 ]) : array<string, mixed>
Parameters
$method : string
$path : string
$body : array<string, mixed>|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