<@ULVA73B9P> - if my flow has required parameters ...
# ask-marvin
k
@Marvin - if my flow has required parameters and I create a scheduled deployment without specifying arguments, does the API error and not allow the schedule to be created, since it is not valid?
m
thought for 84.1 seconds
Short answer: No. Prefect will let you create the deployment and attach a schedule even if your flow has required parameters and you don’t supply values. What happens next: - When the scheduler tries to materialize scheduled occurrences into flow runs, the API validates parameters against the flow’s schema. - If required parameters are missing, the create_flow_run request is rejected (HTTP 409 “Validation failed”), so the run is not created. You’ll see errors in server logs and no runs appear for those times. - This is the same general behavior in Prefect 2.x as well. How to avoid it: - Provide defaults in your flow signature, e.g.
def flow(x: int = 1)
. - Or set deployment parameters when creating the deployment/schedule. - Or pass parameters from the trigger (e.g., an automation) and ensure types/values are correct. Refs: - Prefect 3.x — Create schedules - Example of parameter validation at flow run creation (409) during automation-triggered runs: GitHub issue #17885 If you share how you’re creating the deployment/schedule (code or CLI), I can show the exact place to set parameters so your scheduled runs are valid.