@Marvin when I run a python script and call "serve"... is that considered a worker?
m
Marvin
01/30/2025, 3:46 PM
In Prefect 3.x, a "worker" is a lightweight polling service that retrieves scheduled runs from a work pool and executes them. Workers are responsible for provisioning the flow run infrastructure and can only poll work pools that match their type. Each worker type corresponds to a specific execution environment.
When you run a Python script and call "serve," it's not inherently considered a worker in the Prefect context. Workers are specifically designed to handle flow runs by polling work pools. The "serve" function typically relates to serving a FastAPI application or similar, not directly related to Prefect's worker concept.
For more details on workers in Prefect, you can refer to this documentation.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.