Victor
03/04/2025, 2:08 AMBianca Hoch
03/04/2025, 8:29 PMVictor
03/05/2025, 2:36 AMBianca Hoch
03/07/2025, 3:04 PMparameters
defined under the deployment declaration. It'll look something like this:
deployments:
- name: insert-deployment-name-here
entrypoint: flows/hello.py:my_flow
parameters:
number: 42,
message: Don't panic!
work_pool:
name: my-process-work-pool
Once your prefect.yaml is ready, running the following command will create a new deployment record in the "Deployments" page Prefect UI:
prefect deploy --name insert-deployment-name-here
When you preview your new deployment from the UI, you'll see a "Run" button in the upper right-hand corner with a "Custom Run" option.
From there, you can pass in any custom values you'd like as input, and then kick off a new run of your flow.Bianca Hoch
03/07/2025, 3:10 PMprefect.yaml
file, the quickest way to create a deployment with parameters would be the .serve()
method, which looks like this:
from prefect import flow
@flow(log_prints=True)
def hello_world(name: str = "world", goodbye: bool = False):
print(f"Hello {name} from Prefect! :hugging_face:")
if goodbye:
print(f"Goodbye {name}!")
if __name__ == "__main__":
hello_world.serve(
name="my-first-deployment",
tags=["onboarding"],
parameters={"goodbye": True},
interval=60
)
When you run this script, it will create a deployment and start a long-running process that listens for new work.
You can do the same thing where you go to the Prefect UI, navigate to the Deployment page, and select the "Custom Run" option to pass inputs to the flow.