Is there a Prefect/python-native way for a flow to...
# prefect-community
b
Is there a Prefect/python-native way for a flow to trigger different deployments? I have a few deployments that have different Docker and k8's requirements, but are related. A simple example is one deployment loading data to s3 and another deployment running dbt on that data. It would be incredible if I could create a parent flow which triggered the pre-defined deployments sequentially. Some (hacky-ish) solutions I can think of: ā€¢ Define the logic in one big flow and consolidate to one Docker container ā€¢ Create a flow with the prefect-shell collection and run deployment CLI commands to trigger the deployments sequential These solutions would definitely work as expected. I am curious if there is another solution using the new python
Deployment
class (not seeing anything in the API reference). Or, if anyone else would find a
.run()
method on the
Deployment
class useful? šŸ˜¼
āœ… 1
n
Hi @Blake Hamm
It would be incredible if I could create a parent flow which triggered the pre-defined deployments sequentially.
you're in luck, you can use
client.create_flow_run_from_deployment
to do exactly that here are the docs here's a previous thread where I explained this
b
Epic! Thank you Nate! I wasn't digging deep enough into the docs. I really appreciate you steering me in the right direction! Of course this is already a feature; amazing!
šŸ¦œ 1