Access attributes of the current deployment run dynamically.
Note that if a deployment is not currently being run, all attributes will return empty values.
from prefect.runtime import deployment def get_task_runner(): task_runner_config = deployment.parameters.get("runner_config", "default config here") return DummyTaskRunner(task_runner_specs=task_runner_config)
id: the deployment's unique ID
flow_run_id: the current flow run ID for this deployment
parameters: the parameters that were passed to this run; note that these do not necessarily include default values set on the flow function, only the parameter values set on the deployment object or those directly provided via API for this run