Baker
02/13/2024, 9:51 PMMarvin
02/13/2024, 9:51 PMrun_deployment
call in a Prefect flow, I'd suggest you probably want to use some kind of result persistence mechanism. You could use Prefect's built-in result handlers to store the outputs of tasks (or flows) and retrieve them later.
This isn't completely straightforward, because you're dealing with a series of runs and not just a single output, but there are ways to manage this:
1. Use Prefect Results to capture outputs from each run and store them in a location that supports multiple writes, such as a database, S3, or another cloud storage solution. Each result can hold the return value of a task.
2. Design your flow to collect results at the end by querying whatever storage backend you're using. This could be a task that intermittently checks for completed runs and aggregates their results.
3. If you need realtime monitoring, you might consider setting up a webhook or similar notification service that triggers when a flow run completes, pushing the result to a collection service or queue.
4. Alternatively, you may want to use Parameters or Prefect Signals to pass information between flows or indicate that a task should store its result in a designated place for later aggregation.
Since you mentioned run_deployment
, which sounds like a feature of a Prefect 2.x (Orion) version, and I don't have direct experience with it, I suggest checking the latest Prefect Orion documentation and GitHub issues to find the best practices for handling such cases in the new version.
Let's use a combination of repository search for relevant GitHub issues and a check for the latest version of Prefect to give you a head start:
plaintext
- Search for issues related to "run_deployment" and results collection on GitHub
- Fetch latest Prefect version information
Would you like me to perform this search for you?Nate
02/13/2024, 10:09 PMrun_deployment
will give you back a flow_run
, with a flow_run
you can do flow_run.state.result()
to get the return value provided you have results persisted on that flow you triggered
itd be no different for a bunch of them