Documentation

WorkflowOptions extends Options
in package

FinalYes

WorkflowOptions configuration parameters for starting a workflow execution.

Tags
psalm-import-type

DateIntervalValue from DateInterval

psalm-immutable

Table of Contents

Properties

$cronSchedule  : string|null
Optional cron schedule for workflow.
$eagerStart  : bool
Eager Workflow Dispatch is a mechanism that minimizes the duration from starting a workflow to the processing of the first workflow task, making Temporal more suitable for latency sensitive applications.
$memo  : array<string|int, mixed>|null
Optional non-indexed info that will be shown in list workflow.
$retryOptions  : RetryOptions|null
Optional retry policy for workflow. If a retry policy is specified, in case of workflow failure server will start new workflow execution if needed based on the retry policy.
$searchAttributes  : array<string|int, mixed>|null
Optional indexed info that can be used in query of List/Scan/Count workflow APIs (only supported when Temporal server is using ElasticSearch). The key and value type must be registered on Temporal server side.
$taskQueue  : string
The workflow tasks of the workflow are scheduled on the queue with this name. This is also the name of the activity task queue on which activities are scheduled.
$workflowExecutionTimeout  : DateInterval
The timeout for duration of workflow execution.
$workflowId  : string
The business identifier of the workflow execution.
$workflowIdConflictPolicy  : WorkflowIdConflictPolicy
Defines how to resolve an ID conflict with a *running* workflow.
$workflowIdReusePolicy  : int
Whether server allow reuse of workflow ID.
$workflowRunTimeout  : DateInterval
The timeout for duration of a single workflow run.
$workflowStartDelay  : DateInterval
Time to wait before dispatching the first Workflow task.
$workflowTaskTimeout  : DateInterval
The timeout for processing workflow task from the time the worker pulled this task. If a workflow task is lost, it is retried after this timeout.

Methods

__construct()  : mixed
mergeWith()  : self
withCronSchedule()  : $this
withEagerStart()  : $this
Eager Workflow Dispatch is a mechanism that minimizes the duration from starting a workflow to the processing of the first workflow task, making Temporal more suitable for latency sensitive applications.
withMemo()  : $this
Specifies additional non-indexed information in result of list workflow.
withRetryOptions()  : $this
RetryOptions that define how child workflow is retried in case of failure. Default is null which is no reties.
withSearchAttributes()  : $this
Specifies additional indexed information in result of list workflow.
withTaskQueue()  : $this
Task queue to use for workflow tasks. It should match a task queue specified when creating a {@see Worker} that hosts the workflow code.
withWorkflowExecutionTimeout()  : $this
The maximum time that parent workflow is willing to wait for a child execution (which includes retries and continue as new calls). If exceeded the child is automatically terminated by the Temporal service.
withWorkflowId()  : $this
Workflow id to use when starting. If not specified a UUID is generated.
withWorkflowIdConflictPolicy()  : $this
Defines how to resolve an ID conflict with a *running* workflow.
withWorkflowIdReusePolicy()  : $this
Specifies server behavior if a *closed* workflow with the same id exists.
withWorkflowRunTimeout()  : $this
The time after which workflow run is automatically terminated by the Temporal service. Do not rely on the run timeout for business level timeouts. It is preferred to use in workflow timers for this purpose.
withWorkflowStartDelay()  : $this
Time to wait before dispatching the first Workflow task.
withWorkflowTaskTimeout()  : $this
Maximum execution time of a single workflow task. Default is 10 seconds.

Properties

$eagerStart

Eager Workflow Dispatch is a mechanism that minimizes the duration from starting a workflow to the processing of the first workflow task, making Temporal more suitable for latency sensitive applications.

public bool $eagerStart = false

$memo

Optional non-indexed info that will be shown in list workflow.

public array<string|int, mixed>|null $memo = null
Tags
psalm-var

array<string, mixed>|null

$retryOptions

Optional retry policy for workflow. If a retry policy is specified, in case of workflow failure server will start new workflow execution if needed based on the retry policy.

public RetryOptions|null $retryOptions = null

$searchAttributes

Optional indexed info that can be used in query of List/Scan/Count workflow APIs (only supported when Temporal server is using ElasticSearch). The key and value type must be registered on Temporal server side.

public array<string|int, mixed>|null $searchAttributes = null
Tags
psalm-var

array<string, mixed>|null

$taskQueue

The workflow tasks of the workflow are scheduled on the queue with this name. This is also the name of the activity task queue on which activities are scheduled.

public string $taskQueue = \Temporal\Worker\WorkerFactoryInterface::DEFAULT_TASK_QUEUE

The workflow author can choose to override this using activity options.

$workflowExecutionTimeout

The timeout for duration of workflow execution.

public DateInterval $workflowExecutionTimeout

It includes retries and continue as new. Use $workflowRunTimeout to limit execution time of a single workflow run.

Optional: defaulted to 10 years.

$workflowId

The business identifier of the workflow execution.

public string $workflowId

