Robert Szomolanyi
11/26/2025, 9:22 PMMarvin
11/26/2025, 9:22 PMMarvin
11/26/2025, 9:27 PMRunnerDeployment.__init__ does not accept parameter_openapi_schema (it’s managed internally as a private attribute). Prefect will auto-generate the parameter schema from your flow’s signature based on the entrypoint.
Given your flow has two int parameters (sleep1, sleep2), Prefect will infer an OpenAPI schema with both as integers automatically.
If you do want to set it explicitly, generate it and assign to the private attribute after constructing the deployment:
from prefect.utilities.callables import parameter_schema_from_entrypoint
from prefect.runner.storage import LocalStorage
from prefect.deployments.runner import RunnerDeployment
schema = parameter_schema_from_entrypoint("lif_tests.simple_flow:flow_func")
deployment = RunnerDeployment(
name="Test simple flow",
flow_name="flow_func",
entrypoint="lif_tests.simple_flow:flow_func",
work_pool_name="default_pool",
storage=LocalStorage(path=env_config.working_directory),
tags=["test"],
description=description,
version=get_version("lif_template"),
parameters={"sleep1": 5, "sleep2": 3},
)
deployment._parameter_openapi_schema = schema
For reference, the resulting schema (conceptually) looks like:
{
"title": "Parameters",
"type": "object",
"properties": {
"sleep1": {
"type": "integer",
"title": "sleep1",
"position": 0
},
"sleep2": {
"type": "integer",
"title": "sleep2",
"position": 1
}
},
"required": [
"sleep1",
"sleep2"
]
}
Tip: If you don’t need to set it manually, you can omit this entirely—Prefect will infer it from the entrypoint.