Durable Workflow PHP SDK — API Reference

Guides

WorkflowContext
in package

FinalYes

Straight-line deterministic operations available while a workflow Fiber is replayed.

Table of Contents

Properties

$runId  : string
$workflowId  : string
$cancellationRequested  : bool
$codec  : PayloadCodec
$execution  : Fiber<mixed, mixed>|null
$history  : array<string|int, mixed>

Methods

__construct()  : mixed
activity()  : mixed
childWorkflow()  : mixed
continueAsNew()  : never
isCancellationRequested()  : bool
sideEffect()  : mixed
signals()  : array<int, array<int, mixed>>
sleep()  : void
throwIfCancellationRequested()  : void
updates()  : array<int, array<int, mixed>>
upsertSearchAttributes()  : void
suspend()  : mixed

Properties

$cancellationRequested read-only

private bool $cancellationRequested = false

Methods

__construct()

public __construct(string $workflowId, string $runId, array<int, array<string, mixed>> $history, PayloadCodec $codec[, bool $cancellationRequested = false ][, Fiber<mixed, mixed>|null $execution = null ]) : mixed
Parameters
$workflowId : string
$runId : string
$history : array<int, array<string, mixed>>
$codec : PayloadCodec
$cancellationRequested : bool = false
$execution : Fiber<mixed, mixed>|null = null

activity()

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

childWorkflow()

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

continueAsNew()

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

isCancellationRequested()

public isCancellationRequested() : bool
Return values
bool

sideEffect()

public sideEffect(callable(): mixed $operation) : mixed
Parameters
$operation : callable(): mixed

signals()

public signals(string $signalName) : array<int, array<int, mixed>>
Parameters
$signalName : string
Return values
array<int, array<int, mixed>>

sleep()

public sleep(int|float $seconds) : void
Parameters
$seconds : int|float

throwIfCancellationRequested()

public throwIfCancellationRequested() : void

updates()

public updates(string $updateName) : array<int, array<int, mixed>>
Parameters
$updateName : string
Return values
array<int, array<int, mixed>>

upsertSearchAttributes()

public upsertSearchAttributes(array<string, mixed> $attributes) : void
Parameters
$attributes : array<string, mixed>
On this page

Search results