<@ULVA73B9P> Is there a way to build a deployment ...
# ask-marvin
r
@Marvin Is there a way to build a deployment with more than one flow together? Possibly using prefect deployment build
m
Based on the information retrieved, it appears that Prefect does not directly support building a deployment with more than one flow using a single
prefect deployment build
command. When you run this command, you create a deployment definition file (
deployment.yaml
) for a single flow based on your flow code and options provided in the command. The documentation examples show using the
prefect deployment build
command with a specific path to a flow script and an entrypoint flow function, indicating the focus on a single flow at a time:
Copy code
bash
$ prefect deployment build -n marvin -p default-agent-pool -q test flows/marvin.py:say_hi
However, the documentation snippet does not continue to provide details about deploying multiple flows together, and there's no mention of a feature that allows you to combine multiple flows into a single deployment file. If you have multiple flows that you wish to deploy together, you may need to create separate deployment files for each one and manage them individually. If you need more information or if there's been an update to Prefect allowing for multi-flow deployments, we may need to look into the latest documentation or Prefect's GitHub issues for any recent developments on this topic.
n
hey @Raffaele - what do you mean by this?
build a deployment with more than one flow together
do you mean: • deploy multiple flows at once • create a deployment that contains many flows
r
Hi, I would like to have a single deployment that contains multiple flows
n
that is supported with standard deployments! you can use whichever deployment UX suits your situation (I recommend
serve
to get started,
prefect deploy
with workers for a larger data practice), but you're free to deploy any flow that calls subflows like
Copy code
from prefect import flow, serve  # noqa

@flow
def another_one():
    pass

@flow(log_prints=True)
def my_flow(x: int, y: int = 1, z: str = "hello"):
    print(x, y, z)
    another_one()

if __name__ == "__main__":
    my_flow.serve(__file__) # or any deployment name instead of `__file__`
or do you mean something else by
single deployment that contains multiple flows
at this time, deployments have a single entrypoint, which corresponds to a single flow, but that flow can call other flows inside of it