Tomás Rossetti
02/19/2026, 4:44 PMMarvin
02/19/2026, 4:44 PMNate
02/19/2026, 4:45 PMTomás Rossetti
02/19/2026, 4:46 PMprefecthq/prefect:3.6.13-python3.11-kubernetes. Is that what you were asking?Nate
02/19/2026, 4:47 PMimage via deployment job_variable overrides of your k8s work poolNate
02/19/2026, 4:47 PMTomás Rossetti
02/19/2026, 4:48 PMNate
02/19/2026, 4:49 PMtree etc and poke around this repo: https://github.com/zzstoatzz/prefect-pack/tree/main with the gh api subgroupTomás Rossetti
02/19/2026, 4:49 PMproject_root/
│
├── pyproject.toml
└── src/
└── module_a/
└── module_b/
and I need code in module_a to be used in module_b . I'm currently installing these when I build the image, but ideally I'd just get the most up-to-date code when I git clone as part of my usual Prefect workflowNate
02/19/2026, 4:50 PMNate
02/19/2026, 4:50 PMNate
02/19/2026, 4:51 PMTomás Rossetti
02/19/2026, 4:51 PM[tool.hatch.build.targets.wheel]
packages = [
"...",
"...",
]Marvin
02/19/2026, 4:52 PMcommand to run Prefect’s engine via uv, e.g. uv run -m prefect.engine. This makes the worker invoke uv, which can (re)create/refresh the environment before execution.
Two common ways to do it:
Option A — Set it at the work pool (affects all deployments on that pool)
1) Get and edit the base job template:
prefect work-pool get-default-base-job-template --type process --file process.json
In process.json, set the default for the command variable to:
"uv run -m prefect.engine"
Optionally add flags like --refresh or `--python 3.11`:
"uv run --refresh --python 3.11 -m prefect.engine"
Then update the pool:
prefect work-pool update my-process-pool --base-job-template process.json
Verify:
prefect work-pool inspect my-process-pool
Option B — Set it per deployment (no template editing)
In your prefect.yaml:
deployments:
- name: my-deployment
entrypoint: flows/my_flow.py:my_flow
work_pool:
name: my-process-pool
job_variables:
command: "uv run --refresh -m prefect.engine"
Or in Python when deploying:
from prefect import flow
@flow
def my_flow():
...
my_flow.from_source(
source="<https://github.com/your/repo.git>",
entrypoint="flows/my_flow.py:my_flow"
).deploy(
name="my-deployment",
work_pool_name="my-process-pool",
job_variables={"command": "uv run --refresh -m prefect.engine"}
)
Notes
- Make sure uv is available on PATH wherever your worker runs.
- The command string is executed as-is; Prefect defaults to python -m prefect.engine only when command is unset.
- If you want to strictly re-resolve/install before every run, consider --refresh with uv. Adjust flags to your project’s setup (e.g., --python, using a lockfile, etc.).
Helpful docs:
- Manage work pools
- Customize job variables
- Customize base job templates
- Process worker API
- Work pool CLI
Quick question to confirm: are you using the Process worker, or another worker type (Docker/Kubernetes)? The same approach works for other workers via their base job template, but I can tailor the exact steps if you share which one you’re using.Tomás Rossetti
02/19/2026, 4:53 PMNate
02/19/2026, 4:53 PMNate
02/19/2026, 4:54 PMcommand job variable with a uv run command
the rub here that we need to improve is an ordering problem
the worker creates the flow run process (in this case, your pod)
but since the pull step clone happens inside that pod, you can't use what you clone in the uv run command, if that makes senseNate
02/19/2026, 4:54 PMcommand is the best way to deal with itNate
02/19/2026, 4:56 PM--refresh would only work if you already cloned, which doesn't work for the same ordering reason i just mentionedNate
02/19/2026, 4:56 PM--with flagTomás Rossetti
02/20/2026, 1:17 PMTomás Rossetti
02/20/2026, 1:17 PM