Looking for an equivalent of lastCompletionEndTimestamp

I would like to start a workflow only if it was not completed in the last N milliseconds. Looks like I can filter workflows by start time and end time with execution filters, but how I can I get the last end timestamp of a single workflow?

WorkflowStub stb = client.newUntypedWorkflowStub("WORKFLOW_ID", Optional.empty(), Optional.of("LongRunningWorkflow"));

if (currentTime - stb.lastCompletionEndTimestamp > N ) {

You can use DescribeWorkflowExecution API. Its result contains workflow_execution_info.close_time field.

Another, more generic option is to not complete the workflow once its logic is done and sleep for some time before completing. Then use signal with start to either signal an open workflow or start a new one.