$workflowIdConflictPolicy

Defines how to resolve an ID conflict with a *running* workflow.

public WorkflowIdConflictPolicy $workflowIdConflictPolicy = \Temporal\Common\WorkflowIdConflictPolicy::Unspecified

$workflowIdReusePolicy

Whether server allow reuse of workflow ID.

public int $workflowIdReusePolicy = \Temporal\Common\IdReusePolicy::POLICY_ALLOW_DUPLICATE_FAILED_ONLY

Can be useful for deduplication logic if set to IdReusePolicy::POLICY_REJECT_DUPLICATE.

Tags
psalm-var

IdReusePolicy::POLICY_*

$workflowRunTimeout

The timeout for duration of a single workflow run.

public DateInterval $workflowRunTimeout

Optional: defaulted to $workflowExecutionTimeout.

$workflowStartDelay

Time to wait before dispatching the first Workflow task.

public DateInterval $workflowStartDelay

$workflowTaskTimeout

The timeout for processing workflow task from the time the worker pulled this task. If a workflow task is lost, it is retried after this timeout.

public DateInterval $workflowTaskTimeout

Optional: defaulted to no limit

Methods

withCronSchedule()

public withCronSchedule(string|null $expression) : $this
Parameters
$expression : string|null
Return values
$this

withEagerStart()

Eager Workflow Dispatch is a mechanism that minimizes the duration from starting a workflow to the processing of the first workflow task, making Temporal more suitable for latency sensitive applications.

public withEagerStart([bool $value = true ]) : $this

Eager Workflow Dispatch can be enabled if the server supports it and a local worker is available the task is fed directly to the worker.

Parameters
$value : bool = true
Return values
$this

withMemo()

Specifies additional non-indexed information in result of list workflow.

public withMemo(array<string|int, mixed>|null $memo) : $this
Parameters
$memo : array<string|int, mixed>|null
Return values
$this

withRetryOptions()

RetryOptions that define how child workflow is retried in case of failure. Default is null which is no reties.

public withRetryOptions(RetryOptions|null $options) : $this
Parameters
$options : RetryOptions|null
Return values
$this

withSearchAttributes()

Specifies additional indexed information in result of list workflow.

public withSearchAttributes(array<string|int, mixed>|null $searchAttributes) : $this
Parameters
$searchAttributes : array<string|int, mixed>|null
Return values
$this

withTaskQueue()

Task queue to use for workflow tasks. It should match a task queue specified when creating a {@see Worker} that hosts the workflow code.

public withTaskQueue(string $taskQueue) : $this
Parameters
$taskQueue : string
Return values
$this

withWorkflowExecutionTimeout()

The maximum time that parent workflow is willing to wait for a child execution (which includes retries and continue as new calls). If exceeded the child is automatically terminated by the Temporal service.

public withWorkflowExecutionTimeout(DateIntervalValue $timeout) : $this
Parameters
$timeout : DateIntervalValue
Tags
psalm-suppress

ImpureMethodCall

Return values
$this

withWorkflowId()

Workflow id to use when starting. If not specified a UUID is generated.

public withWorkflowId(string $workflowId) : $this

Note that it is dangerous as in case of client side retries no deduplication will happen based on the generated id. So prefer assigning business meaningful ids if possible.

Parameters
$workflowId : string
Return values
$this

withWorkflowIdReusePolicy()

Specifies server behavior if a *closed* workflow with the same id exists.

public withWorkflowIdReusePolicy(IdReusePolicy|int $policy) : $this

Note that under no conditions Temporal allows two workflows with the same namespace and workflow id run simultaneously.

Parameters
$policy : IdReusePolicy|int
Tags
psalm-suppress

ImpureMethodCall

Return values
$this

withWorkflowRunTimeout()

The time after which workflow run is automatically terminated by the Temporal service. Do not rely on the run timeout for business level timeouts. It is preferred to use in workflow timers for this purpose.

public withWorkflowRunTimeout(DateIntervalValue $timeout) : $this
Parameters
$timeout : DateIntervalValue
Tags
psalm-suppress

ImpureMethodCall

Return values
$this

withWorkflowStartDelay()

Time to wait before dispatching the first Workflow task.

public withWorkflowStartDelay(DateIntervalValue $delay) : $this

If the Workflow gets a Signal before the delay, a Workflow task will be dispatched and the rest of the delay will be ignored. A Signal from WorkflowClientInterface::startWithSignal() won't trigger a workflow task. Cannot be set the same time as a $cronSchedule.

Parameters
$delay : DateIntervalValue
Tags
psalm-suppress

ImpureMethodCall

Return values
$this

withWorkflowTaskTimeout()

Maximum execution time of a single workflow task. Default is 10 seconds.

public withWorkflowTaskTimeout(DateIntervalValue $timeout) : $this

Maximum accepted value is 60 seconds.

Parameters
$timeout : DateIntervalValue
Tags
psalm-suppress

ImpureMethodCall

Return values
$this

        
On this page

Search results