How to set a Workflow Run Timeout in Java
Set the Workflow Run Timeout with the WorkflowStub
instance in the Client code using WorkflowOptions.Builder.setWorkflowRunTimeout
.
- Type:
time.Duration
- Default: Same as WorkflowExecutionTimeout.
//create Workflow stub for YourWorkflowInterface
YourWorkflowInterface workflow1 =
WorkerGreet.greetclient.newWorkflowStub(
GreetWorkflowInterface.class,
WorkflowOptions.newBuilder()
.setWorkflowId("YourWF")
.setTaskQueue(WorkerGreet.TASK_QUEUE)
// Set Workflow Run Timeout duration
.setWorkflowRunTimeout(Duration.ofSeconds(10))
.build());