Class ChildWorkflowOptions.Builder
- Enclosing class:
ChildWorkflowOptions
-
Method Summary
Modifier and TypeMethodDescriptionbuild()setCancellationType(ChildWorkflowCancellationType cancellationType) In case of a child workflow cancellation it fails with aCanceledFailure.setContextPropagators(List<ContextPropagator> contextPropagators) Specifies the list of context propagators to use during this workflow.setCronSchedule(String cronSchedule) Specifies additional non-indexed information in result of list workflow.setNamespace(String namespace) Deprecated.setParentClosePolicy(io.temporal.api.enums.v1.ParentClosePolicy parentClosePolicy) Specifies how this workflow reacts to the death of the parent workflow.setPriority(Priority priority) Optional priority settings that control relative ordering of task processing when tasks are backed up in a queue.setRetryOptions(RetryOptions retryOptions) RetryOptions that define how child workflow is retried in case of failure.setSearchAttributes(Map<String, Object> searchAttributes) Deprecated.setStaticDetails(String staticDetails) General fixed details for this workflow execution that will appear in UI/CLI.setStaticSummary(String staticSummary) Single-line fixed summary for this workflow execution that will appear in UI/CLI.setTaskQueue(String taskQueue) Task queue to use for workflow tasks.setTypedSearchAttributes(SearchAttributes typedSearchAttributes) Specifies additional indexed information in result of list workflow.setVersioningIntent(VersioningIntent versioningIntent) Deprecated.Worker Versioning is now deprecated please migrate to the Worker Deployment API.setWorkflowExecutionTimeout(Duration workflowExecutionTimeout) The time after which child workflow execution (which includes run retries and continue as new) is automatically terminated by Temporal service with WORKFLOW_EXECUTION_TIMED_OUT status.setWorkflowId(String workflowId) Workflow id to use when starting.setWorkflowIdReusePolicy(io.temporal.api.enums.v1.WorkflowIdReusePolicy workflowIdReusePolicy) Specifies server behavior if a completed workflow with the same id exists.setWorkflowRunTimeout(Duration workflowRunTimeout) The time after which child workflow run is automatically terminated by Temporal service with CHILD_WORKFLOW_EXECUTION_TIMED_OUT status.setWorkflowTaskTimeout(Duration workflowTaskTimeout) Maximum execution time of a single workflow task.
-
Method Details
-
setNamespace
Deprecated.Cross-namespace child workflow execution is disabled by default in Temporal Server since version 1.30.1 (viasystem.enableCrossNamespaceCommandsdynamic config flag). Setting this option will fail unless that flag is explicitly re-enabled on the server. This field may be removed at some point in the future.Specify namespace in which workflow should be started.TODO: Resolve conflict with WorkflowClient namespace.
-
setWorkflowId
Workflow id to use when starting. If not specified a UUID is generated. 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. -
setWorkflowIdReusePolicy
public ChildWorkflowOptions.Builder setWorkflowIdReusePolicy(io.temporal.api.enums.v1.WorkflowIdReusePolicy workflowIdReusePolicy) 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.- AllowDuplicate is the default value. It allows new run independently of the previous run closure status.
- AllowDuplicateFailedOnly means that workflow can start if previous run failed or was canceled or terminated.
- RejectDuplicate doesn't allow new run independently of the previous run closure status.
-
setWorkflowRunTimeout
The time after which child workflow run is automatically terminated by Temporal service with CHILD_WORKFLOW_EXECUTION_TIMED_OUT status.
Parent workflow receivesChildWorkflowFailureexception withTimeoutFailurecause from the child'sPromiseif this happens.When a workflow reaches Workflow Run Timeout, it can't make any progress after that. Do not rely on this timeout in workflow implementation or business logic. This timeout is not designed to be handled in workflow code to perform any logic in case of timeout. Consider using workflow timers instead.
If you catch yourself setting this timeout to very small values, you're likely using it wrong.
Example: If Workflow Run Timeout is 30 seconds and the network was unavailable for 1 minute, workflows that were scheduled before the network blip will never have a chance to make progress or react, and will be terminated.
A timer that is scheduled in the workflow code usingWorkflow.newTimer(Duration)will handle this situation gracefully. A workflow with such a timer will start after the network blip. If it started before the network blip and the timer fires during the network blip, it will get delivered after connectivity is restored and the workflow will be able to resume. -
setWorkflowExecutionTimeout
The time after which child workflow execution (which includes run retries and continue as new) is automatically terminated by Temporal service with WORKFLOW_EXECUTION_TIMED_OUT status.
Parent workflow receivesChildWorkflowFailureexception withTimeoutFailurecause from the child'sPromiseif this happens.When a workflow reaches Workflow Execution Timeout, it can't make any progress after that. Do not rely on this timeout in workflow implementation or business logic. This timeout is not designed to be handled in workflow code to perform any logic in case of timeout. Consider using workflow timers instead.
If you catch yourself setting this timeout to very small values, you're likely using it wrong.
Example: If Workflow Execution Timeout is 30 seconds and the network was unavailable for 1 minute, workflows that were scheduled before the network blip will never have a chance to make progress or react, and will be terminated.
A timer that is scheduled in the workflow code usingWorkflow.newTimer(Duration)will handle this situation gracefully. A workflow with such a timer will start after the network blip. If it started before the network blip and the timer fires during the network blip, it will get delivered after connectivity is restored and the workflow will be able to resume. -
setWorkflowTaskTimeout
Maximum execution time of a single workflow task. Default is 10 seconds. Maximum accepted value is 120 seconds. -
setTaskQueue
Task queue to use for workflow tasks. It should match a task queue specified when creating aWorkerthat hosts the workflow code. -
setRetryOptions
RetryOptions that define how child workflow is retried in case of failure. Default is null which is no reties. -
setCronSchedule
-
setParentClosePolicy
public ChildWorkflowOptions.Builder setParentClosePolicy(io.temporal.api.enums.v1.ParentClosePolicy parentClosePolicy) Specifies how this workflow reacts to the death of the parent workflow. -
setMemo
Specifies additional non-indexed information in result of list workflow. -
setSearchAttributes
@Deprecated public ChildWorkflowOptions.Builder setSearchAttributes(Map<String, Object> searchAttributes) Deprecated.Specifies additional indexed information in result of list workflow. -
setTypedSearchAttributes
public ChildWorkflowOptions.Builder setTypedSearchAttributes(SearchAttributes typedSearchAttributes) Specifies additional indexed information in result of list workflow. -
setContextPropagators
public ChildWorkflowOptions.Builder setContextPropagators(List<ContextPropagator> contextPropagators) Specifies the list of context propagators to use during this workflow. -
setCancellationType
public ChildWorkflowOptions.Builder setCancellationType(ChildWorkflowCancellationType cancellationType) In case of a child workflow cancellation it fails with aCanceledFailure. The type defines at which point the exception is thrown. -
setMethodRetry
-
setCronSchedule
-
setVersioningIntent
@Deprecated public ChildWorkflowOptions.Builder setVersioningIntent(VersioningIntent versioningIntent) Deprecated.Worker Versioning is now deprecated please migrate to the Worker Deployment API.Specifies whether this child workflow should run on a worker with a compatible Build Id or not. See the variants ofVersioningIntent. -
setStaticSummary
Single-line fixed summary for this workflow execution that will appear in UI/CLI. This can be in single-line Temporal Markdown format.Default is none/empty.
-
setStaticDetails
General fixed details for this workflow execution that will appear in UI/CLI. This can be in Temporal Markdown format and can span multiple lines. This is a fixed value on the workflow that cannot be updated.Default is none/empty.
-
setPriority
Optional priority settings that control relative ordering of task processing when tasks are backed up in a queue. -
build
-
validateAndBuildWithDefaults
-
system.enableCrossNamespaceCommandsdynamic config flag).