Connor Vaid
09/22/2025, 11:17 AMMarvin
09/22/2025, 11:17 AMMarvin
09/22/2025, 11:19 AMrun_deployment in Prefect 3.x. The server enforces the deployment’s parameter schema, and run_deployment does not expose a validate=False style flag.
What you can do instead (depending on what you’re trying to avoid validating):
- Make your flow accept flexible parameters so the generated schema is permissive:
- Use **kwargs (accept any keys), or
- Use a single params: dict (accept a dict payload), or
- Remove strict type annotations/defaults that make params required or strongly typed
- After changing the flow signature, redeploy so the deployment’s parameter schema is regenerated. The schema is captured at deploy time.
Example:
from prefect import flow
from prefect.deployments import run_deployment
@flow
def my_flow(**params):
# params can contain any keys/values
print(params)
# After modifying the signature, redeploy:
# my_flow.from_source("<https://github.com/owner/repo>", entrypoint="path/to/flow.py:my_flow").deploy(name="my-deployment")
run = run_deployment(
name="my-project/my-flow/my-deployment",
parameters={"any_key": 1, "another": "x"} # now accepted by a permissive schema
)
Notes:
- Even with a permissive schema, values must still be JSON-serializable.
- Calling the REST API or client directly will not bypass validation if the deployment has a strict schema; you need to relax the flow signature and redeploy.
If you can share:
- your flow signature,
- the exact validation error, and
- whether you’re sending extra keys vs. “wrong type” values,
I can suggest the smallest change to make your deployment accept what you need.
Related docs:
- Deployments and prefect.yaml
- Server-side validation overviewConnor Vaid
11/13/2025, 3:46 PMMarvin
11/13/2025, 3:46 PMMarvin
11/13/2025, 3:54 PMprefect flow-runs ls --state SCHEDULED --limit 100
- Delete a specific run:
prefect flow-run delete <flow_run_id>
- Or cancel it:
prefect flow-run cancel <flow_run_id>
- CLI docs: Flow run CLI
- Bulk delete scheduled runs without a deployment (Python)
import asyncio
from prefect.client.orchestration import get_client
from prefect.client.schemas.filters import (
FlowRunFilter,
FlowRunFilterState,
FlowRunFilterStateType,
FlowRunFilterDeploymentId,
)
from prefect.client.schemas.objects import StateType
async def main():
async with get_client() as client:
runs = await client.read_flow_runs(
limit=1000,
filter=FlowRunFilter(
state=FlowRunFilterState(
type=FlowRunFilterStateType(any_=[StateType.SCHEDULED])
),
deployment_id=FlowRunFilterDeploymentId(is_null_=True),
),
)
for r in runs:
await client.delete_flow_run(r.id)
print(f"Deleted {r.id}")
asyncio.run(main())
- If these runs actually come from a deployment schedule
- List schedules:
prefect deployment schedule ls "<flow-name>/<deployment-name>"
- Pause a schedule (also removes any auto-scheduled runs still in Scheduled state):
prefect deployment schedule pause "<flow-name>/<deployment-name>" <schedule_id>
- Delete a schedule:
prefect deployment schedule delete "<flow-name>/<deployment-name>" <schedule_id> -y
- Clear all schedules for a deployment:
prefect deployment schedule clear "<flow-name>/<deployment-name>" -y
- Docs: Schedules concept and CLI reference
Does that match what you’re seeing? If you can share one example run ID (and confirm you’re on Prefect 3.x), I can suggest the exact command(s) to clean them up.