Chalama Reddy
08/03/2026, 2:07 PMMarvin
08/03/2026, 2:07 PMMarvin
08/03/2026, 2:09 PMbash
prefect worker start --pool <WORK_POOL_NAME>
But before that, the worker needs to know which Prefect API to talk to and how to authenticate.
Required connection parameters
For Prefect Cloud / Enterprise Cloud:
bash
export PREFECT_API_URL="<https://api.prefect.cloud/api/accounts/<ACCOUNT_ID>/workspaces/<WORKSPACE_ID>>"
export PREFECT_API_KEY="<YOUR_API_KEY>"
Then start the worker:
bash
prefect worker start --pool my-pool
For a self-hosted Prefect server / enterprise deployment:
bash
export PREFECT_API_URL="https://<your-prefect-server>/api"
If your server also requires auth, set the appropriate auth env vars configured for that deployment.
Worker start parameters
From the CLI, the key options are:
- --pool / -p → required, the work pool name
- --name / -n → optional worker name
- --work-queue / -q → optional specific queue(s) to poll
- --type / -t → optional; often inferred from the pool
- --limit / -l → optional concurrency limit
- --with-healthcheck → optional health endpoint on port 8080
- --run-once → optional, poll once and exit
Example:
bash
prefect worker start \
--pool my-pool \
--name my-worker \
--limit 5 \
--with-healthcheck
Typical setup flow
1. Authenticate to Prefect Cloud / Enterprise
2. Create a work pool
3. Start the worker pointing at that pool
Example:
bash
export PREFECT_API_URL="<https://api.prefect.cloud/api/accounts/<ACCOUNT_ID>/workspaces/<WORKSPACE_ID>>"
export PREFECT_API_KEY="<YOUR_API_KEY>"
prefect work-pool create my-pool --type process
prefect worker start --pool my-pool
Alternative login method for Cloud
Instead of manually setting env vars, you can log in with:
bash
prefect cloud login --key "<API_KEY>" --workspace "<account_handle>/<workspace_handle>"
Then start the worker:
bash
prefect worker start --pool my-pool
Important notes
- The worker must point to the same workspace where your deployments/work pools exist.
- The work pool type must match your infrastructure, e.g. process, docker, kubernetes, etc.
- --pool is the main required CLI parameter.
- For Cloud, PREFECT_API_URL + PREFECT_API_KEY are the main required connection settings unless you already logged in via prefect cloud login.
Verified CLI references
- prefect worker start --help
- prefect cloud login --help
- prefect work-pool create --help
Helpful docs:
- Workers
- Work pools
- Prefect Cloud
- Prefect Cloud UI
If you want, I can also give you:
- a full worker startup command for process / docker / kubernetes, or
- a systemd/docker/k8s example for running the worker in production.