Florent VanDeMoortele
02/20/2024, 2:43 PMMarvin
02/20/2024, 2:44 PMflow_name
and deployment_name
. You can reference a given flow with multiple deployments but apparently, the explicit setting of the flow name during the creation of a deployment isn't directly mentioned in the excerpts I found.
For detailed instructions and clarifications, you might want to consult the Block-based Deployments documentation, as it could provide more insights into the configuration at deployment.Florent VanDeMoortele
02/20/2024, 2:53 PMMarvin
02/20/2024, 2:53 PMFlorent VanDeMoortele
02/20/2024, 2:54 PMMarvin
02/20/2024, 2:55 PMpython
from prefect import flow
flow_name_variable = "dynamic_flow_name" # Set your flow name here
@flow(name=flow_name_variable)
def my_dynamic_flow():
print("This flow has a dynamic name based on a Python variable")
if __name__ == "__main__":
my_dynamic_flow()
In this code, flow_name_variable
is a Python variable containing the name you want to assign to your flow. When you decorate your flow function with @flow(name=flow_name_variable)
, Prefect will use the value of that variable as the flow name.
For more details on Prefect flow API and its configuration, the Prefect documentation should provide additional information:
- Prefect Flows
- Prefect API Reference
Please note that how you deploy this flow might vary, and you might need to check if there are any additional steps or configurations required for the deployment with a dynamic flow name.