Cade Summers
09/19/2025, 3:51 PMNate
09/19/2025, 3:52 PMprefect version
say?Nate
09/19/2025, 3:53 PMMarvin
09/19/2025, 4:25 PMCade Summers
09/19/2025, 4:25 PMCade Summers
09/19/2025, 4:29 PMMarvin
09/19/2025, 4:29 PMprefect version
- Confirm which profile is active and what it’s configured to use:
prefect profile ls
prefect profile inspect
- Check for environment variable overrides that will “pin” you to a workspace:
- macOS/Linux:
env | grep PREFECT
If you see PREFECT_API_URL
, PREFECT_API_KEY
, or PREFECT_PROFILE
set, they override your profile. Unset them:
unset PREFECT_API_URL PREFECT_API_KEY PREFECT_PROFILE
- Windows (PowerShell):
gci env:PREFECT*
Unset with:
Remove-Item Env:PREFECT_API_URL, Env:PREFECT_API_KEY, Env:PREFECT_PROFILE
How to set the workspace correctly
- Use the full handle and regular double hyphens. The format is <account_handle>/<workspace_handle>
(e.g., my-org/dev
):
prefect cloud workspace set --workspace my-org/dev
Tip: Avoid curly quotes or em-dashes that sometimes appear from copy/paste.
How to verify you actually switched
- Open the current workspace to visually confirm:
prefect cloud open
- Inspect effective config and sources:
prefect config view --hide-defaults --show-sources
Look for PREFECT_API_URL
whose value should include your dev workspace ID (the URL typically contains /accounts/<account_id>/workspaces/<workspace_id>
). The “source” should be “profile” unless you’ve set env vars.
- Optionally, inspect something that differs by workspace, e.g.:
prefect work-pool ls
The pools should match what exists in your dev workspace.
Common gotchas
- prefect cloud workspace ls
lists available workspaces but does not necessarily indicate which one is currently active. Use prefect cloud open
or prefect config view
to verify the active one.
- If you have multiple profiles, prefect cloud workspace set
only updates the currently active profile. Make sure you’re operating in the profile you think you are:
prefect profile ls
prefect profile use <your-profile>
- Shell or CI environment variables (e.g., from a .env
file or CI job) can override your profile. Unset or update them if present.
If all else fails, re-authenticate cleanly
- Log out then log back into the target workspace in one step:
prefect cloud logout
prefect cloud login -k <YOUR_API_KEY> -w my-org/dev
Then verify with prefect cloud open
and prefect config view
.
Docs for reference:
- Workspaces in Prefect Cloud
- Connect to Prefect Cloud
- Settings and Profiles
If you can share:
- Your Prefect version (prefect version
)
- The exact command you ran (including the handle you used)
- Output from prefect profile inspect
and prefect config view --hide-defaults --show-sources
…I can pinpoint why it’s sticking to prod in your environment.Nate
09/19/2025, 5:28 PMprefect config view
for something strange, i cant reproduce that behavior on latest prefect
» prefect cloud workspace set -w prefect-technologies/marvin-bot
Successfully set workspace to 'prefect-technologies/marvin-bot' in profile 'pond'.
» prefect cloud workspace ls | rg bot
│ prefect-sandbox/roast-bot │
│ * prefect-technologies/marvin-bot │
» prefect cloud workspace set -w prefect-sandbox/inconspicuous-pond
Successfully set workspace to 'prefect-sandbox/inconspicuous-pond' in profile 'pond'.
» prefect cloud workspace ls | rg pond
│ * prefect-sandbox/inconspicuous-pond │