Temporal worker keeps failing to start/stabilize with NotFoundError: Workflow/Activity not registered after I removed the code

I’m running into an issue where my Temporal worker is unable to stabilize after I removed a workflow implementation from code.

Context

  • I previously had a workflow type: PeriodicProjectSummaryRefreshWorkflow

  • It also used an activity: refresh_timeline_events

  • I removed the workflow + activity code entirely from my worker deployment

  • After that, my worker keeps logging failures like:

    • NotFoundError: Workflow class PeriodicProjectSummaryRefreshWorkflow is not registered on this worker
      available workflows: *
    • NotFoundError: Activity function refresh_timeline_events is not registered on this worker
      available activities: *

What I tried

  • Terminated the running executions from Temporal UI (I had many runs with IDs like periodic-refresh-space-*)

  • Checked Temporal UI → Schedules tab shows 0 schedules

  • But I still see workflow/activity tasks coming in for that removed workflow type

What is the correct way to cleanly stop/clear these tasks once the workflow code has been removed?