ASHIK
07/16/2025, 12:54 PMMarvin
07/16/2025, 12:54 PMMarvin
07/16/2025, 12:56 PMCtrl+C
in the terminal where the worker is running
- Or find the process ID (PID) and use the kill
command:
bash
# Find the worker process
ps aux | grep "prefect worker"
# Kill the process gracefully (replace PID with the actual process ID)
kill PID
2. If running as a service or in a container:
- If using Docker: docker stop <container-name>
- If using systemd: sudo systemctl stop prefect-worker
- If using Kubernetes: kubectl delete pod <worker-pod-name>
The worker will perform a graceful shutdown when it receives the termination signal. After about 90 seconds of no heartbeat, the Prefect server will mark the worker as offline.
Note that there's no specific CLI command to delete a worker - workers are ephemeral processes that you simply stop when you no longer need them. If you want to remove a work pool instead (which workers connect to), that's a different command and I can provide those instructions if needed.
Would you like me to provide more specific instructions for your particular setup (Docker, Kubernetes, local process, etc.)?ASHIK
07/16/2025, 1:04 PM