When upgrading from using agents to workers in Prefect 2.x, the way in which deployments are managed changes. Workers, which are a combination of agents and infrastructure blocks, poll a work queue for flow runs that are scheduled to start. However, unlike with agents, deploying a flow with a worker does not involve specifying an infrastructure block. This is because workers are typed and specify the default configuration for jobs submitted to that infrastructure.
For more information, refer to the Prefect documentation detailing the
upgrade from agents to workers and the corresponding
Deployment API documentation.