<@ULVA73B9P>, I’ve created a deployment, named `my...
# ask-marvin
s
@Marvin, I’ve created a deployment, named
mydeployment
, in my prefect.yaml which runs the flow
myflow
. This gives the deployment
myflow/mydeployment
. However, I would like to change the name of the flow from the prefect.yaml to name the deployment as
flow2/mydeployment
. How can I do this?
m
To change the name of the flow in your deployment, you can modify the
prefect.yaml
file. However, the name of the flow in the deployment is determined by the flow name in your Python code, not the
prefect.yaml
file. If you want to change the name of the flow in the deployment, you would need to change the name of the flow in your Python code where the flow is defined. For example, if your current flow is defined as:
Copy code
@flow
def myflow():
    # flow tasks here
You would change it to:
Copy code
@flow
def flow2():
    # flow tasks here
Then, in your
prefect.yaml
file, you would reference
flow2
instead of
myflow
. Please note that the
prefect deploy
command uses the flow name and deployment name in the format
flowname/deploymentname
. So if you want to deploy your renamed flow, you would use:
Copy code
bash
$ prefect deploy --name flow2/mydeployment
Remember, when deploying more than one deployment with a single
prefect deploy
command, any additional attributes provided via the CLI will be ignored. To provide overrides to a deployment via the CLI, you must deploy that deployment individually.