<@ULVA73B9P> I am using the run_deployment functio...
# ask-marvin
c
@Marvin I am using the run_deployment function but I don't want it to validate the parameters
m
thought for 116.2 seconds
Short answer: there isn’t a way to turn off parameter validation in
run_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:
Copy code
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 overview
c
@Marvin I have a scheduled flow that does not have an associated deployment. how can I delete these scheduled flows?
m
thought for 468.5 seconds
Short answer: In Prefect 3.x, there aren’t standalone schedules — schedules live on deployments. If you’re seeing “Scheduled” flow runs without a deployment, they were likely created ad‑hoc (e.g., scheduled for a future time) and you can delete/cancel those runs directly. Options: - Delete/cancel the scheduled runs (no deployment) - List scheduled runs:
Copy code
prefect flow-runs ls --state SCHEDULED --limit 100
- Delete a specific run:
Copy code
prefect flow-run delete <flow_run_id>
- Or cancel it:
Copy code
prefect flow-run cancel <flow_run_id>
- CLI docs: Flow run CLI - Bulk delete scheduled runs without a deployment (Python)
Copy code
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:
Copy code
prefect deployment schedule ls "<flow-name>/<deployment-name>"
- Pause a schedule (also removes any auto-scheduled runs still in Scheduled state):
Copy code
prefect deployment schedule pause "<flow-name>/<deployment-name>" <schedule_id>
- Delete a schedule:
Copy code
prefect deployment schedule delete "<flow-name>/<deployment-name>" <schedule_id> -y
- Clear all schedules for a deployment:
Copy code
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.