Hey Everyone - I’ve started to migrate to Prefect ...
# ask-community
l
Hey Everyone - I’ve started to migrate to Prefect 2 and enjoying the journey so far. I’m wondering if there’s a Prefect 2 equivalent of the StartFlowRun task that exists in Prefect 1. I’m looking to create a task in flow run deployment A which runs a flow run deployment B, and then waits for that flow run to finish. It’s similar to the subflow concept, except I want to use different deployments (in my case, different docker images for the subflow runs). I couldn’t find a built in task for this, but it seems like I may be able to roll my own using the OrionClient’s
create_flow_run_from_deployment
. Thanks!
1
k
I think
from prefect.deployments import run_deployment
is what you're looking for
gratitude thank you 1
🙌 4
a
+1 to Kevin you can also just use subflows to run flows from other flows this recent post dives into both approaches https://medium.com/the-prefect-blog/modular-data-stack-build-a-data-platform-with-prefect-dbt-and-snowflake-part-7-95f908d29a01
👍 2
l
Perfect that’s exactly what I needed. Thanks @Kevin Grismore and @Anna Geller!
🙌 2
b
Hey @Anna Geller, I am using this too, just reading the docs on the site here. Should the
name
parameter read
The deployment name in the form 'flow/deployment'
instead of how it reads
the deployment name in the form '/'
?
I can see in your blog post that is how you use it 🙂
looks like it is some issue with the docs generation, it is correct in the doc string fyi 🙂
a
Hmm I see, could you open an issue for it? Not sure where exactly docs have something wrong there. Thanks for reporting
b
It's probably the HTML esq tags, because it is valid markdown. I can create an issue later today.
gratitude thank you 1