ChildWorkflowOptions
extends Options
in package
Tags
Table of Contents
Properties
- $cancellationType : int
- In case of a child workflow cancellation it fails with a FailedCancellationException. The type defines at which point the exception is thrown.
- $cronSchedule : string|null
- Optional cron schedule for workflow.
- $memo : array<string|int, mixed>|null
- Optional non-indexed info that will be shown in list workflow.
- $namespace : string
- Namespace of the child workflow.
- $parentClosePolicy : int
- Optional policy to decide what to do for the child.
- $retryOptions : RetryOptions|null
- RetryPolicy specify how to retry child workflow if error happens.
- $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
- TaskQueue that the child workflow needs to be scheduled on.
- $workflowExecutionTimeout : DateInterval
- The end to end timeout for the child workflow execution including retries and continue as new.
- $workflowId : string|null
- WorkflowID of the child workflow to be scheduled.
- $workflowIdReusePolicy : int
- Whether server allow reuse of workflow ID, can be useful for deduplication logic if set to IdReusePolicy::POLICY_REJECT_DUPLICATE.
- $workflowRunTimeout : DateInterval
- The timeout for a single run of the child workflow execution. Each retry or continue as new should obey this timeout.
- $workflowTaskTimeout : DateInterval
- The workflow task timeout for the child workflow.
Methods
- __construct() : mixed
- mergeWith() : $this
- withChildWorkflowCancellationType() : $this
- The type defines at which point the exception is thrown.
- withCronSchedule() : $this
- Specifies optional cron schedule for workflow.
- withMemo() : $this
- Specifies additional non-indexed information in result of list workflow.
- withNamespace() : $this
- Specify namespace in which workflow should be started.
- withParentClosePolicy() : $this
- Specifies how this workflow reacts to the death of the parent 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.
- withWorkflowIdReusePolicy() : $this
- Specifies server behavior if a completed workflow with the same id exists. Note that under no conditions Temporal allows two workflows with the same namespace and workflow id run simultaneously.
- 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.
- withWorkflowTaskTimeout() : $this
- Maximum execution time of a single workflow task. Default is 10 seconds.
Properties
$cancellationType
In case of a child workflow cancellation it fails with a FailedCancellationException. The type defines at which point the exception is thrown.
public
int
$cancellationType
= \Temporal\Workflow\ChildWorkflowCancellationType::TRY_CANCEL
Tags
$cronSchedule
Optional cron schedule for workflow.
public
string|null
$cronSchedule
= null
Tags
$memo
Optional non-indexed info that will be shown in list workflow.
public
array<string|int, mixed>|null
$memo
= null
Tags
$namespace
Namespace of the child workflow.
public
string
$namespace
= \Temporal\Client\ClientOptions::DEFAULT_NAMESPACE
Optional: the current workflow (parent)'s namespace will be used if this is not provided.
$parentClosePolicy
Optional policy to decide what to do for the child.
public
int
$parentClosePolicy
= \Temporal\Workflow\ParentClosePolicy::POLICY_TERMINATE
Default is Terminate (if onboarded to this feature).
Tags
$retryOptions
RetryPolicy specify how to retry child workflow if error happens.
public
RetryOptions|null
$retryOptions
= null
Optional: default is no retry.
$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
TaskQueue that the child workflow needs to be scheduled on.
public
string
$taskQueue
= \Temporal\Worker\WorkerFactoryInterface::DEFAULT_TASK_QUEUE
Optional: the parent workflow task queue will be used if this is not provided.
$workflowExecutionTimeout
The end to end timeout for the child workflow execution including retries and continue as new.
public
DateInterval
$workflowExecutionTimeout
Optional: defaults is no limit
$workflowId
WorkflowID of the child workflow to be scheduled.
public
string|null
$workflowId
= null
Optional: an auto generated workflowID will be used if this is not provided.
$workflowIdReusePolicy
Whether server allow reuse of workflow ID, can be useful for deduplication logic if set to IdReusePolicy::POLICY_REJECT_DUPLICATE.
public
int
$workflowIdReusePolicy
= \Temporal\Common\IdReusePolicy::POLICY_ALLOW_DUPLICATE_FAILED_ONLY
Tags
$workflowRunTimeout
The timeout for a single run of the child workflow execution. Each retry or continue as new should obey this timeout.
public
DateInterval
$workflowRunTimeout
Use $workflowExecutionTimeout to specify how long the parent is willing to wait for the child completion.
Optional: defaults to $workflowExecutionTimeout
$workflowTaskTimeout
The workflow task timeout for the child workflow.
public
DateInterval
$workflowTaskTimeout
Optional: default is no limit
Methods
__construct()
public
__construct() : mixed
Tags
mergeWith()
public
mergeWith([MethodRetry|null $retry = null ][, CronSchedule|null $cron = null ]) : $this
Parameters
- $retry : MethodRetry|null = null
- $cron : CronSchedule|null = null
Return values
$thiswithChildWorkflowCancellationType()
The type defines at which point the exception is thrown.
public
withChildWorkflowCancellationType(ChildWorkflowCancellationType|int $type) : $this
In case of a child workflow cancellation it fails with a FailedCancellationException.
Parameters
- $type : ChildWorkflowCancellationType|int
Tags
Return values
$thiswithCronSchedule()
Specifies optional cron schedule for workflow.
public
withCronSchedule(string|null $expression) : $this
Parameters
- $expression : string|null
Tags
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
$thiswithNamespace()
Specify namespace in which workflow should be started.
public
withNamespace(string $namespace) : $this
Parameters
- $namespace : string
Return values
$thiswithParentClosePolicy()
Specifies how this workflow reacts to the death of the parent workflow.
public
withParentClosePolicy(ParentClosePolicy|int $policy) : $this
Parameters
- $policy : ParentClosePolicy|int
Tags
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
$thiswithWorkflowIdReusePolicy()
Specifies server behavior if a completed workflow with the same id exists. Note that under no conditions Temporal allows two workflows with the same namespace and workflow id run simultaneously.
public
withWorkflowIdReusePolicy(IdReusePolicy|int $policy) : $this
-
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
$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