Durable Workflow PHP SDK

Client
in package

FinalYes

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

Table of Contents

Constants

WORKFLOW_TASK_WAITING_FOR_HISTORY_MESSAGE  : mixed = 'Workflow task waiting for scheduled history.'
WORKFLOW_TASK_WAITING_FOR_HISTORY_TYPE  : mixed = 'WorkflowTaskWaitingForHistory'

Properties

$namespace  : string
$authentication  : Authentication|null
$baseUri  : string
$codec  : PayloadCodec
$transport  : Transport

Methods

__construct()  : mixed
backfillSchedule()  : array<string, mixed>
cancelServiceOperation()  : ServiceOperationDescription
cancelWorkflow()  : array<string, mixed>
clusterInfo()  : ClusterInfo
completeActivityTask()  : array<string, mixed>
completeQueryTask()  : array<string, mixed>
completeWorkflowTask()  : array<string, mixed>
createNamespace()  : NamespaceDescription
createSchedule()  : ScheduleHandle
createSearchAttribute()  : SearchAttributeDefinition
deleteNamespace()  : NamespaceDescription
deleteSchedule()  : void
deleteSearchAttribute()  : SearchAttributeDefinition
deregisterWorker()  : void
describeNamespace()  : NamespaceDescription
describeSchedule()  : ScheduleDescription
describeServiceOperation()  : ServiceOperationDescription
describeWorkflow()  : WorkflowExecution
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>
listNamespaces()  : array<int, NamespaceDescription>
listSchedules()  : SchedulePage
listSearchAttributes()  : SearchAttributeCollection
listWorkflowRuns()  : array<int, WorkflowRun>
listWorkflows()  : WorkflowPage
pauseSchedule()  : void
payloadCodec()  : PayloadCodec
pollActivityTask()  : array<string, mixed>|null
pollQueryTask()  : array<string, mixed>|null
pollWorkflowTask()  : array<string, mixed>|null
queryWorkflow()  : mixed
registerWorker()  : array<string, mixed>
resumeSchedule()  : void
scheduleHandle()  : ScheduleHandle
scheduleHistory()  : array<string, mixed>
setNamespaceExternalStorage()  : NamespaceDescription
signalWorkflow()  : array<string, mixed>
startServiceOperation()  : ServiceOperationHandle
startWorkflow()  : WorkflowHandle
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.
workflowHandle()  : WorkflowHandle
workflowHistory()  : array<string, mixed>
workflowResult()  : mixed
workflowTaskHistory()  : array<string, mixed>
control()  : array<string, mixed>
decodedResponsePayload()  : mixed
pathWithQuery()  : string
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

Constants

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

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

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>

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<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$commands : array<int, array<string, mixed>>
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

describeServiceOperation()

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

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' ]) : array<string, mixed>
Parameters
$taskId : string
$leaseOwner : string
$attempt : int
$message : string
$failureType : string = 'PhpWorkflowTaskFailure'
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, mixed> $details = [] ]) : array<string, mixed>
Parameters
$taskId : string
$activityAttemptId : string
$leaseOwner : string
$details : array<string, 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>

listSchedules()

public listSchedules([array<string, bool|int|float|string|null> $filters = [] ]) : SchedulePage
Parameters
$filters : array<string, bool|int|float|string|null> = []
Return values
SchedulePage

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

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

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

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

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

registerWorker()

public registerWorker(string $workerId, string $taskQueue, array<int, string> $workflowTypes, array<int, string> $activityTypes[, array<int, string> $capabilities = ['query_tasks', 'workflow_updates'] ][, int $maxConcurrentWorkflowTasks = 1 ][, int $maxConcurrentActivityTasks = 1 ][, string|null $buildId = null ]) : array<string, mixed>
Parameters
$workerId : string
$taskQueue : string
$workflowTypes : array<int, string>
$activityTypes : array<int, string>
$capabilities : array<int, string> = ['query_tasks', 'workflow_updates']
$maxConcurrentWorkflowTasks : int = 1
$maxConcurrentActivityTasks : int = 1
$buildId : 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

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

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>

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

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

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
On this page

Search results