Mrigank .
09/10/2025, 12:09 PMMarvin
09/10/2025, 12:09 PMMarvin
09/10/2025, 12:15 PMprefect server start
# then set your profile to use that API URL so future runs reuse it
prefect config set PREFECT_API_URL=http://<host>:<port>
Docs: Server CLI
- Or disable ephemeral servers entirely (flows will run “offline” and won’t record to a server/UI):
# one-time in your current profile
prefect config set PREFECT_SERVER__EPHEMERAL__ENABLED=false
# or via env var
export PREFECT_SERVER__EPHEMERAL__ENABLED=false
Settings reference: ServerEphemeralSettings
Notes
- If you’re connected to Prefect Cloud or a self-hosted server (i.e., PREFECT_API_URL
is set), Prefect won’t start an ephemeral server.
- Ephemeral servers are per-process and shut down when the process exits.
If you can share how you’re running flows (e.g., python flow.py
, prefect run
, multiple terminals, etc.), I can suggest the cleanest setup for your case.Mrigank .
09/10/2025, 12:47 PMMarvin
09/10/2025, 12:47 PMMarvin
09/10/2025, 12:50 PMprefect config set PREFECT_SERVER__EPHEMERAL__ENABLED=false
- Make sure you are not pointing at any API:
prefect config unset PREFECT_API_URL
or verify:
prefect config view --show-defaults
You should NOT see PREFECT_API_URL=http://...
and should NOT see PREFECT_API_URL=ephemeral
.
Optional: silence API logging attempts when offline
- Prefect can try to send logs to the API if that feature is on. Turn it off to avoid noise:
prefect config set PREFECT_LOGGING__TO_API__ENABLED=false
Settings ref: Settings reference
If you want a single server instead of many ephemeral ones
- Start a persistent local server and reuse it:
prefect server start
prefect config set PREFECT_API_URL=<http://localhost:4200> # adjust if needed
Docs: Server CLI
If you’re seeing different behavior after disabling ephemeral servers, please paste the exact command you’re running and any log output — I’ll help pinpoint what’s still triggering server usage.Mrigank .
09/10/2025, 12:55 PMPREFECT_SERVER_ALLOW_EPHEMERAL_MODE='false' (from profile)
PREFECT_SERVER_EPHEMERAL_ENABLED='false' (from profile)
But when running the flow we are seeing below error
ValueError: No Prefect API URL provided. Please set PREFECT_API_URL to the address of a running Prefect server.
Marvin
09/10/2025, 12:55 PMMarvin
09/10/2025, 12:58 PMPREFECT_API_URL
.
Two important points:
- The correct setting to disable ephemeral servers in Prefect 3 is PREFECT_SERVER__EPHEMERAL__ENABLED=false
(note the double underscores). You can confirm your active values with:
prefect config view --show-defaults
Docs: ServerEphemeralSettings
- PREFECT_SERVER_ALLOW_EPHEMERAL_MODE
is not a Prefect 3 setting; you can remove it.
Why you’re seeing the error
- With ephemeral disabled, Prefect will not auto-start a server. If your code uses any API-dependent features, you’ll get:
ValueError: No Prefect API URL provided. Please set PREFECT_API_URL ...
- Common API-dependent features:
- Deployments (flow.from_source(...).deploy(...)
, prefect.deploy
, prefect.serve
)
- Variables or blocks (Variable.get
, Block.load
, filesystem blocks)
- Artifacts (create_markdown_artifact
, create_table_artifact
, etc.)
- Client usage (get_client
, PrefectClient
)
- Pause/resume, automations, concurrency limits, events
- Running a deployment by name (run_deployment
)
How to proceed (pick one)
1) Keep running offline (no server)
- Remove or guard calls that require the API.
- Optionally turn off logging-to-API to avoid noise:
prefect config set PREFECT_LOGGING__TO_API__ENABLED=false
- Then run your flow by calling the function directly (e.g., python your_flow.py
). This will work without PREFECT_API_URL
.
2) Use a persistent local server instead of ephemeral
- Start one server and point your profile to it so all runs reuse it:
prefect server start
prefect config set PREFECT_API_URL=<http://localhost:4200> # adjust to your host/port
Docs: Server CLI
Quick checklist
- Verify ephemeral is really off:
prefect config view --show-defaults
Ensure you see PREFECT_SERVER__EPHEMERAL__ENABLED=false
.
- If you want offline: ensure there’s no PREFECT_API_URL
set and no API-dependent feature is used.
- If you want server-backed features: set PREFECT_API_URL
to a running server.
If you paste the stack trace or share which Prefect features your flow uses (e.g., artifacts, variables, deployments), I can point out exactly which call is triggering the API requirement and suggest a workaround.