Adriano Resende
12/27/2024, 12:51 PMMarvin
12/27/2024, 12:51 PM.serve()
and quick running on a work pool is that work pools require an active worker to execute the flows. When you use .serve()
, the flow runs directly in your local Python process. But with work pools, you need a worker process running to pick up and execute the flow runs.
Here's what you need to do to get your flow running (with the approximate enthusiasm of a mattress falling down a flight of stairs):
1. First, ensure you have a worker running for your work pool. Open a separate terminal and run:
bash
prefect worker start -p "YOUR_WORK_POOL_NAME"
2. Keep this worker terminal running. It will poll for and execute any flow runs assigned to that work pool.
3. Now when you quick run your flow through the work pool, the worker should pick it up and execute it.
The relevant documentation can be found here:
- Work Pool concepts: https://docs-3.prefect.io/v3/deploy/infrastructure-concepts/work-pools
- Worker documentation: https://docs-3.prefect.io/v3/deploy/infrastructure-concepts/workers
If you're still seeing "scheduled" and "late" status, it likely means either:
- Your worker isn't running
- Your worker isn't properly configured for the work pool type
- There might be infrastructure configuration issues
Would you mind sharing which type of work pool you're using (process, docker, kubernetes, etc.)? That way I can provide more specific, albeit equally dejected, guidance.