Hi, I'm wondering if someone can point me to docum...
# prefect-community
j
Hi, I'm wondering if someone can point me to documentation on how I can compose a flow-of-flows and map upstream flow results to parameters in downstream flows.
k
You would need to use the
get_task_run_result
task to fetch the result for the specific task?
j
I'm struggling a bit on the retrieval of individual task results from an upstream flow. Could you comment on how task_ref is defined in this example from the docs:
Copy code
>>> state.result  # the public property aliases the same API as above
{<Task: add>: <Success: "Task run succeeded.">,
 <Task: add>: <Success: "Task run succeeded.">}
>>> state.result[task_ref]._result  # a Task State's Result contains the Task's return value
<Result: 1>
k
That is for using Core alone though. You don’t need that. You should just need to use
get_task_run_result
and then point that to the task slug of the upstream flow and you will get the result loaded in.
j
@Kevin Kho what if I'd like to access individual task results from that upstream flow?
One example: Saving different file results, each with their own designated task
k
get_task_run_result
points to the
return
of a specific task in a previous flow run. You can map over this task too if you provide all of the task-slugs.
j
Ah okay- seeing now... The examples in this doc might also be useful to reference in the flow of flows docs: https://docs.prefect.io/orchestration/flow-runs/task-runs.html#task
k
Ah I haven’t seen that page before haha