Workflow using continueAsNew getting timedout

My workflow logic using java-sdk is something like :
void init(xyz)
Workflow.await(Duration.ofMinutes(15), () → exitRequested);
AbcWf continueAsNew = Workflow.newContinueAsNewStub(AbcWf.class);

Workflow performs some operations, then wait for 15mins and then it continueAsNew.
It runs smoothly for some days and then suddenly workflow status changes to TimedOut.
I am not able to figure out why this is happening and how to solve this issue.
Workflow is getting timedout mostly before the 15mins timer is fired.

Hello @Aadeesh_Jain

Are you setting workflowExecutionTimeout when you start the workflow?

Can you share the workflow options or the workflow history?


Hi @antonio.perez
While starting the init workflow i am setting these workflowoptions
FYI i am not setting any ContinueAsNewOptions


It looks like the workflow is timed out due to setWorkflowExecutionTimeout

A Workflow Execution Timeout is the maximum time that a Workflow Execution can be executing (have an Open status) including retries and any usage of Continue As New.

This doc will help you understanding it Workflows | Temporal Documentation

Why are you setting it?


We are observing this TimedOut exception recently and its quite frequent.
Earlier also we were using same execution timeout in workflow options and the workflow used to run for months as expected.
So, when I am doing
it should be starting a new execution for the init workflow with new executionTimeout.

How to debug this case?


Execution timeout is specified when a workflow is started. It specifies the overall timeout for the whole chain of workflows that call continue-as-new. it is not possible to change it from the workflow by calling continue-as-new.

thanks @maxim , will try removing executionTimeout from wf options
By default it should take infinite execution timeout then