Temporal Schedules deleted after retention period

I understand Temporal Schedules are implemented as an abstraction on top of a Workflow. Moreover, I also understand that closed Workflows are deleted after exceeding the namespace’s configured retention period.

My questions are:

  • When is the underlying Workflow powering a Temporal Schedule closed? Once the Schedule reaches its Schedule End Time?

I understand that if I manually call delete_schedule I will be issuing a termination on the underlying Workflow, effectively closing it, but I am interested in what can cause this Workflow to be closed without a manual call to delete_schedule.

I have been running fairly long schedules, and none of them seem to have been closed automatically, except for a few schedules I have seen disappear after going past their end times.

  • If the underlying Workflow is closed, is it affected by the retention period? I would assume yes. Would this also delete the Temporal Schedule such that it’s ID may be re-used?

Just to confirm if I could re-create a schedule after it has been deleted using the same ID.

Thank you!

If a schedule has an end time or limited actions, it will delete itself one week after the last action. This will show up as the schedule not existing, and the underlying internal workflow being “terminated”. After that, the usual namespace retention period will apply and the internal workflow will be deleted after that further time. But you can reuse the schedule id after the first period, you don’t need to wait for the second one.

1 Like

Is this true (or rather, documented anywhere)? I’m trying to reuse a schedule id after its “EndAt” has passed (and it has no remaining actions) and I’m getting a ErrScheduleAlreadyRunning error, so I have to delete the schedule before I can reuse the ID.

I mean you can reuse a schedule id after it has deleted itself, which will be one week after it has no remaining actions. You don’t have to wait for the retention period of the underlying internal workflow.

You can always delete a schedule or update it with a whole new configuration whenever you want.

1 Like