We are using below code to timeout the workflow after 24hrs (DateUtil.getInstant(getStartTime()).get().isBefore(Instant.now().minus(24, ChronoUnit.HOURS)))
However we observed that the workflow got timed out in 5mins
I came to know from the documentation that with in the workflow I should use only Workflow.currentTimeMillis() to get current time
Can above non-deterministic code can cause the workflow to timeout in 5 mins instead of 24hrs?
What do you mean by “workflow timeout”? Can you post the workflow execution history first and last events?
Sorry for the confusion. I mean when that condition satisfies then I am returning from the workflow. But with in 5 mins of start time that condition has been met and workflow completed. I couldn’t figure out what else can cause other than that non-deterministic code.
Then there are no any guarantees if you use nondeterministic time.
ok, thanks Maxim for the clarification.