Jason Wiener
09/23/2025, 7:37 PMprefect deploy
and select "No, configure a new deployment" from the menu, I do not get a list of flows that could be deployed despite there being many flows in the working directory and subfolders. Help me troubleshoot this.Marvin
09/23/2025, 7:37 PMMarvin
09/23/2025, 7:45 PMprefect deploy
wizard isn’t showing any flows when you pick “No, configure a new deployment”.
How the wizard finds flows (Prefect 3.x)
- It scans your project directory (recursively) for Python files, imports them in a safe way, and collects top-level functions decorated with @flow
.
- It respects ignore patterns (e.g., .prefectignore
) and won’t scan ignored files/folders.
- If importing a file raises an error (missing dependency, code that runs on import and fails, syntax error, etc.), that file’s flows will be skipped. These errors are typically only visible in DEBUG logs.
Common reasons nothing is listed
1) You’re not in the project root when running the command
- The wizard expects to run from a project root (ideally one that has a prefect.yaml
).
- Fix: cd
to the directory with your project and (optionally) run prefect init
once to create a prefect.yaml
.
2) Your flows are ignored by .prefectignore
- If your flows are in a directory that’s ignored (or patterns accidentally ignore **/*.py
in a subfolder), they won’t be discovered.
- Fix: Check .prefectignore
at your project root and remove/adjust patterns that hide your flow files.
3) Import errors during discovery
- If a module import in a flow file fails (e.g., missing package, environment variable required at import time, code that connects to a service at import time and errors), discovery skips that file.
- Fixes:
- Ensure the same environment running prefect
can import your code: python -c "import your_module_or_run_one_flow_file"
should succeed.
- Move heavy side-effects out of import time (e.g., put setup code under if __name__ == "__main__":
or inside functions called at runtime).
- Install any missing packages in the same environment as prefect
.
4) Flows not defined at module top-level or missing the decorator
- The wizard only finds top-level @flow
-decorated functions.
- Fix: Ensure your flows look like:
from prefect import flow
@flow
def my_flow(...):
...
and are not defined inside another function or under if __name__ == "__main__":
.
5) Mixed environments or multiple Python interpreters
- prefect
may be running from a different venv than your project dependencies.
- Fix: Make sure which prefect
points to the expected environment and that python -c "import prefect"
uses the same interpreter.
6) Non-.py files or notebooks
- The wizard doesn’t discover flows in notebooks. Ensure they’re in .py
files.
Turn on debug logs to see what’s happening
- Run the wizard with debug logging to get discovery errors printed:
PREFECT_LOGGING_LEVEL=DEBUG prefect deploy
Then choose “No, configure a new deployment” and see if you get messages like “Skipping file due to import error”.
Quick workarounds to proceed
- Specify a flow entrypoint directly (bypasses discovery):
prefect deploy ./path/to/file.py:my_flow
This will still prompt for the rest interactively.
- If you don’t have a project file yet, initialize one first:
prefect init
Then re-run:
PREFECT_LOGGING_LEVEL=DEBUG prefect deploy
If you’re still stuck, can you share:
- Output of prefect version
- Your project root structure (a quick tree of the folders with the flow locations)
- Whether there’s a .prefectignore
and its contents
- Any errors you see when you run:
PREFECT_LOGGING_LEVEL=DEBUG prefect deploy
- One example flow file (or the flow signature + its imports)
With that, I can pinpoint the exact cause and get you moving.Jason Wiener
09/23/2025, 8:03 PMprefect deploy
reads the contents of prefect.yaml for git info and existing deployments so that file seems fine and located in the right place. The .prefectignore file is below.
# prefect artifacts
.prefectignore
# python artifacts
__pycache__/
*.py[cod]
*$py.class
*.egg-info/
*.egg
# Type checking artifacts
.mypy_cache/
.dmypy.json
dmypy.json
.pyre/
# IPython
profile_default/
ipython_config.py
*.ipynb_checkpoints/*
# Environments
.python-version
.env
.venv
env/
venv/
# MacOS
.DS_Store
# Dask
dask-worker-space/
# Editors
.idea/
.vscode/
# VCS
.git/
.hg/
# Development tools and lock files
engineering/tools/sync_docker_requirements.py
engineering/tools/setup_dev_env.py
The folder structure includes a prefect.yaml at the root and subfolders like tutorials
that contains the following script that is not detected by prefect deploy
:
import httpx
from datetime import timedelta
from prefect import flow, task, get_run_logger
from prefect.tasks import task_input_hash
@task(cache_key_fn=task_input_hash, cache_expiration=timedelta(seconds=10))
def get_url(url: str, params: dict = None):
response = httpx.get(url, params=params)
response.raise_for_status()
return response.json()
@flow
def get_open_issues_jmw(repo_name: str, open_issues_count: int, per_page: int = 100):
issues = []
pages = range(1, -(open_issues_count // -per_page) + 1)
for page in pages:
issues.append(
get_url.submit(
f"<https://api.github.com/repos/{repo_name}/issues>",
params={"page": page, "per_page": per_page, "state": "open"},
)
)
return [i for p in issues for i in p.result()]
@flow(retries=3, retry_delay_seconds=5)
def get_repo_info_jmw(
repo_name: str = "PrefectHQ/prefect"
):
repo = get_url(f"<https://api.github.com/repos/{repo_name}>")
issues = get_open_issues_jmw(repo_name, repo["open_issues_count"])
issues_per_user = len(issues) / len(set([i["user"]["id"] for i in issues]))
logger = get_run_logger()
logger.info(f"PrefectHQ/prefect repository statistics 🤓:")
logger.info(f"Stars 🌠 : {repo['stargazers_count']}")
logger.info(f"Forks 🍴 : {repo['forks_count']}")
logger.info(f"Average open issues per user 💌 : {issues_per_user:.2f}")
if __name__ == "__main__":
get_repo_info_jmw()
The command output is as follows:
(venv) PS C:\Users\j\PycharmProjects\prefect-scripts> $env:PREFECT_LOGGING_LEVEL="DEBUG"; prefect deploy
13:57:54.171 | DEBUG | prefect.profiles - Using profile 'cloud-dev'
? Would you like to use an existing deployment configuration? [Use arrows to move; enter to select; n to select none]
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ Name ┃ Entrypoint ┃ Description ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ │ dbt_run_sprout_social │ engineering\tools\run_dbt_job.py:run_dbt_job_flow │ trigger Sprout Social dbt job - │
│ │ │ │ <https://cloud.getdbt.com/deploy/><redacted>/projects/<redacted>/jobs/<redacted> │
│ │ dbt_run_bitly_digital │ engineering\tools\run_dbt_job.py:run_dbt_job_flow │ trigger Bitly Digital dbt job - │
│ │ │ │ <https://cloud.getdbt.com/deploy/><redacted>/projects/<redacted>/jobs/<redacted> │
│ > │ │ │ No, configure a new deployment │
└────┴───────────────────────┴───────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────┘
13:57:59.124 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/><redacted>/workspaces/<redacted>/
13:57:59.913 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/><redacted>/workspaces/<redacted>/
? Which work pool would you like to deploy this flow to? [Use arrows to move; enter to select]
┏━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ ┃ Work Pool Name ┃ Infrastructure Type ┃ Description ┃
┡━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ > │ staging │ ecs │ None │
└───┴────────────────┴─────────────────────┴─────────────┘
Marvin
09/23/2025, 8:04 PMMarvin
09/23/2025, 8:05 PM.prefectignore
looks fine — there’s nothing there that would exclude a tutorials/
folder or *.py
files.
- The example flow imports httpx
. If httpx
is not installed in the SAME environment that you’re running prefect deploy
from, Prefect will fail to import that file during discovery and skip it. In DEBUG logs, these import errors can be easy to miss.
Let’s quickly test/triage:
1) Verify the environment has httpx and your flow imports cleanly
- In the same shell where you run `prefect deploy`:
python -c "import sys, httpx; print(sys.executable); print('httpx', httpx.__version__)"
If that fails, install it in this environment:
pip install httpx
- Try importing your flow file directly to surface any import-time errors:
python -c "import importlib.util, pathlib; p=pathlib.Path('tutorials') ; f=next(p.rglob('*.py')); spec=importlib.util.spec_from_file_location('mod', str(f)); m=importlib.util.module_from_spec(spec); spec.loader.exec_module(m); print('Imported OK:', f)"
If this errors, Prefect’s flow discovery will skip that file too.
2) Try a minimal flow (isolates discovery from dependencies)
- Create a tiny file under your project root or in `tutorials/`:
from prefect import flow
@flow
def hello():
return "hi"
- Then run:
PREFECT_LOGGING_LEVEL=DEBUG prefect deploy
Continue past the “existing deployment” screen and select the work pool. Do you see hello
now? If you do, import failures in your other files (e.g. missing httpx
) are the culprit.
3) Bypass discovery to confirm the entrypoint
- If you know the path and function name, provide it directly:
prefect deploy ./tutorials/<your_file>.py:get_repo_info_jmw
If that works, discovery is being blocked by an import error.
4) Confirm you’re in the project root and using the right interpreter
- From the same shell:
pwd
which prefect
prefect --version
python -c "import prefect; print(prefect.__version__)"
This ensures prefect
and your dependencies are in the same venv.
If you can, please paste:
- The next prompt you see after selecting the work pool
- Output of the python -c "import sys, httpx; ..."
check
- The exact path/name of your tutorials
file
- Any error you get when you try importing the file directly (step 1)
With that, we can zero in on the exact cause. My bet is the environment is missing httpx
(or another import the flow needs), and discovery is quietly skipping those files.Jason Wiener
09/24/2025, 2:54 PM(venv) PS C:\Users\j\PycharmProjects\prefect-scripts> $env:PREFECT_LOGGING_LEVEL="DEBUG"; prefect deploy
08:39:37.215 | DEBUG | prefect.profiles - Using profile 'cloud-dev'
? Would you like to use an existing deployment configuration? [Use arrows to move; enter to select; n to select none]
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ Name ┃ Entrypoint ┃ Description ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ │ dbt_run_sprout_social │ engineering\tools\run_dbt_job.py:run_dbt_job_flow │ trigger Sprout Social dbt job - │
│ │ │ │ <https://cloud.getdbt.com/deploy/><redcated>/projects/<redcated>/jobs/<redcated> │
│ │ dbt_run_bitly_digital │ engineering\tools\run_dbt_job.py:run_dbt_job_flow │ trigger Bitly Digital dbt job - │
│ │ │ │ <https://cloud.getdbt.com/deploy/><redcated>/projects/<redcated>/jobs/<redcated> │
│ > │ │ │ No, configure a new deployment │
└────┴───────────────────────┴───────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────┘
08:39:43.661 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/><redcated>/workspaces/<redcated>/
08:39:44.309 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/><redcated>/workspaces/<redcated>/
? Which work pool would you like to deploy this flow to? [Use arrows to move; enter to select]
┏━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ ┃ Work Pool Name ┃ Infrastructure Type ┃ Description ┃
┡━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ > │ staging │ ecs │ None │
└───┴────────────────┴─────────────────────┴─────────────┘
? Would you like to build a custom Docker image for this deployment? [y/n] (n): n
? Would you like to configure schedules for this deployment? [y/n] (y): n
08:40:01.467 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/><redcated>/workspaces/<redcated>/
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Deployment 'run-dbt-job-flow/dbt_run_sprout_social' successfully created with id 'bfc58966-0ad8-48b7-830c-5558d8125c34'. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
View Deployment in UI: <https://app.prefect.cloud/account/><redcated>/workspace/<redcated>/deployments/deployment/bfc58966-0ad8-48b7-830c-5558d8125c34
To execute flow runs from these deployments, start a worker in a separate terminal that pulls work from the None work pool:
$ prefect worker start --pool None
To schedule a run for this deployment, use the following command:
$ prefect deployment run 'run-dbt-job-flow/dbt_run_sprout_social'
(venv) PS C:\Users\jason.weiner\PycharmProjects\prefect-scripts> prefect version
13:58:31.737 | DEBUG | prefect.profiles - Using profile 'cloud-dev'
Version: 3.4.19
API version: 0.8.4
Python version: 3.12.8
Git commit: e7ae41cd
Built: Fri, Sep 19, 2025 09:23 PM
OS/Arch: win32/AMD64
Profile: cloud-dev
Server type: cloud
Pydantic version: 2.11.9
Server:
Database: sqlite
SQLite version: 3.45.3
Integrations:
prefect-aws: 0.5.13
prefect-dbt: 0.7.8
prefect-email: 0.4.2
prefect-redis: 0.2.5
prefect-shell: 0.3.1
Prefect fails to return any flows from the scanning (or even showing the Scanning for Flows message that normally shows), and this scanning happens prior to the work pool selection in the venv where this is working correctly. This is an example of the correct working behavior:
(venv-py312-prefect3) ~\PycharmProjects\prefect-scripts git:[jmw-dev_env_update]
prefect deploy
? Would you like to use an existing deployment configuration? [Use arrows to move; enter to select; n to select none]
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ Name ┃ Entrypoint ┃ Description ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ │ dbt_run_sprout_social │ engineering\tools\run_dbt_job.py:run_dbt_job_flow │ trigger Sprout Social dbt job - │
│ │ │ │ <https://cloud.getdbt.com/deploy/><redacted>/projects/<redacted>/jobs/8… │
│ │ dbt_run_bitly_digital │ engineering\tools\run_dbt_job.py:run_dbt_job_flow │ trigger Bitly Digital dbt job - │
│ │ │ │ <https://cloud.getdbt.com/deploy/><redacted>/projects/<redacted>/jobs/9… │
│ > │ │ │ No, configure a new deployment │
└────┴───────────────────────┴───────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────┘
<unknown>:124: SyntaxWarning: invalid escape sequence '\-'
<unknown>:673: SyntaxWarning: invalid escape sequence '\/'
<unknown>:21: SyntaxWarning: invalid escape sequence '\-'
<unknown>:231: SyntaxWarning: invalid escape sequence '\-'
<unknown>:131: SyntaxWarning: invalid escape sequence '\-'
<unknown>:205: SyntaxWarning: invalid escape sequence '\d'
? Select a flow to deploy [Use arrows to move; enter to select; n to select none]
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ Flow Name ┃ Location ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ │ get_ip │ engineering\tools\get_ip.py │
│ │ get_open_issues_aria │ tutorials\tutorial-aria.py │
│ > │ get_repo_info_aria │ tutorials\tutorial-aria.py │
│ │ grant_select_permissions │ engineering\tools\grant_select_permissions.py │
│ │ │ Enter a flow entrypoint manually │
└────┴──────────────────────────┴────────────────────────────────────────────────────────────────────┘
? Deployment name (default): debug_dev
? Which work pool would you like to deploy this flow to? [Use arrows to move; enter to select]
┏━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ ┃ Work Pool Name ┃ Infrastructure Type ┃ Description ┃
┡━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ > │ staging │ ecs │ None │
└───┴────────────────┴─────────────────────┴─────────────┘
? Would you like to build a custom Docker image for this deployment? [y/n] (n): n
? Would you like to configure schedules for this deployment? [y/n] (y): n
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Deployment 'get-repo-info-aria/debug_dev' successfully created with id '7c0f0bcb-5456-4457-9b2c-b3590d5a69cf'. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
View Deployment in UI: <https://app.prefect.cloud/account/><redacted>/workspace/<redacted>/deployments/deployment/7c0f0bcb-5456-4457-9b2c-b3590d5a69cf
To execute flow runs from these deployments, start a worker in a separate terminal that pulls work from the None work pool:
$ prefect worker start --pool None
To schedule a run for this deployment, use the following command:
$ prefect deployment run 'get-repo-info-aria/debug_dev'
(venv-py312-prefect3) ~\PycharmProjects\prefect-scripts git:[jmw-dev_env_update]
prefect version
Version: 3.3.6
API version: 0.8.4
Python version: 3.12.8
Git commit: 01441afa
Built: Thu, Apr 24, 2025 07:26 PM
OS/Arch: win32/AMD64
Profile: cloud-dev
Server type: cloud
Pydantic version: 2.10.6
Integrations:
prefect-aws: 0.5.3
prefect-dbt: 0.6.5
prefect-email: 0.4.1
prefect-shell: 0.3.1
In the new venv where the issue is occurring, httpx is installed:
(venv) PS C:\Users\jason.weiner\PycharmProjects\prefect-scripts> python -c "import sys, httpx; print(sys.executable); print('httpx', httpx.__version__)"
C:\Users\jason.weiner\PycharmProjects\prefect-scripts\venv\Scripts\python.exe
httpx 0.28.1
Marvin
09/24/2025, 2:55 PM(venv) PS C \Users\j\PycharmProjects\prefect-scripts> $env PREFECT_LOGGING_LEVEL= DEBUG ; prefect deploy 08 39 37 215 | DEBUG | prefect profiles - Using profile 'cloud-dev' ? Would you like to use an existing deployment configuration? [Use arrows to move; enter to select; n to select none] ┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ ┃ Name ┃ Entrypoint ┃ Description ┃ ┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ │ dbt_run_sprout_social │ engineering\tools\run_dbt_job py run_dbt_job_flow │ trigger Sprout Social dbt job - │ │ │ │ │ <https //cloud getdbt com/deploy/><redcated>/projects/<redcated>/jobs/<redcated> │ │ │ dbt_run_bitly_digital │ engineering\tools\run_dbt_job py run_dbt_job_flow │ trigger Bitly Digital dbt job - │ │ │ │ │ <https //cloud getdbt com/deploy/><redcated>/projects/<redcated>/jobs/<redcated> │ │ > │ │ │ No configure a new deployment │ └────┴───────────────────────┴───────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────┘ 08 39 43 661 | DEBUG | prefect client - Connecting to API at <https //api prefect cloud/api/accounts/><redcated>/workspaces/<redcated>/ 08 39 44 309 | DEBUG | prefect client - Connecting to API at <https //api prefect cloud/api/accounts/><redcated>/workspaces/<redcated>/ ? Which work pool would you like to deploy this flow to? [Use arrows to move; enter to select] ┏━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓ ┃ ┃ Work Pool Name ┃ Infrastructure Type ┃ Description ┃ ┡━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩ │ > │ staging │ ecs │ None │ └───┴────────────────┴─────────────────────┴─────────────┘ ? Would you like to build a custom Docker image for this deployment? [y/n] (n) n ? Would you like to configure schedules for this deployment? [y/n] (y) n 08 40 01 467 | DEBUG | prefect client - Connecting to API at <https //api prefect cloud/api/accounts/><redcated>/workspaces/<redcated>/ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ Deployment 'run-dbt-job-flow/dbt_run_sprout_social' successfully created with id 'bfc58966-0ad8-48b7-830c-5558d8125c34' │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ View Deployment in UI <https //app prefect cloud/account/><redcated>/workspace/<redcated>/deployments/deployment/bfc58966-0ad8-48b7-830c-5558d8125c34 To execute flow runs from these deployments start a worker in a separate terminal that pulls work from the None work pool $ prefect worker start --pool None To schedule a run for this deployment use the following command $ prefect deployment run 'run-dbt-job-flow/dbt_run_sprout_social' (venv) PS C \Users\jason weiner\PycharmProjects\prefect-scripts> prefect version 13 58 31 737 | DEBUG | prefect profiles - Using profile 'cloud-dev' Version 3 4 19 API version 0 8 4 Python version 3 12 8 Git commit e7ae41cd Built Fri Sep 19 2025 09 23 PM OS/Arch win32/AMD64 Profile cloud-dev Server type cloud Pydantic version 2 11 9 Server Database sqlite SQLite version 3 45 3 Integrations prefect-aws 0 5 13 prefect-dbt 0 7 8 prefect-email 0 4 2 prefect-redis 0 2 5 prefect-shell 0 3 1
Prefect fails to return any flows from the scanning (or even showing the Scanning for Flows message that normally shows) and this scanning happens prior to the work pool selectionMarvin
09/24/2025, 2:55 PMJason Wiener
09/24/2025, 2:56 PM(venv-py312-prefect3) ~\PycharmProjects\prefect-scripts git:[jmw-dev_env_update]
prefect deploy
? Would you like to use an existing deployment configuration? [Use arrows to move; enter to select; n to select none]
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ Name ┃ Entrypoint ┃ Description ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ │ dbt_run_sprout_social │ engineering\tools\run_dbt_job.py:run_dbt_job_flow │ trigger Sprout Social dbt job - │
│ │ │ │ <https://cloud.getdbt.com/deploy/><redacted>/projects/<redacted>/jobs/8… │
│ │ dbt_run_bitly_digital │ engineering\tools\run_dbt_job.py:run_dbt_job_flow │ trigger Bitly Digital dbt job - │
│ │ │ │ <https://cloud.getdbt.com/deploy/><redacted>/projects/<redacted>/jobs/9… │
│ > │ │ │ No, configure a new deployment │
└────┴───────────────────────┴───────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────┘
<unknown>:124: SyntaxWarning: invalid escape sequence '\-'
<unknown>:673: SyntaxWarning: invalid escape sequence '\/'
<unknown>:21: SyntaxWarning: invalid escape sequence '\-'
<unknown>:231: SyntaxWarning: invalid escape sequence '\-'
<unknown>:131: SyntaxWarning: invalid escape sequence '\-'
<unknown>:205: SyntaxWarning: invalid escape sequence '\d'
? Select a flow to deploy [Use arrows to move; enter to select; n to select none]
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ Flow Name ┃ Location ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ │ get_ip │ engineering\tools\get_ip.py │
│ │ get_open_issues_aria │ tutorials\tutorial-aria.py │
│ > │ get_repo_info_aria │ tutorials\tutorial-aria.py │
│ │ grant_select_permissions │ engineering\tools\grant_select_permissions.py │
│ │ │ Enter a flow entrypoint manually │
└────┴──────────────────────────┴────────────────────────────────────────────────────────────────────┘
? Deployment name (default): debug_dev
? Which work pool would you like to deploy this flow to? [Use arrows to move; enter to select]
┏━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ ┃ Work Pool Name ┃ Infrastructure Type ┃ Description ┃
┡━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ > │ staging │ ecs │ None │
└───┴────────────────┴─────────────────────┴─────────────┘
? Would you like to build a custom Docker image for this deployment? [y/n] (n): n
? Would you like to configure schedules for this deployment? [y/n] (y): n
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Deployment 'get-repo-info-aria/debug_dev' successfully created with id '7c0f0bcb-5456-4457-9b2c-b3590d5a69cf'. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
View Deployment in UI: <https://app.prefect.cloud/account/><redacted>/workspace/<redacted>/deployments/deployment/7c0f0bcb-5456-4457-9b2c-b3590d5a69cf
To execute flow runs from these deployments, start a worker in a separate terminal that pulls work from the None work pool:
$ prefect worker start --pool None
To schedule a run for this deployment, use the following command:
$ prefect deployment run 'get-repo-info-aria/debug_dev'
(venv-py312-prefect3) ~\PycharmProjects\prefect-scripts git:[jmw-dev_env_update]
prefect version
Version: 3.3.6
API version: 0.8.4
Python version: 3.12.8
Git commit: 01441afa
Built: Thu, Apr 24, 2025 07:26 PM
OS/Arch: win32/AMD64
Profile: cloud-dev
Server type: cloud
Pydantic version: 2.10.6
Integrations:
prefect-aws: 0.5.3
prefect-dbt: 0.6.5
prefect-email: 0.4.1
prefect-shell: 0.3.1
Marvin
09/24/2025, 2:56 PMMarvin
09/24/2025, 3:04 PMprefect.yaml
lives).
- Confirm Prefect and Python versions match between venvs. Please share the failing venv’s output:
prefect version
python --version
Turn on debug logs for discovery
- PowerShell:
$env:PREFECT_LOGGING_LEVEL='DEBUG'
prefect deploy
- CMD:
set PREFECT_LOGGING_LEVEL=DEBUG
prefect deploy
- Bash:
PREFECT_LOGGING_LEVEL=DEBUG prefect deploy
Then watch for any errors right before/after “Scanning for flows…”.
Bypass discovery (sanity check)
- Try deploying a known entrypoint directly. This will tell us if the wizard’s discovery is the only issue:
prefect deploy engineering\tools\get_ip.py:get_ip -n debug_direct
Tip on Windows: use a relative path, not a drive-letter path (avoid C:\...:flow_func
) so the colon only separates file.py:flow_func
.
Check for import failures in flow modules
Flow discovery imports your Python modules to find @flow
functions. If imports fail (missing deps, path issues), discovery can return nothing.
- From the failing venv, try importing one of your flow files:
python -c "import importlib, traceback; m='engineering.tools.get_ip';
try:
importlib.import_module(m)
print('Imported', m)
except Exception as e:
print('Import failed:', e); traceback.print_exc()"
If that fails, that’s likely why discovery is blank. Compare installed deps between venvs.
Verify the CLI is using prompts (just to rule out prompt mode toggles)
prefect --help
prefect deploy --help
prefect config view --show-sources
Look for any PREFECT_CLI_PROMPT
override in the output of prefect config view --show-sources
.
Minimal repro inside the repo
- Drop a trivial flow at the project root and re-run discovery. If it’s not found, the scanner isn’t running; if it is, an import error in your main codebase is likely the blocker.
# quick_flow.py
from prefect import flow
@flow
def hello(): print("hi")
Run:
prefect deploy
Workarounds if you’re unblocked by manual paths
- Keep using the entrypoint form for now:
prefect deploy path\to\file.py:flow_name
- Or deploy from code with:
from prefect import flow
flow.from_source("<https://github.com/owner/repo>", entrypoint="path/to/file.py:flow").deploy(name="my-deploy", work_pool_name="staging")
Docs for reference
- Creating deployments: Create deployments
- Logging customization: Logging customization
If you can share:
- The failing venv’s prefect version
output
- Any DEBUG logs around the discovery step
- The result of importing one of your flow modules as above
…I can narrow this down quickly. My hunch is an import error in the project (missing dep or path) in the failing venv, but the debug output will confirm whether discovery is being invoked at all.Jason Wiener
09/24/2025, 3:38 PM(venv) PS C:\Users\jason.weiner\PycharmProjects\prefect-scripts> prefect deploy engineering\tools\get_ip.py:get_ip -n debug_direct
09:34:10.859 | DEBUG | prefect.profiles - Using profile 'cloud-dev'
The following deployment(s) could not be found and will not be deployed: debug_direct
Could not find any deployment configurations with the given name(s): debug_direct. Your flow will be deployed with a new deployment configuration.
09:34:14.218 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/><redcated>/workspaces/<redcated>/
09:34:14.841 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/><redcated>/workspaces/<redcated>/
? Which work pool would you like to deploy this flow to? [Use arrows to move; enter to select]
┏━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ ┃ Work Pool Name ┃ Infrastructure Type ┃ Description ┃
┡━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ > │ staging │ ecs │ None │
└───┴────────────────┴─────────────────────┴─────────────┘
? Would you like to build a custom Docker image for this deployment? [y/n] (n):
? Would you like to configure schedules for this deployment? [y/n] (y):
? What type of schedule would you like to use? [Use arrows to move; enter to select]
┏━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ Schedule Type ┃ Description ┃
┡━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ > │ Interval │ Allows you to set flow runs to be executed at fixed time intervals. │
│ │ Cron │ Allows you to define recurring flow runs based on a specified pattern using cron syntax. │
│ │ RRule │ Allows you to define recurring flow runs using RFC 2445 recurrence rules. │
└────┴───────────────┴──────────────────────────────────────────────────────────────────────────────────────────┘
? Seconds between scheduled runs (3600):
? Would you like to activate this schedule? [y/n] (y): n
? Would you like to add another schedule? [y/n] (n): n
09:34:32.630 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/><redcated>/workspaces/<redcated>/
09:34:33.886 | DEBUG | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/><redcated>/workspaces/<redcated>/
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Deployment 'get-ip/debug_direct' successfully created with id 'd4564e23-c112-46f5-8057-72683647de02'. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
View Deployment in UI: <https://app.prefect.cloud/account/><redcated>/workspace/<redcated>/deployments/deployment/d4564e23-c112-46f5-8057-72683647de02
To execute flow runs from these deployments, start a worker in a separate terminal that pulls work from the None work pool:
$ prefect worker start --pool None
To schedule a run for this deployment, use the following command:
$ prefect deployment run 'get-ip/debug_direct'
Failing venv details:
09:37:56.719 | DEBUG | prefect.profiles - Using profile 'cloud-dev'
Version: 3.4.19
API version: 0.8.4
Python version: 3.12.8
Git commit: e7ae41cd
Built: Fri, Sep 19, 2025 09:23 PM
OS/Arch: win32/AMD64
Profile: cloud-dev
Server type: cloud
Pydantic version: 2.11.9
Server:
Database: sqlite
SQLite version: 3.45.3
Integrations:
prefect-aws: 0.5.13
prefect-dbt: 0.7.8
prefect-email: 0.4.2
prefect-redis: 0.2.5
prefect-shell: 0.3.1
There isn't anything about the scanning step being skipped in the debug logs.Marvin
09/24/2025, 3:39 PMMarvin
09/24/2025, 3:40 PM$env:PREFECT_LOGGING_LEVEL='DEBUG'
prefect deploy
- Please paste the transcript from the beginning through the “Which work pool…” prompt. Specifically, is there any “Scanning for flows…” line at all?
2) Share the (redacted) prefect.yaml at the project root
- It’s possible 3.4.x is short‑circuiting based on values in prefect.yaml
(e.g., defaults carried over) when choosing “No, configure a new deployment”. Seeing that file will help confirm if the wizard is skipping scan due to config it thinks is already set.
3) Check for any prompt toggles/settings
- Run:
prefect config view --show-sources
Look for any PREFECT_*
settings that could affect CLI prompting or deployments (even if you still see prompts, this can reveal unexpected defaults).
4) Quick regression check (optional)
- In the failing venv, try installing 3.3.6 to confirm scan behavior returns:
pip install 'prefect==3.3.6'
prefect deploy
If this restores the scan step, we have a clean repro to open with the team.
Workarounds you can use right now
- Use direct entrypoints (as you already verified):
prefect deploy engineering\tools\get_ip.py:get_ip -n debug_direct
- Or deploy from code (avoids the wizard entirely):
from prefect import flow
flow.from_source(
"<https://github.com/owner/repo>",
entrypoint="engineering/tools/get_ip.py:get_ip",
).deploy(
name="debug_direct",
work_pool_name="staging",
)
If you can share:
- The failing wizard transcript with DEBUG enabled
- Your project’s prefect.yaml
(redacted)
- Whether downgrading to 3.3.6 restores scanning
…I can either suggest a precise config tweak or raise this as a Windows 3.4.x regression with a minimal repro. In the meantime, using entrypoint-based deploys is a safe path.
References
- Create deployments: Create deployments
- Logging customization: Logging customizationJason Wiener
09/24/2025, 3:58 PM? Would you like to use an existing deployment configuration? [Use arrows to move; enter to select; n to select none]
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃ Name ┃ Entrypoint ┃ Description ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ │ dbt_run_sprout_social │ engineering\tools\run_dbt_job.py:run_dbt_job_flow │ trigger Sprout Social dbt job - │
│ │ │ │ <https://cloud.getdbt.com/deploy/><redcated>/projects/<redcated>/jobs/8… │
│ │ dbt_run_bitly_digital │ engineering\tools\run_dbt_job.py:run_dbt_job_flow │ trigger Bitly Digital dbt job - │
│ │ │ │ <https://cloud.getdbt.com/deploy/><redcated>/projects/<redcated>/jobs/9… │
│ > │ │ │ No, configure a new deployment │
└────┴───────────────────────┴───────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────┘
<unknown>:205: SyntaxWarning: invalid escape sequence '\d'
<unknown>:124: SyntaxWarning: invalid escape sequence '\-'
<unknown>:231: SyntaxWarning: invalid escape sequence '\-'
<unknown>:131: SyntaxWarning: invalid escape sequence '\-'
<unknown>:21: SyntaxWarning: invalid escape sequence '\-'
These syntax warnings do not appear with 3.4.19 but it seems possible they are causing the scan to fail. But the warnings are not very useful because they do not cite the file in which the issue occurs. I have searched for the string and added directories with the sequences to .prefectignore but those folders still appear in the scan results, indicating they are not being skipped.Marvin
09/24/2025, 3:58 PMMarvin
09/24/2025, 4:00 PMGet-ChildItem -Recurse -Filter *.py | % { python -W default -m py_compile $_.FullName }
Or:
python -W default -X dev -m compileall -q .
This should print warnings with file:line context. Fix by:
- Using raw strings for regexes: r"\d+" instead of "\d+"
- Or escaping backslashes: "\\d+" instead of "\d+"
These fixes will remove those warnings in 3.3.6 and may help avoid any edge-case scanner behavior.
3.4.x discovery regression on Windows
- Given your repro (Windows + Python 3.12.8 + Prefect 3.4.19) and that direct entrypoint deploy works, this looks like a wizard regression specific to the discovery step.
- I haven’t found a documented change explaining the skip. If you’re okay with it, I can open a GitHub issue on your behalf with:
- Prefect versions: works in 3.3.6, fails in 3.4.19
- OS/Python: Windows, Python 3.12.8
- Behavior: “No, configure a new deployment” skips flow scan and jumps to work pool; no “Scanning for flows…” output; no warnings printed
- Notes: .prefectignore not honored by discovery (only packaging), 3.3.6 shows SyntaxWarnings with <unknown> rather than file names (scanner should pass filename to warnings)
Workarounds you can use right now
- Keep deploying by explicit entrypoint:
prefect deploy engineering\tools\get_ip.py:get_ip -n debug_direct
- Or deploy from code to skip the wizard:
from prefect import flow
flow.from_source(
"<https://github.com/owner/repo>",
entrypoint="engineering/tools/get_ip.py:get_ip",
).deploy(
name="debug_direct",
work_pool_name="staging",
)
- If you prefer the wizard experience until a fix ships, pin Prefect to 3.3.6 in that environment.
If you’re okay with me filing the issue, I’ll include your anonymized transcripts and the version diffs. Also, if you can share your project’s prefect.yaml (redacted), I’ll attach it to rule out any config that could be tripping a new code path.
References
- Create deployments: Create deployments
- Prefect config and logging: Logging customization
- prefect.yaml reference: prefect.yamlJason Wiener
09/24/2025, 5:19 PMname: prefect-scripts
prefect-version: v3.4.19
pull:
- prefect.deployments.steps.git_clone:
repository: <https://github.com/><redacted>/prefect-scripts.git
branch: master
credentials: '{{ prefect.blocks.github-credentials.<redacted> }}'
deployments:
- name: dbt_run_sprout_social
description: "trigger Sprout Social dbt job - <https://cloud.getdbt.com/deploy/><redacted>/projects/<redacted>/jobs/873616"
entrypoint: engineering\tools\run_dbt_job.py:run_dbt_job_flow
parameters:
{"dbt_cloud_job_identifier": "sprout-social-dbt"}
- name: dbt_run_bitly_digital
description: "trigger Bitly Digital dbt job - <https://cloud.getdbt.com/deploy/><redacted>/projects/<redacted>/jobs/911051"
entrypoint: engineering\tools\run_dbt_job.py:run_dbt_job_flow
parameters:
{"dbt_cloud_job_identifier": "bitly-digital-dbt"}
Marvin
09/24/2025, 5:19 PMMarvin
09/24/2025, 5:20 PMprefect deploy engineering\tools\get_ip.py:get_ip -n debug_direct
- Or deploy from code using flow.from_source(...).deploy(...)
- If you prefer the wizard UX, pin to 3.3.6 until we confirm a fix
If you capture any short screen recording or additional DEBUG logs from 3.4.19 right after choosing “No, configure a new deployment”, I can append them to the thread.