Is there a way to configure a maintenance window for workflow cleanup?

Hi,

As I understand, temporal automatically deletes completed and failed workflows after the retention period.

One thing I am a little worried about is that Temporal may do the cleanup during busy hours and affect the application.

How does Temporal decide when to do the cleanup actually?
And are there any ways to control when the cleanup happens?

Thank you

Do you workflow executions complete around the same time? If they do would consider
doing manual batch-delete job before namespace retention period.
You cannot throttle retention timers, but you can throttle batch-delete via dynamic configs

worker.batcherRPS
worker.batcherConcurrency

so with this you can already delete most of completed executions before the mass retention timers fire, and when they do they would basically be no-op as your batch operation already deleted the completed executions.

If your executions completions are more spread out then I don’t think there is much to worry about as retention timers for them would be spread out as well.

Hi, thanks for your reply.

We don’t have a crazy amount of loads so I agree it should not be a serious problem.

It is just good to know more about how it so that I won’t shoot myself in the foot.

May I ask how does Temporal decide when to do the cleanup actually?
Is the cleanup performed daily ?
Or is it performed when the number of workflows to be clean up reaches a certein threshold etc?