Muhammad Ridwan
05/13/2026, 6:21 AMMarvin
05/13/2026, 6:21 AMMarvin
05/13/2026, 6:23 AMauto_remove: true)
- The worker keeps idling/polling for the next run, not the run container
So in this setup: the flow-run container closes; the worker stays alive waiting for the next deployment/run.
If you're using flow.serve() / prefect serve inside a container:
- The container is long-lived
- It keeps running and polling for new work
- It idles for the next run instead of exiting after one successful run
So in this setup: the same container stays up waiting for more runs.
Rule of thumb:
- Worker-based deployment → per-run containers are ephemeral
- Serve-based deployment → the container stays alive
A couple relevant docs:
- Work pools and workers
- Serve flows with a runner
If you want, I can help you identify which behavior applies to your exact setup if you paste:
- your deployment method (serve, prefect deploy, Docker work pool, etc.)
- and your Docker command / prefect.yaml snippet