oleander-whirlwind
12/05/2025, 1:25 PMMarvin
12/05/2025, 1:25 PMMarvin
12/05/2025, 1:27 PMmy-project/
├── src/
│ └── my_project/
│ ├── __init__.py
│ ├── flows.py # @flow definitions
│ └── tasks.py
├── tests/
│ ├── test_flows.py
│ └── conftest.py
├── config/
│ ├── dev.yaml
│ └── prod.yaml
├── pyproject.toml
└── deploy.py # optional — calls .from_source(...).deploy(...)
Key points:
- Prefect only needs to import your flow and resolve the entrypoint; it doesn’t care if it’s under src/ or a top-level flows/ folder.
- If you use a top-level folder (e.g., flows/), make it a package (add init.py) and ensure it’s on PYTHONPATH in your runtime.
- In Prefect 3.x deployments, use `flow.from_source(...).deploy(...)`; the entrypoint is the path to the file and flow function relative to the source root, e.g. src/my_project/flows.py:my_flow.
Helpful references:
- Deploy flows with Python (.deploy)
- Store and retrieve flow code (Git/local/etc.)
- Write and run workflows
If you share your repo layout, I’m happy to suggest concrete entrypoints and a minimal deploy script.