WorkflowOptions
extends Options
in package
WorkflowOptions configuration parameters for starting a workflow execution.
Tags
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
$cronSchedule
Optional cron schedule for workflow.
public
string|null
$cronSchedule
= null
Tags
$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
$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
$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
$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
__construct()
public
__construct() : mixed
Tags
mergeWith()
public
mergeWith([MethodRetry|null $retry = null ][, CronSchedule|null $cron = null ]) : self
Parameters
- $retry : MethodRetry|null = null
- $cron : CronSchedule|null = null
Return values
self —return a new self instance with merged options
withCronSchedule()
public
withCronSchedule(string|null $expression) : $this
Parameters
- $expression : string|null
Return values
$thiswithEagerStart()
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
$thiswithMemo()
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
$thiswithRetryOptions()
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
$thiswithSearchAttributes()
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
$thiswithTaskQueue()
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
$thiswithWorkflowExecutionTimeout()
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
Return values
$thiswithWorkflowId()
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
$thiswithWorkflowIdConflictPolicy()
Defines how to resolve an ID conflict with a *running* workflow.
public
withWorkflowIdConflictPolicy(WorkflowIdConflictPolicy $policy) : $this
Parameters
- $policy : WorkflowIdConflictPolicy
Tags
Return values
$thiswithWorkflowIdReusePolicy()
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.
-
IdReusePolicy::AllowDuplicateFailedOnly: Is a default value. It means that workflow can start if previous run failed or was canceled or terminated.
-
IdReusePolicy::AllowDuplicate: Allows new run independently of the previous run closure status.
-
IdReusePolicy::RejectDuplicate: Doesn't allow new run independently of the previous run closure status.
Parameters
- $policy : IdReusePolicy|int
Tags
Return values
$thiswithWorkflowRunTimeout()
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
Return values
$thiswithWorkflowStartDelay()
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
Return values
$thiswithWorkflowTaskTimeout()
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